A modern, Gen Z-friendly web application for calculating in-hand salary according to Indian tax laws and checking resume compatibility with Applicant Tracking Systems (ATS). Built with React/Vite frontend and NestJS backend.
- ๐งฎ Calculate in-hand salary based on CTC and city
- ๐ Support for major Indian cities with accurate tax calculations
- ๐ Detailed salary breakdown (Basic, HRA, EPF, ESI, Professional Tax, Income Tax)
- ๐ Variable pay and insurance support
- ๐พ Save calculation history in database
- ๐ User-specific calculation history with easy access
- ๐ Analyze resume compatibility with ATS systems
- ๐ Support for PDF and DOCX file formats (up to 2MB)
- ๐ฏ ATS score calculation (0-100)
- โ Keyword matching analysis
- ๐ช Strengths identification
โ ๏ธ Areas for improvement detection- ๐ก Actionable suggestions for optimization
- โฑ๏ธ Rate limiting: 3 checks per user, resets every 12 hours
- ๐ GitHub OAuth integration
- ๐ง Email/Password authentication
- ๐ค User profile management
- ๐ Secure JWT-based authentication
- ๐พ User-specific data storage
- React 19
- TypeScript
- Vite
- Lucide React (Icons)
- Axios
- NestJS
- TypeScript
- PostgreSQL
- TypeORM
- JWT Authentication
- Passport.js (GitHub OAuth)
- bcryptjs (Password hashing)
- Multer (File uploads)
- pdf-parse (PDF parsing)
- mammoth (DOCX parsing)
- Node.js (v20.13.1 or higher)
- PostgreSQL (v12 or higher) or Neon account
- npm or pnpm
- GitHub account (for OAuth, optional)
- Clone the repository
git clone https://github.com/akashkaintura/salary-calculator.git
cd salary-calculator- Set up the Backend
cd backend
npm install
# Create a .env file
cp .env.example .env
# Edit .env with your configuration
# See Environment Variables section below- Set up Database
Option A: Using Neon (Recommended)
- Go to neon.tech and create a project
- Copy your
DATABASE_URLconnection string - Add it to
backend/.env
Option B: Local PostgreSQL
createdb salary_calculator
# Or using psql
psql -U postgres
CREATE DATABASE salary_calculator;
\q- Seed the Database (Optional)
cd backend
npm run seed- Start the Backend
cd backend
npm run start:devThe backend will run on http://localhost:3000
- Set up the Frontend
cd frontend
npm install
# Create a .env file
echo "VITE_API_URL=http://localhost:3000" > .env- Start the Frontend
cd frontend
npm run devThe frontend will run on http://localhost:5173
# Database Configuration
DATABASE_URL=postgresql://user:password@host:port/database?sslmode=require&channel_binding=require
# OR Use individual parameters (for local development)
# DB_HOST=localhost
# DB_PORT=5432
# DB_USERNAME=postgres
# DB_PASSWORD=your_password
# DB_NAME=salary_calculator
# Server Configuration
PORT=3000
NODE_ENV=development
# Frontend URL (for CORS)
FRONTEND_URL=http://localhost:5173
# GitHub OAuth (Get from https://github.com/settings/developers)
GITHUB_CLIENT_ID=your_github_client_id_here
GITHUB_CLIENT_SECRET=your_github_client_secret_here
GITHUB_CALLBACK_URL=http://localhost:3000/api/auth/github/callback
# JWT Secret (Generate: openssl rand -base64 32)
JWT_SECRET=your-super-secret-jwt-key-change-this-in-production
# UPI Payment Configuration
UPI_ID=your-upi-id@paytm # Your UPI ID (e.g., yourname@paytm, yourname@ybl, etc.)
MERCHANT_NAME=SalaryCalc # Your business/merchant name
PAYMENT_SECRET=your-payment-secret-key # Secret key for payment verification (optional, auto-generated if not provided)
```
### Frontend (.env)
```env
VITE_API_URL=http://localhost:3000-
Create GitHub OAuth App
- Go to GitHub Developer Settings
- Click "New OAuth App"
- Fill in:
- Application name:
Salary Calculator - Homepage URL: Your frontend URL
- Authorization callback URL: Your backend URL +
/api/auth/github/callback
- Application name:
- Click "Register application"
-
Get Credentials
- Copy Client ID
- Generate and copy Client Secret
- Add both to
backend/.env
- Users can register with email and password
- No additional setup required
- Passwords are securely hashed with bcrypt
The calculator uses the following structure:
- Basic Salary: 50% of Fixed CTC
- HRA: 40% of Fixed CTC
- Special Allowance: 10% of Fixed CTC
- Fixed CTC: Total CTC - Variable Pay - Insurance
- EPF: 12% of Basic Salary (employee contribution)
- ESI: 0.75% of Gross Salary (if salary < โน21,000)
- Professional Tax: Varies by state/city
- Income Tax: Based on new tax regime 2024-25
- Variable Pay: Part of CTC but not included in monthly salary calculations
- Insurance: Health/Life insurance premiums (part of CTC, not monthly salary)
- Monthly salary is calculated from Fixed CTC only
The ATS checker analyzes resumes based on:
- Keyword Matching: Checks for 50+ common ATS keywords
- Resume Length: Optimal length analysis (300-1000 words)
- Section Detection: Verifies presence of contact, experience, education, and skills sections
- Action Verbs: Identifies use of action verbs
- Score Calculation: Combines keyword density (60%) and length optimization (40%)
- 3 checks per user per 12-hour window
- Automatic reset after 12 hours from first check
- Usage tracking in database
POST /api/auth/register- Register with email/passwordPOST /api/auth/login- Login with email/passwordGET /api/auth/github- Initiate GitHub OAuthGET /api/auth/github/callback- GitHub OAuth callbackGET /api/auth/me- Get current user profile (requires auth)POST /api/auth/update-profile- Update user profile (requires auth)
POST /api/salary/calculate- Calculate salary breakdown (requires auth)GET /api/salary/history- Get user's calculation history (requires auth)
POST /api/ats/check- Upload and analyze resume (requires auth, file upload)POST /api/ats/usage- Get remaining checks and reset time (requires auth)
salary-calculator/
โโโ frontend/
โ โโโ src/
โ โ โโโ App.tsx # Main application component
โ โ โโโ App.css # Styles
โ โ โโโ main.tsx # Entry point
โ โ โโโ components/
โ โ โ โโโ Login.tsx # Login/Signup component
โ โ โ โโโ AtsChecker.tsx # ATS Checker component
โ โ โโโ contexts/
โ โ โโโ AuthContext.tsx # Authentication context
โ โโโ package.json
โ โโโ vite.config.ts
โโโ backend/
โ โโโ src/
โ โ โโโ main.ts # Application entry point
โ โ โโโ app.module.ts # Root module
โ โ โโโ auth/ # Authentication module
โ โ โ โโโ auth.controller.ts
โ โ โ โโโ auth.service.ts
โ โ โ โโโ strategies/ # GitHub & JWT strategies
โ โ โ โโโ dto/ # Register & Login DTOs
โ โ โโโ user/ # User module
โ โ โ โโโ entities/
โ โ โ โโโ user.entity.ts
โ โ โโโ salary/ # Salary calculation module
โ โ โ โโโ salary.controller.ts
โ โ โ โโโ salary.service.ts
โ โ โ โโโ dto/
โ โ โ โโโ entities/
โ โ โโโ ats/ # ATS checker module
โ โ โโโ ats.controller.ts
โ โ โโโ ats.service.ts
โ โ โโโ entities/
โ โ โโโ ats-usage.entity.ts
โ โโโ package.json
โ โโโ tsconfig.json
โโโ README.md
- Verify
DATABASE_URLis correct - Check that database is active (not paused)
- Ensure SSL is enabled if using cloud database
- Ensure
FRONTEND_URLin backend matches your frontend URL exactly - Check that frontend is using the correct
VITE_API_URL
- Verify GitHub OAuth credentials are correct
- Check that callback URL matches exactly
- Ensure JWT_SECRET is set
- Verify file is PDF or DOCX format
- Check file size is under 2MB
- Ensure user has remaining checks available
- Check Node.js version (should be 20+)
- Verify all dependencies are in
package.json - Check build logs for specific errors
ISC
Contributions are welcome! Please feel free to submit a Pull Request.