Stratify is a full-stack AI-assisted goal tracking platform for enterprise performance cycles. It supports employees, managers, and admins across the complete goal lifecycle: create goals, submit for approval, manager review, cycle locking, quarterly updates, scoring, reporting, and audit tracking.
backend/: Express API, Prisma schema, seed data, scoring logic, role-based workflow rulesfrontend/: frontend workspacefrontend/startify/: active Next.js application
- Frontend: Next.js (App Router), React, TypeScript, NextAuth
- Backend: Express, Node.js, Zod validation, JWT session auth
- Database: PostgreSQL with Prisma ORM
- Role-based access for
EMPLOYEE,MANAGER,ADMIN - Goal lifecycle with status transitions:
DRAFTSUBMITTEDRETURNEDAPPROVEDLOCKED
- Structured goal measurement via UoM types:
MINMAXTIMELINEZERO
- Quarterly employee check-ins with computed achievement scoring
- Manager check-in comments on approved/locked goals
- Admin cycle controls (active quarter/year), unlock flow, and audit logs
- Credentials login + Google OAuth (with frontend-to-backend user sync)
- User signs in on Next.js (
frontend/startify) using NextAuth. - For Google login, frontend calls backend sync endpoint to upsert user and obtain backend JWT context.
- Frontend server routes (
app/api/*) proxy workflow actions to Express backend. - Backend enforces role and lifecycle rules, persists data with Prisma, and returns normalized goal/report payloads.
Main entities:
User: role, reporting hierarchy (managerId), auth provider identityGoal: ownership, approver manager, target definition, weightage, statusQuarterlyUpdate: periodic actuals, status, computed scoreApproval: manager approval/return events with remarksCheckin: manager comments per goal per cycleAuditLog: locked-goal edit trackingAppConfig: active quarter/year settings
Health/auth:
GET /healthPOST /api/auth/loginPOST /api/auth/googleGET /api/auth/me
Reference data:
GET /api/users/managersGET /api/public/managers
Goal workflow:
GET /api/goalsPOST /api/goalsPUT /api/goals/:idPOST /api/goals/:id/submitPOST /api/goals/:id/checkinPOST /api/goals/:id/approvePOST /api/goals/:id/returnPOST /api/goals/:id/manager-checkinGET /api/goals/:id/checkins
Admin/reporting:
POST /api/admin/unlock-goalGET /api/reports/achievementGET /api/admin/completion-dashboardGET /api/admin/cyclePOST /api/admin/cycleGET /api/admin/audit
- Auth required for protected routes
- Role enforcement for manager/admin-only actions
- Employee submission constraints:
- maximum 8 goals
- minimum 10% per-goal weightage
- total weightage must be exactly 100%
- Employee edits allowed only in
DRAFT/RETURNEDstates - Check-in period must match active cycle (
ACTIVE_QUARTER,ACTIVE_YEAR) - Admin unlock and locked-goal modifications are audit logged
Prerequisites:
- Node.js 20+
- npm 10+
- PostgreSQL database
Create env files:
cp backend/.env.example backend/.env
cp frontend/startify/.env.example frontend/startify/.env.localInstall dependencies:
cd backend && npm install
cd ../frontend/startify && npm installInitialize database (from backend/):
npm run prisma:generate
npm run db:push
npm run seedRun development servers:
Terminal 1:
cd backend
npm run devTerminal 2:
cd frontend/startify
npm run devDefaults:
- Frontend:
http://localhost:3000 - Backend:
http://localhost:4000
Backend (backend/.env):
DATABASE_URLJWT_SECRETNEXTAUTH_SECRETAUTH_SYNC_SECRETPORTACTIVE_QUARTERACTIVE_YEARCORS_ORIGIN
Frontend (frontend/startify/.env.local):
NEXTAUTH_URLNEXTAUTH_SECRETGOOGLE_CLIENT_IDGOOGLE_CLIENT_SECRETBACKEND_URLBACKEND_SYNC_SECRET
Important:
NEXTAUTH_SECRETshould match across frontend/backend.AUTH_SYNC_SECRET(backend) must matchBACKEND_SYNC_SECRET(frontend).
admin@demo.com / admin123manager@demo.com / manager123manager2@demo.com / manager234employee@demo.com / employee123
Frontend build:
cd frontend/startify
npm run build
npm run startBackend start:
cd backend
npm run startDeployment pattern:
- Host frontend and backend as separate services.
- Point frontend
BACKEND_URLto backend public URL. - Set backend
CORS_ORIGINto frontend public URL.
- Keep secrets in env files only; do not commit credentials.
- If you change Prisma schema, run
npm run prisma:generateandnpm run db:pushagain inbackend/.