Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Compensation Intelligence System

A production-grade, full-stack compensation intelligence platform inspired by Levels.fyi, AmbitionBox, 6figr, and Glassdoor.

This platform emphasizes that levels matter more than job titles and delivers structured compensation comparisons instead of simple salary listings.


Tech Stack

Frontend

  • React.js
  • Tailwind CSS v4
  • Lucide React Icons
  • Recharts (Data Visualizations)
  • Vite

Backend

  • Node.js
  • Express.js
  • Prisma ORM
  • Zod Validation

Database

  • PostgreSQL (tested locally on PostgreSQL v18 and fully compatible with Neon)

Project Structure

compensation-intelligence-system/
├── backend/
│   ├── prisma/
│   │   ├── schema.prisma
│   │   └── seed.js
│   │
│   ├── src/
│   │   ├── controllers/
│   │   │   └── salary.controller.js
│   │   │
│   │   ├── services/
│   │   │   └── salary.service.js
│   │   │
│   │   ├── validation/
│   │   │   └── salary.validation.js
│   │   │
│   │   ├── routes/
│   │   │   └── api.routes.js
│   │   │
│   │   ├── app.js
│   │   └── index.js
│   │
│   ├── verify.js
│   ├── .env
│   └── package.json
│
└── frontend/
    ├── src/
    │   ├── components/
    │   │   ├── Navbar.jsx
    │   │   ├── StatsCard.jsx
    │   │   ├── LevelDistributionChart.jsx
    │   │   ├── ComparisonCard.jsx
    │   │   ├── IngestModal.jsx
    │   │   └── SkeletonLoader.jsx
    │   │
    │   ├── pages/
    │   │   ├── Home.jsx
    │   │   ├── Salaries.jsx
    │   │   ├── Company.jsx
    │   │   └── Compare.jsx
    │   │
    │   ├── utils/
    │   │   └── api.js
    │   │
    │   ├── App.jsx
    │   ├── main.jsx
    │   └── index.css
    │
    ├── tailwind.config.js
    ├── postcss.config.js
    ├── vite.config.js
    └── package.json

Installation & Setup Instructions

Prerequisites

Make sure the following are installed:

  • Node.js v18+
  • PostgreSQL Server

Example local PostgreSQL configuration:

Host: localhost
Port: 5433
Username: postgres

Backend Setup

1. Navigate to Backend Directory

cd backend

2. Configure Environment Variables

Create a .env file inside the backend directory:

DATABASE_URL="postgresql://postgres:yadhidya@localhost:5433/compensation_db?schema=public"
PORT=5000
NODE_ENV=development

3. Run Prisma Migrations

Create database tables and generate Prisma Client:

npx prisma migrate dev --name init

4. Seed the Database

Populate the database with realistic compensation entries from companies such as:

  • Google
  • Meta
  • Apple
  • Netflix
  • Amazon

Run:

npm run prisma:seed

5. Start the Backend Server

npm run start

Backend server will run on:

http://localhost:5000

Frontend Setup

1. Navigate to Frontend Directory

Open a separate terminal:

cd frontend

2. Start the Frontend Development Server

npm run dev

Frontend application will run on:

http://localhost:3000

REST API Documentation

1. Ingest Salary

Endpoint

POST /api/ingest-salary

Request Body

{
  "company": "Google",
  "role": "Software Engineer",
  "level": "L4",
  "location": "Mountain View, CA",
  "experienceYears": 3,
  "baseSalary": 170000,
  "bonus": 25000,
  "stock": 80000
}

Response

{
  "success": true,
  "message": "Salary data successfully ingested.",
  "isDuplicate": false,
  "data": {
    "id": "de959fa2-e0a1-40d0-b73f-5000ee5f52c7",
    "company": "google",
    "companyDisplay": "Google",
    "role": "Software Engineer",
    "level": "L4",
    "location": "Mountain View, CA",
    "totalCompensation": 275000,
    "createdAt": "2026-05-23T10:15:30Z"
  }
}

2. Get Salaries (Search + Pagination)

Endpoint

GET /api/salaries

Query Parameters

company
role
level
location
sortBy
sortOrder
page
limit

Response

{
  "success": true,
  "items": [],
  "pagination": {
    "total": 23,
    "page": 1,
    "limit": 10,
    "totalPages": 3
  }
}

3. Get Company Statistics & Analytics

Endpoint

GET /api/company/:company

Response

{
  "success": true,
  "data": {
    "companyName": "Google",
    "totalSubmissions": 6,
    "statistics": {
      "medianBaseSalary": 204000,
      "medianBonus": 25000,
      "medianStock": 137500,
      "medianTotalCompensation": 371500,
      "minTotalCompensation": 210000,
      "maxTotalCompensation": 600000
    },
    "levelDistribution": [
      {
        "level": "L6",
        "count": 1,
        "medianTotalCompensation": 600000
      },
      {
        "level": "L5",
        "count": 2,
        "medianTotalCompensation": 400000
      }
    ],
    "salaries": []
  }
}

4. Compare Compensation Side-by-Side

Endpoint

GET /api/compare?id1=ID_A&id2=ID_B

Response

{
  "success": true,
  "data": {
    "salary1": {},
    "salary2": {},
    "deltas": {
      "baseSalary": {
        "difference": 28000,
        "percentage": 16.47
      },
      "bonus": {
        "difference": 5000,
        "percentage": 20
      },
      "stock": {
        "difference": 40000,
        "percentage": 50
      },
      "totalCompensation": {
        "difference": 73000,
        "percentage": 26.55
      }
    }
  }
}

Deployment Ready

Frontend Deployment

The frontend can be deployed easily using:

  • Vercel

Backend Deployment

The backend is fully deployable on:

  • Render
  • Railway

Configure the following environment variables during deployment:

DATABASE_URL=
PORT=
NODE_ENV=production

Run Prisma migrations during deployment:

npx prisma migrate deploy

Database Deployment

The project is fully compatible with:

  • Neon PostgreSQL

Simply copy the Neon connection string into:

DATABASE_URL

inside the backend environment configuration.


Core Features

  • Compensation comparison system
  • Structured salary analytics
  • Company-level insights
  • Level-based compensation tracking
  • Pagination and filtering
  • Salary ingestion system
  • Duplicate detection
  • Company normalization
  • RESTful APIs
  • Responsive frontend UI
  • Data visualizations
  • Scalable backend architecture

Important Engineering Highlights

  • Levels are prioritized over job titles
  • Server-side filtering and pagination
  • Clean Prisma ORM architecture
  • Zod validation for secure APIs
  • Duplicate salary entry handling
  • Optimized database querying
  • Responsive production-ready UI
  • Modular and scalable codebase

Releases

Packages

Contributors

Languages