Skip to content

hadush-negasi/hr-management-system-backend

Repository files navigation

HR Management System - Backend

NodeJs NestJs Postgres Prisma Render

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.

🚀 Live Deployment

Backend Applicatin: Deployed on Render

Frontend Application: Deployed on Netlify, check it out here Demo Link

🛠️ Tech Stack

Framework: NestJS 8

Database: PostgreSQL with Supabase

ORM: Prisma

Deployment: Render

Package Manager: npm

📊 API Endpoints

Employees

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

Departments

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

Candidates

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)

Salaries

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

🗄️ Database Schema

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

🚀 Getting Started

Prerequisites Node.js 16+

PostgreSQL database

npm or yarn

Installation

  1. Clone the repository
git clone https://github.com/hadush-negasi/hr-management-system-backend.git
cd hr-management-system-backend
  1. Install Dependencies
npm install
  1. 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)

  2. Environment Setup

    Create .env file:

DATABASE_URL="postgresql://username:password@localhost:5432/hr_database"
NODE_ENV="development"
PORT=3001
  1. Database Setup
npx prisma generate
npx prisma migrate dev
npx prisma db seed
  1. Start Development Server
npm run start:dev

The API will be available at http://localhost:3001

📊 Status

Build Status Uptime API Status

🙌 Author

Developed by Your Name.
Feel free to connect with me on LinkedIn

About

NestJS backend for HR Management System with PostgreSQL, Prisma, and RESTful API for employee, department, candidate, and salary management.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors