first commit

This commit is contained in:
Alberto-Audrix committed 2026-09-08 15:21:23 +07:00
commit b54624be96
226 files changed
+108840

No files matched your search

+55
View File
@@ -0,0 +1,55 @@
# dashboard-cpsp-executive
Main-office executive dashboard. Same frontend look as site `dashboard-cpsp`, HQ mirror API in `backend/`.
## Architecture
```text
City A/B/C (API+DB) --API key sync--> HQ mirror API+DB --session--> Executive FE (:3002)
```
- **Roles**
- `director` / `director_admin`: view all sites (`director_admin` is **not** Django superuser)
- `buh` / `bu_admin`: view only GMs they manage (`managed_by`) and those GMs' sites
- `gm` / `gm_admin`: register city sites + sync; **only `gm`** approves cycle close
- `account_admin`: IT Central — User Management only; no ops dashboards
- `superuser`: break-glass (`bootstrap_admin` / seed `admin`) — director-level ops + Manajemen Akun; hidden from user lists
- `inactive`: locked out
- No `is_staff`
- **City registry:** `/api/v1/city-sites/` (GM / GM Admin)
- **Approve close:** `POST /api/v1/cycles/{id}/approve-close/` (GM only)
## Ports
| App | UI | API |
|-----|----|-----|
| Site `dashboard-cpsp` | `:3001` | `:8000` |
| HQ `dashboard-cpsp-executive` | `:3002` | `:8001` |
## Setup
**Backend**
```bash
cd backend
python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txt
cp .env.example .env
python manage.py migrate
python manage.py seed_demo
npm run dev
```
**Frontend**
```bash
cd ..
cp .env.example .env
npm install
npm run dev
```
Open [http://localhost:3002](http://localhost:3002).
Seed accounts: `admin`/`admin123` (`superuser` break-glass: ops + Manajemen Akun), `director`/`director123`, `director_admin`/`directoradmin123`, `buh`/`buh123`, `bu_admin`/`buadmin123`, `gm`/`gm123`, `gm_admin`/`gmadmin123`, `account_admin`/`accountadmin123` (IT user management only).