How sp4chi/agencydesk works
AgencyDesk is a multi-agency project-management app with separate staff and client experiences. Users log in, choose an agency, and work within that membership; staff manage projects and tasks, while clients see shared work and can review files. The backend uses a tenant-scoped request context and database-enforced access rules, with routers, services, and repositories separating HTTP, business logic, and queries. README capabilities support the broad domain branches; sampled source and the SOURCE INDEX establish only the specific wiring shown below, so unverified subsystem links are omitted.
Main entry points: main.py FastAPI application · client.ts API client · App.tsx Route application · SessionProvider.tsx Session state
Components 24
Identity and access
- Session state
frontend/src/auth/SessionProvider.tsx - Authentication routes
backend/app/routers/auth.py - Login and invite rules
backend/app/auth/service.py - Identity queries
backend/app/auth/repository.py
Web experiences
- Route application
frontend/src/App.tsx - Login and agency selection
frontend/src/shared/LoginPage.tsx - Invite acceptance
frontend/src/shared/AcceptInvitePage.tsx - Staff workspace
frontend/src/staff - Client portal
frontend/src/portal - Portal task panel
frontend/src/portal/PortalTaskPanel.tsx - API client
frontend/src/api/client.ts
API and domain
- FastAPI application
backend/app/main.py - Project and client routes
backend/app/routers - Task routes
backend/app/routers/tasks.py - Task rules
backend/app/services/tasks.py - Comments and files
backend/app/services - Time and team
backend/app/routers - Dashboard and invites
backend/app/routers
Tenant data and storage
- Tenant request context
backend/app/db.py - Task queries
backend/app/repositories/tasks.py - Uploaded file storage
backend/app/services/storage.py - PostgreSQL with RLS
Other components
- Agency staff
- Agency client
Connections 30
- Agency staff → Login and agency selection: signs in
- Agency client → Login and agency selection: signs in
- Route application → Session state: provides session
frontend/src/App.tsx - Route application → Staff workspace: routes staff
frontend/src/App.tsx - Route application → Client portal: routes portal
frontend/src/App.tsx - Route application → Invite acceptance: routes invite
frontend/src/App.tsx - Login and agency selection → Session state: starts login
frontend/src/shared/LoginPage.tsx - Session state → API client: binds token
frontend/src/auth/SessionProvider.tsx - Session state → Authentication routes: requests session
- Invite acceptance → API client: calls API
frontend/src/shared/AcceptInvitePage.tsx - Staff workspace → API client: calls API
frontend/src/staff/ProjectsPage.tsx - Client portal → API client: calls API
frontend/src/portal/PortalProjectPage.tsx - Portal task panel → API client: loads task data
frontend/src/portal/PortalTaskPanel.tsx - API client → FastAPI application: sends requests
- FastAPI application → Authentication routes: registers routes
backend/app/main.py - FastAPI application → Project and client routes: registers routes
backend/app/main.py - FastAPI application → Task routes: registers routes
backend/app/main.py - FastAPI application → Time and team: registers routes
backend/app/main.py - FastAPI application → Dashboard and invites: registers routes
backend/app/main.py - FastAPI application → Comments and files: configures storage
backend/app/main.py - Authentication routes → Login and invite rules: invokes rules
backend/app/routers/auth.py - Login and invite rules → Identity queries: queries memberships
backend/app/auth/service.py - Task routes → Task rules: calls service
backend/app/routers/tasks.py - Task rules → Task queries: queries tasks
backend/app/services/tasks.py - Task routes → Tenant request context: receives scoped DB
backend/app/routers/tasks.py - Tenant request context → PostgreSQL with RLS: sets RLS context
backend/app/db.py - Task queries → PostgreSQL with RLS: reads and writes
backend/app/repositories/tasks.py - Uploaded file storage → PostgreSQL with RLS: stores metadata separately
- Agency client → Client portal: views shared work
- Agency staff → Staff workspace: manages work