Skip to content
ItsAbir005Public

Latest commit

 

History

99 Commits

Folders and files

Repository files navigation

Nexora

Your Work. Your Flow. Your Momentum.

Nexora is a multi-tenant HR and task management platform. Each company (tenant) gets its own workspace where admins, HR staff, managers, and employees handle onboarding, departments, projects, tasks, and leave in one place, with real-time notifications.

Live demo: task-management-rouge-rho.vercel.app

The backend may be hosted on a free tier, so the first request after a period of inactivity can be slow.


Features

  • Four roles with separate dashboards and permissions: Admin, HR, Manager, Employee.
  • Onboarding: invite HR managers and employees by email, add employees one by one or in bulk, and let invited users set their own password.
  • Organization: departments, projects, and employee profiles with profile pictures (Cloudinary).
  • Tasks: assign tasks with priority and due dates, track status, and discuss them in task comments.
  • Leave management: employees request leave, and managers and HR approve it. Approval runs inside a transaction and has a concurrency test.
  • Real-time updates: notifications are pushed over Socket.IO with authenticated socket rooms.
  • Automation rules: each tenant can configure rules (trigger, condition, action) that fire notifications, evaluated by a workflow engine and scheduled jobs (node-cron) with idempotency tracking.
  • Audit log of important actions, stored per tenant.
  • Subscriptions: Stripe checkout and webhook handling.
  • Dashboards: charts for departments, leave, and project progress (Recharts).

Tech stack

Layer Technology
Frontend React 19, Vite, TypeScript, Tailwind CSS 4, React Router, Framer Motion, Recharts
Backend Node.js 20, Express 5, TypeScript, Socket.IO
Database PostgreSQL 15, Prisma ORM (Neon adapter supported)
Validation and security Zod, JWT, Helmet, express-rate-limit, bcrypt
Integrations Stripe, Cloudinary, Resend / Nodemailer
Testing and CI node:test via tsx, GitHub Actions, k6 load test
Deployment Vercel (frontend), Docker (backend)

Architecture notes

  • Tenant isolation: every tenant table carries a tenantId. Row-level security policies live in backend/prisma/rls/, and requests run inside a transaction that sets app.tenant_id with set_config(..., true) (see backend/src/utils/tenantContext.ts). The transaction-local flag stops a pooled connection from leaking one tenant's context into another request.
  • Two database roles: DATABASE_URL is the normal application connection. SYSTEM_DATABASE_URL is a separate, narrowly granted connection for operations that must cross tenants, such as login lookup and the scheduler's tenant list. RLS enforcement is controlled by RLS_ENFORCED and should be turned on only after the policies and roles are deployed. Details are in backend/prisma/RLS_ROLLOUT.md.
  • Workflows: backend/src/workflows/engine.ts evaluates automation rules, and cron.ts finds overdue tasks, long leaves, and delayed projects on a schedule. Records are claimed atomically inside the tenant transaction and events are emitted only after commit.

Project structure

backend/
  prisma/            schema, migrations, RLS policies and rollout notes
  src/Controllers/   request handlers per role
  src/Services/      leave approval, employees, projects, email, Stripe
  src/middlewares/   auth, request validation, socket auth, errors
  src/workflows/     automation engine and scheduled jobs
  tests/             backend tests
frontend/
  src/pages/         pages per role (Admin, HR, Manager, Employee, Auth)
  src/components/    dashboards, forms, shared UI
k6/                  load test and instructions
.github/workflows/   CI (backend tests and build, frontend build)

Getting started

Prerequisites: Node.js 20, Docker, and npm.

  1. Start PostgreSQL from the repository root:

    docker compose up -d db
  2. Backend:

    cd backend
    cp .env.example .env

    Set at least these values in .env:

    DATABASE_URL=postgresql://postgres:password@localhost:5432/hrm_db
    JWT_SECRET=<a long random string>
    FRONTEND_URL=http://localhost:5173
    

    Stripe, Cloudinary, and email keys are only needed for the features that use them. Then run:

    npm install
    npx prisma migrate deploy
    npm run dev

    The API listens on http://localhost:3000 by default.

  3. Frontend:

    cd frontend
    cp .env.example .env     # set VITE_API_URL=http://localhost:3000
    npm install
    npm run dev

Tests and load testing

cd backend
npm test

The suite covers authorization, request validation, pagination, tenant context, the system database client, and leave-approval concurrency. GitHub Actions runs the backend tests and build, and the frontend build, on every push and pull request to main.

For load testing, see k6/README.md.

License

Add a license file before accepting outside contributions.

Releases

Packages

Contributors

Languages