How baptchau/kronos works
Kronos is a multi-tenant time-tracking product: employees and company admins sign in, record work time, and review weekly entries and summaries; admins also manage employees and correct entries. Platform owners use a separate console to provision companies and manage cross-company accounts. The API routes requests into authentication, clock, timesheet, admin, and owner services backed by PostgreSQL. The README documents the product capabilities and frontends; edges between components are limited to relationships shown in excerpts or stated there.
Main entry points: admin.py Admin routes · main.py FastAPI application · app Employee app · auth_service.py Auth service
Components 29
User applications
- Employee app
frontend/app - Clock controls
frontend/components/ClockButton.tsx - Timesheet views
frontend/components/TimesheetTable.tsx - Company admin views
frontend/app/admin - Owner console
frontend-owner/app - Employee API client
frontend/lib/api.ts - Owner API client
frontend-owner/lib/api.ts
API and access
- FastAPI application
backend/app/main.py - Authentication routes
backend/app/routers/auth.py - Authentication and roles
backend/app/dependencies.py - Auth service
backend/app/services/auth_service.py - Auth contracts
backend/app/schemas/auth.py
Time tracking
- Clock routes
backend/app/routers/clock.py - Clock service
backend/app/services/clock_service.py - Timesheet routes
backend/app/routers/timesheet.py - Timesheet service
backend/app/services/timesheet_service.py - Time entry contracts
backend/app/schemas/time_entry.py
Company administration
- Admin routes
backend/app/routers/admin.py - Owner routes
backend/app/routers/owner.py - Owner service
backend/app/services/owner_service.py - User contracts
backend/app/schemas/user.py
Domain data
- Company model
backend/app/models/company.py - User model
backend/app/models/user.py - Time entry model
backend/app/models/time_entry.py - Database sessions
backend/app/database.py
Other components
- Employee
- Company admin
- Platform owner
- PostgreSQL
Connections 40
- Employee → Employee app: uses
- Company admin → Employee app: uses
- Platform owner → Owner console: uses
- Employee app → Clock controls: presents
- Employee app → Timesheet views: presents
- Company admin → Company admin views: manages users
- Company admin views → Timesheet views: reviews entries
- Employee app → Employee API client: requests
- Employee API client → FastAPI application: calls API
- Owner console → Owner API client: requests
- Owner API client → FastAPI application: calls API
- FastAPI application → Authentication routes: registers
backend/app/main.py - FastAPI application → Clock routes: registers
backend/app/main.py - FastAPI application → Timesheet routes: registers
backend/app/main.py - FastAPI application → Admin routes: registers
backend/app/main.py - FastAPI application → Owner routes: registers
backend/app/main.py - Authentication routes → Auth service: calls
backend/app/routers/auth.py - Authentication routes → Auth contracts: validates
backend/app/routers/auth.py - Authentication routes → Authentication and roles: uses
backend/app/routers/auth.py - Clock routes → Clock service: calls
backend/app/routers/clock.py - Clock routes → Authentication and roles: requires user
backend/app/routers/clock.py - Timesheet routes → Timesheet service: calls
backend/app/routers/timesheet.py - Timesheet routes → Authentication and roles: requires user
backend/app/routers/timesheet.py - Timesheet routes → Time entry contracts: returns
backend/app/routers/timesheet.py - Admin routes → Clock service: checks status
backend/app/routers/admin.py - Admin routes → Timesheet service: calls
backend/app/routers/admin.py - Admin routes → Auth service: checks users
backend/app/routers/admin.py - Admin routes → Authentication and roles: requires admin
backend/app/routers/admin.py - Admin routes → User contracts: returns
backend/app/routers/admin.py - Admin routes → Time entry contracts: returns
backend/app/routers/admin.py - Owner routes → Owner service: calls
backend/app/routers/owner.py - Owner routes → Authentication and roles: requires owner
backend/app/routers/owner.py - Owner service → Auth service: uses auth helpers
backend/app/services/owner_service.py - Auth service → Company model: creates and queries
backend/app/services/auth_service.py - Auth service → User model: authenticates
backend/app/services/auth_service.py - Clock service → Time entry model: operates on
backend/app/services/clock_service.py - Timesheet service → Time entry model: queries and updates
backend/app/services/timesheet_service.py - Owner service → Company model: creates and lists
backend/app/services/owner_service.py - Owner service → User model: creates and lists
backend/app/services/owner_service.py - Database sessions → PostgreSQL: persists data