A reusable full-stack dashboard framework for ticket workflow management, run tracking, audit logging, and role-based access control.
- Dashboard API: FastAPI + SQLAlchemy + Alembic.
- Dashboard Web: Next.js app router frontend.
- Local infrastructure: PostgreSQL via Docker Compose.
- Developer scripts: bootstrap, seed, and one-command local startup.
apps/dashboard_api/— backend service.apps/dashboard_web/— frontend service.infra/docker-compose.yml— local PostgreSQL.scripts/— development utilities.docs/— install and RBAC notes.
- Tickets are created with metadata like
type,priority, andassigned_agent. - New tickets default to
PENDING_APPROVAL. - Admin users can approve/reject/queue tickets.
PUT /tickets/{id}andPOST /tickets/{id}/updatesupport editing with permission checks.
- Admin can start execution from queued tickets via
POST /runs/next. - Admin can finish runs via
POST /runs/{id}/finishwith statusDONEorFAILED. - Ticket status transitions follow lifecycle constraints (
QUEUED -> RUNNING -> DONE/FAILED).
- Agents are assignable executors for tickets.
- Agent CRUD endpoints are admin-only (
/agents). - Deletion is blocked if an agent is already referenced by tickets.
- Key actions (ticket/agent/run operations) are written to audit logs.
- Audit listing endpoint (
GET /audit-logs) is admin-only.
- Backend authorization is the source of truth.
- API expects
Authorization: Bearer <token>. ADMIN_TOKENmaps to Admin,MEMBER_TOKENmaps to Member.- Frontend role-based UI is for UX only; backend still enforces
401/403.
- Built-in credentials:
admin / adminmember / member
- Frontend stores:
localStorage.dashboard_tokenlocalStorage.dashboard_username
If you change backend token values in .env, ensure frontend NEXT_PUBLIC_* token variables are aligned as well.
./scripts/start_dev.shBy default, this script:
- Runs DB bootstrap (wait + migration + seed).
- Ensures frontend dependencies are installed.
- Starts API on
http://localhost:8000. - Starts Web on
http://localhost:3000.
- Start PostgreSQL:
docker compose -f infra/docker-compose.yml up -d- Prepare Python env:
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env- Bootstrap DB + migrations + seed:
./scripts/dev_bootstrap.sh- Start API:
cd apps/dashboard_api
PYTHONPATH=. uvicorn src.main:app --reload --port 8000- Start Web:
cd apps/dashboard_web
npm install
npm run devFrom .env.example:
DATABASE_URLADMIN_TOKENMEMBER_TOKENNEXT_PUBLIC_API_URLNEXT_PUBLIC_ADMIN_TOKEN
Frontend also supports NEXT_PUBLIC_MEMBER_TOKEN (defaults to member-dev-token when unset).
curl http://localhost:8000/health
curl -H "Authorization: Bearer member-dev-token" http://localhost:8000/tickets
curl -H "Authorization: Bearer admin-dev-token" http://localhost:8000/runs
curl -X POST -H "Authorization: Bearer admin-dev-token" http://localhost:8000/tickets/1/approveRun API tests locally:
PYTHONPATH=apps/dashboard_api pytest -q apps/dashboard_api/testsCI workflow: .github/workflows/ci.yml
api-tests: runs backend tests.web-build: runs frontend build check.
Triggers:
- Pull requests
- Push to
main - Manual dispatch
./scripts/start_dev.sh./scripts/start_dev.sh --detachtail -f /tmp/agentops_api.log
tail -f /tmp/agentops_web.log- 401 Unauthorized: verify token values and frontend/backend token alignment.
- 409 Conflict: check whether status transition is valid.
- DB connection failure: verify PostgreSQL container is running (
docker ps).
- Chinese README:
README.zh-CN.md - Install guide:
docs/INSTALL.md - RBAC details:
docs/RBAC.md