# Employee Payroll Management System (EPMS)

**PayMaster Ltd** — Rubavu District, Rwanda  
National Practical Exam 2026

> Rename folder `Davina_LastName_National_Practical_Exam_2026` to your real **FirstName_LastName** before submission.

## Project structure

```
Davina_LastName_National_Practical_Exam_2026/
├── docs/ERD.md              # ERD description + Mermaid (for draw.io)
├── database/epms_schema.sql # MySQL EPMS database
├── backend-project/         # Node.js + Express + MySQL
└── frontend-project/        # React + Vite + Tailwind + axios
```

## Requirements checklist

| Requirement | Implementation |
|-------------|----------------|
| ERD with PK/FK & cardinalities | `docs/ERD.md` + paper sketch |
| MySQL database EPMS | `database/epms_schema.sql` |
| Insert on Employee, Department, Salary | POST APIs + forms |
| CRUD only on Salary | GET/PUT/DELETE `/api/salaries` |
| Menu: Employee, Department, Salary, Reports, Logout | `Layout.jsx` |
| Responsive UI | Tailwind CSS grid/flex |
| User account (username/password) | `User` table + login/register |
| axios integration | `src/api/client.js` |
| Daily / weekly / monthly reports | `/api/reports/:period` |

## Setup

### 1. MySQL

Install MySQL, then run:

```bash
mysql -u root -p < database/epms_schema.sql
```

### 2. Backend

```bash
cd backend-project
copy .env.example .env
# Edit .env with your MySQL password
npm install
npm run seed
npm start
```

Server: `http://localhost:5000`

Default login after seed: **hradmin** / **hradmin123**

### 3. Frontend

```bash
cd frontend-project
npm install
npm run dev
```

App: `http://localhost:5173`

## Exam notes

1. Draw the ERD on **plain paper** first, then recreate in draw.io / Lucidchart using `docs/ERD.md`.
2. **Employee** and **Department** forms: insert only (list view for verification).
3. **Salary** form: full create, read, update, delete.
4. Reports filter records by `createdAt` for the selected day, week, or month.
