From 32666386fb98aca36f351cf8bf69adc6a3f0c548 Mon Sep 17 00:00:00 2001 From: sanjeev Date: Fri, 14 Aug 2026 07:07:23 +0000 Subject: [PATCH] Add README.md --- README.md | 112 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..b63eae3 --- /dev/null +++ b/README.md @@ -0,0 +1,112 @@ +# PeopleDesk + +PeopleDesk is a full-stack Employee Management System built with React, Express, MongoDB Atlas, JWT auth, and role-based access (Admin / HR / Employee). + +For step-by-step help with diagrams (new users, testers, developers), see [USER_GUIDE.md](USER_GUIDE.md) or open **User Guide** in the app menu. + +## Features + +- Authentication with JWT + bcrypt +- Role-based access control +- Employee and department management +- Attendance check-in/out with duplicate prevention and monthly reports +- Leave apply / cancel / approve / reject with balances +- Payroll generation and downloadable PDF payslips +- Performance reviews +- Dashboard analytics and in-app notifications + +## Project structure + +``` +people-desk/ +├── people-desk-fe/ # Vite + React frontend +├── people-desk-be/ # Express + MongoDB API +├── .env # secrets (gitignored) +└── README.md +``` + +## Setup + +### 1. Environment + +Copy Atlas credentials into root `.env` (already prepared if you used `atlas-credentials.env`): + +``` +PORT=5000 +JWT_SECRET=your_secret +MONGODB_URI=mongodb+srv://USER:PASS@cluster0.xxx.mongodb.net/ems?retryWrites=true&w=majority +CLIENT_URL=http://localhost:5173 +``` + +### 2. Install dependencies + +```bash +cd people-desk-be +npm install + +cd ../people-desk-fe +npm install +``` + +### 3. Seed demo data + +```bash +cd people-desk-be +npm run seed +``` + +Demo accounts: + +| Role | Email | Password | +|----------|-----------------|---------------| +| Admin | admin@ems.com | Admin@123 | +| HR | hr@ems.com | Hr@12345 | +| Employee | john@ems.com | Employee@123 | + +### 4. Run + +Terminal 1 — API: + +```bash +cd people-desk-be +npm run dev +``` + +Terminal 2 — UI: + +```bash +cd people-desk-fe +npm run dev +``` + +Open http://localhost:5173 + +The Vite dev server proxies `/api` to http://localhost:5000. + +## Main API routes + +- `POST /api/auth/register` +- `POST /api/auth/login` +- `GET /api/auth/me` +- `CRUD /api/employees` +- `CRUD /api/departments` +- `POST /api/attendance/check-in|check-out` +- `GET /api/attendance` · `GET /api/attendance/report/monthly` +- `POST /api/leaves` · `PUT /api/leaves/:id/cancel` · `PUT /api/leaves/:id/review` +- `POST /api/payroll/generate` · `GET /api/payroll/:id/payslip` +- `CRUD /api/performance` +- `GET /api/dashboard/stats` +- `GET /api/notifications` + +## Roles + +- **Admin** — full access including departments +- **HR** — employees, leave approvals, payroll, performance +- **Employee** — self attendance, leave, payroll view, profile + +## Notes + +- Never commit `.env` or `atlas-credentials.env` +- Payroll net salary = basic + allowances + bonuses − deductions − tax +- One attendance record per employee per day +- On some Windows networks, MongoDB SRV DNS can fail; the backend forces Google/Cloudflare DNS resolvers before connecting