← Admin Panel

Stack and structure

admin panel · workzone
Backend
stack — libraries
Reuses the core
FastAPI Pydantic v2 SQLAlchemy · async asyncpg
structure — files · achilles/admin/
admin/              module = a separate package
├── *.py            constants · schemas · exceptions
├── services/       dashboard (aggregates all modules) · settings — a folder from the start
└── routes/         /admin/* endpoints — a folder from the start
Changes in existing files
core/models.py (+ PlatformSettings), config.py (+ platform settings), api/router.py (+ include admin routes).
Frontend
stack — libraries
Core
React TanStack Query react-router-dom ky · HTTP + auth
Tables
@tanstack/react-table
Charts v2
recharts
structure — files · src/features/admin/
features/admin/         module = a separate package
├── *.ts / *.tsx        types · constants · AdminLayout (shell)
├── components/         shared admin UI
└── <section>/          a folder per sidebar section — dashboard · users · security · settings · …
Sub-features — a folder per sidebar section
Each section is its own folder with its own api.ts, types.ts, pages, and local components/. A new section = a new folder, no reorganization.
AdminLayout — shell of all admin routes
Wraps all admin routes; shared UI components live in the root components/. The shell itself (sidebar + header + Outlet) and role-based sidebar visibility are in layout.
Principle — the frontend calls domain routes
The frontend calls the domain modules' routes directly (auth, harvester, etc.). Only admin/dashboard/ aggregates through its own backend service.