Getting Started & Operations Guide
How to run the platform locally, sign in, create users for each portal, and understand what is live today versus planned.
Default sign-in (development)
Only one user exists after seed
| Password | Role | Portal | Landing route | |
|---|---|---|---|---|
| admin@jazz.com.pk | Admin@12345 | Super Admin | Platform Administration | /admin |
In production, the seed password comes from the SEED_ADMIN_PASSWORD environment variable instead of the dev default.
Run locally
- 1
Start PostgreSQL
Ensure PostgreSQL is running and the jazz_dgf database exists (Docker or local install).
# Example with Docker docker compose up -d postgres
- 2
Configure & start the API
Backend lives in d:\Jazz\backend (NestJS). Copy .env and run migrations + seed.
- API base URL: http://localhost:3001/api/v1
- Swagger docs: http://localhost:3001/api/docs
- Set CORS_ORIGIN=http://localhost:3000 in backend .env
cd backend npm install npx prisma migrate deploy npx prisma db seed npm run start:dev
- 3
Configure & start the frontend
Next.js app in d:\Jazz\frontend. Point it at the API.
- Frontend URL: http://localhost:3000
- NEXT_PUBLIC_API_URL=http://localhost:3001/api/v1
cd frontend cp .env.local.example .env.local npm install npm run dev
- 4
Sign in as Super Admin
Open the login page and use the seeded admin credentials below. You will land on the Admin portal.
Open login
Portal access rules
- Each user has exactly one sign-in portal: Field Sales, Sales Management, Leadership Insights, or Platform Administration.
- Portal is set automatically from the user's role — you pick the role when creating a user, not the portal separately.
- After login, users are redirected to their assigned portal only.
- Cross-portal URLs are blocked — e.g. an admin cannot open /edo even with a direct link.
- Permissions still control which screens and actions appear inside a portal.
Seeded roles vs user accounts
Roles and permissions are seeded automatically. User accounts for each role are not — you must create them.
| Role | Portal | Hierarchy | Pre-created user? |
|---|---|---|---|
| Super Admin | Platform Administration | 1 (highest) | Yes — admin@jazz.com.pk |
| Sales Operations Admin | Platform Administration | 2 | No — create via Admin |
| Executive | Leadership Insights | 3 | No — create via Admin |
| Regional Manager | Sales Management | 4 | No — create via Admin |
| Line Manager | Sales Management | 5 | No — create via Admin |
| EDO | Field Sales | 6 | No — create via Admin |
Regional manager vs line manager (production)
Line manager and regional manager are two different ways to scope Sales Management data. They can coexist or work independently.
Regional manager, no line manager, many EDOs
Common in production when EDOs report at region level only. Create EDO users with a region (required) and leave line manager empty. Assign the Regional Manager to that region in Admin → Organization. They will see all EDOs in the region on team dashboards, visit matrix, DBP approvals, etc. — scoped by regionId, not reporting line.
Line manager with direct-report EDOs
Create EDO users and optionally pick a Line Manager on the user form. That manager sees only EDOs linked via reporting line (team scope). Regional managers still see the same EDOs if they belong to the manager's assigned region.
Both hierarchies together
An EDO can have a line manager for day-to-day coaching while a regional manager oversees the whole region. Line Manager scope = direct reports. Regional Manager scope = all EDOs in assigned region(s), whether or not they have a line manager.
How to add a new user
Follow this flow to onboard EDOs, managers, executives, or additional admins.
- 1
Sign in as Super Admin
Only users with users.create permission (Super Admin or scoped managers) can add accounts.
Admin → Users - 2
- 3
Fill required fields
Provide identity and role — portal is derived automatically from the role.
- Role — pick first (EDO, Line Manager, Regional Manager, etc.); this sets permissions and sign-in portal
- Full name — display name across the platform
- Email — used for login (required for invite flow)
- Region — required for EDO; recommended for managers. Used for regional dashboards
- Line manager — optional for EDO. Leave empty when EDOs report only at region level
- Sales ID — optional EDO identifier (edoProfile)
- Regional Manager — after create, assign region(s) in Admin → Organization
- 4
Save and send invite email
On success, Resend emails the invite link to the user's address (when RESEND_API_KEY is configured). The invite token is also returned once in the API response as a backup.
- User status becomes PENDING_INVITE until password is set
- Invite links expire after 7 days
- Without Resend configured, copy the link from Admin → Users → New User success screen
- 5
User opens email and sets password
The email contains a button linking to /login/setup?token=…. After setting a password, the user signs in at /login.
Invite setup page
Recommended test accounts
Create these manually to exercise each portal end-to-end.
| Purpose | Role to assign | Primary portal | Example email |
|---|---|---|---|
| Field testing (DVR, DBP, pipeline) | EDO | Field Sales | edo.test@jazz.com.pk |
| Team approvals & visit matrix | Line Manager | Sales Management | manager.test@jazz.com.pk |
| Regional dashboards | Regional Manager | Sales Management | regional.test@jazz.com.pk |
| National KPIs & exports | Executive | Leadership Insights | executive.test@jazz.com.pk |
What is live vs planned
| Area | Status | Notes |
|---|---|---|
| Authentication (email/password, JWT, refresh) | Live | Login, logout, accept-invite |
| Four portals wired to API | Live | 49 routes, React Query |
| Portal isolation | Live | One portal per user primaryPortal |
| Users & roles (Admin) | Live | Create, list, deactivate |
| DVR / DBP / Pipeline / Recovery | Live | Field & manager flows |
| Reports CSV export | Live | Manager & Executive |
| CSV data import upload | Phase 7 | POST /imports/:type returns 501 |
| Live notifications | Phase 9 | UI stub only |
| Forgot password / OTP login | Planned | UI screens exist, no API |
| SSO / Active Directory | Future | SRS M-01 |
| SFA / CRRU / CRM feeds | Future | Seed & manual data today |
Environment variables
| Variable | Where | Purpose |
|---|---|---|
| DATABASE_URL | Backend (.env) | PostgreSQL connection string |
| JWT_ACCESS_SECRET | Backend | Access token signing (min 32 chars) |
| JWT_REFRESH_SECRET | Backend | Refresh token validation |
| CORS_ORIGIN | Backend | Must match frontend origin (http://localhost:3000) |
| PORT | Backend | API port (default 3001) |
| SEED_ADMIN_PASSWORD | Backend | Production seed password (required in prod) |
| NEXT_PUBLIC_API_URL | Frontend (.env.local) | API base URL for browser calls |
| FRONTEND_URL | Backend (.env) | Base URL embedded in invite email links |
| RESEND_API_KEY | Backend (.env) | Resend API key for invite emails |
| MAIL_FROM | Backend (.env) | Sender address (must be verified in Resend) |
Frequently asked questions
Need Swagger or raw API access?
Platform Overview
Single Next.js application with role-based portals, dynamic RBAC, and shared Jazz design system.
The Jazz SME Digital Growth Force (Jazz SME DGF) is a unified sales performance platform for Jazz's Small & Medium Enterprise (SME) segment under the Digital Growth Force (DGF) program. One codebase serves four portals — each user is assigned a single primary portal at login (Admin, Manager, Executive, or EDO).
Seven KPI Pillars
Core performance domains tracked across all portals — scoped by user role and region.
Four Portals — Detailed Breakdown
Each portal serves a distinct user type with scoped data, navigation, and responsibilities.
Eighteen Modules (M-01 to M-18)
Functional modules mapped to portals — grouped by domain.
Identity
Organization
Performance
Pipeline
Field Ops
Recovery
Analytics
Master Data
System
Abbreviations & Short Forms
All acronyms used in the SRS, UI labels, and dashboards — with full expanded forms.
UI Domain Labels
User Types & RBAC
Dynamic role hierarchy — Level 1 (Super Admin) to Level 6 (EDO), plus custom roles at Level 7+.
Platform Workflows
End-to-end journeys for EDO, Manager, Executive, Admin, and data import.
Data Integrations
External systems feeding the platform — Phase 2 live APIs, Phase 1 CSV fallback.
Screen Inventory
All UI screens with IDs, module mapping, portal assignment, and prototype status.
57 System Entities
Database entity domains from SRS Section 13 — full schema design is the next phase.
Total: 57 entities across 12 domains · Identity (8) · Organization (5) · Master Data (14) · Customer (2) · Sales (10) · Field Ops (4) · Pipeline (3) · Recovery (2) · Portfolio (2) · Integration (4) · Notifications (3) · System (4)
