The backend of the Leave Management System is responsible for handling the business logic, data storage, and API endpoints for managing employee leave requests within an organization.
- Authentication: Secure endpoints with JWT authentication.
- Employee Management: CRUD operations for managing employee profiles.
- Logging: Logs API requests and responses for monitoring and debugging.
- Clone the repository:
git clone https://github.com/sudiprajkunwar/Leave-Management-System.git
- Install dependencies:
yarn install
- Set up environment variables: Create a
.env
file and configure database connection details, JWT secret key, etc. - Run the application:
yarn start
- Start the server:
yarn start
- Use Postman or any API testing tool to send requests to the API endpoints.
- Refer to the API documentation for details on available endpoints and request formats.
The backend provides the following API endpoints:
POST /api/auth/login
: User login endpoint to authenticate and generate JWT tokens.POST /api/auth/refresh-token
: Refresh expired access tokens using refresh tokens.POST /api/employees
: Create a new employee profile.GET /api/employees
: Get a list of all employees.GET /api/employees/:id
: Get details of a specific employee.PUT /api/employees/:id
: Update an existing employee profile.DELETE /api/employees/:id
: Delete an employee profile.
Note: Replace :id
with the actual employee ID in the URL.
The backend uses a PostgreSQL database with the following schema:
- employees: Stores employee details.
- roles: Defines user roles (admin, manager, employee).
- permissions: Defines permissions for different roles.
Note: Refer to the database schema for detailed table structures and relationships.
- Node.js
- Express.js
- Sequelize (ORM)
- PostgreSQL (Database)
- JWT (JSON Web Tokens) for authentication
- Winston Logger for logging requests and responses