A robust RESTful API backend for a Human Resources Management System built with NestJS, Prisma, and PostgreSQL. This backend powers the HR management system with complete CRUD operations for employees, departments, candidates, and salary management.
Backend Applicatin: Deployed on Render
Frontend Application: Deployed on Netlify, check it out here Demo Link
Framework: NestJS 8
Database: PostgreSQL with Supabase
ORM: Prisma
Deployment: Render
Package Manager: npm
GET /employees - Get all employees
GET /employees/:id - Get employee by ID
POST /employees - Create new employee
PUT /employees/:id - Update employee
DELETE /employees/:id - Delete employee
GET /departments - Get all departments
GET /departments/:id - Get department by ID
POST /departments - Create new department
PUT /departments/:id - Update department
DELETE /departments/:id - Delete department
GET /candidates - Get all candidates
GET /candidates/:id - Get candidate by ID
POST /candidates - Create new candidate
PUT /candidates/:id - Update candidate
POST /candidates/:id/hire - Hire candidate (creates employee)
GET /salaries - Get all salaries
GET /salaries/:id - Get salary by ID
POST /salaries - Create new salary record
PUT /salaries/:id - Update salary record
DELETE /salaries/:id - Delete salary record
The system uses PostgreSQL with the following main tables:
employees - Employee records with personal and employment information
departments - Department information and management
candidates - Job applicant tracking
salaries - Employee compensation records
Prerequisites Node.js 16+
PostgreSQL database
npm or yarn
- Clone the repository
git clone https://github.com/hadush-negasi/hr-management-system-backend.git
cd hr-management-system-backend- Install Dependencies
npm install-
Create Supabase Database
Go to Supabase and create an account
Create a new project
Wait for the database to initialize
Go to Settings → Database → Connection string
Copy the connection URI (should look like postgresql://postgres:[password]@[host]:5432/postgres)
-
Environment Setup
Create .env file:
DATABASE_URL="postgresql://username:password@localhost:5432/hr_database"
NODE_ENV="development"
PORT=3001- Database Setup
npx prisma generate
npx prisma migrate dev
npx prisma db seed- Start Development Server
npm run start:devThe API will be available at http://localhost:3001
Developed by Your Name.
Feel free to connect with me on LinkedIn