A comprehensive multi-tenant Project Management and HRMS solution built with Next.js, Node.js, and MongoDB.
- Runtime: Node.js + Express
- Database: MongoDB (Mongoose)
- Real-time: Socket.io
- Security: JWT, Helmet, CORS, Rate Limiting
- Framework: Next.js (App Router)
- Styling: Tailwind CSS
- API Client: Axios/Fetch with unified
lib/api.ts
Every collection in the database contains an organizationId.
Data isolation is enforced via the organizationIsolation middleware which attaches a req.orgFilter to every request.
Rule: All database queries must include ...req.orgFilter to prevent cross-tenant data leaks.
const tasks = await Task.find({ ...req.orgFilter, status: 'active' });The system supports four primary roles:
- admin: Access to everything within the organization.
- hr: Access to employee records, attendance, and leave management.
- project_manager: Access to projects they own or are members of.
- employee: Access to their own tasks, attendance, and profile.
Note: Roles are normalized to lowercase in the authenticate middleware. Use req.user.role for logic checks.
- Node.js (v18+)
- MongoDB Atlas or local instance
cd backendnpm install- Create
.envfrom.env.example npm run dev
cd frontendnpm installnpm run dev
If data is not appearing in the dashboard:
- Check the Network Tab in your browser.
- Verify the API response structure matches
{ success: true, data: { ... } }. - Check
backend/logsfor any JWT or Organization Context errors. - Refer to
PROJECT_ROADMAP.mdfor current implementation status and fixes.