How sanjaymehar/fastapitask works
This is a FastAPI employee-management API. Users authenticate for JWTs, then role-guarded routes expose user, employee, and salary operations; salary submission records inputs and schedules a monthly-salary update. The graph includes the API wiring, controllers, authentication, ORM models, and PostgreSQL session layer. Other documented capabilities such as migrations are omitted from this runtime map. Relationships are based on the README or shown imports and calls; unsampled migration behavior is not inferred.
Main entry points: database.py Database sessions · auth.py JWT and RBAC · user_router.py User routes · salary_router.py Salary routes
Components 17
API surface
- Application entry
app/main.py - Route registration
app/api/api_v1/api.py - User routes
app/api/api_v1/endpoints/user_router.py - Employee routes
app/api/api_v1/endpoints/employee_router.py - Salary routes
app/api/api_v1/endpoints/salary_router.py
Domain operations
- User operations
app/controllers/user_controller.py - Employee operations
app/controllers/employee_controller.py - Salary operations
app/controllers/salary_controller.py
Identity and access
- JWT and RBAC
app/utils/auth.py
Persistence and configuration
- Settings
app/config.py - Database sessions
app/database.py - User model
app/models/user_table.py - Employee model
app/models/employee_table.py - Salary model
app/models/salary_table.py
Other components
- API client
- PostgreSQL
- FastAPI background tasks
Connections 34
- API client → Application entry: sends requests
README.md - Application entry → Route registration: initializes routes
app/main.py - Route registration → User routes: registers routes
app/api/api_v1/api.py - Route registration → Employee routes: registers routes
app/api/api_v1/api.py - Route registration → Salary routes: registers routes
app/api/api_v1/api.py - User routes → User operations: calls operations
app/api/api_v1/endpoints/user_router.py - Employee routes → Employee operations: calls operations
app/api/api_v1/endpoints/employee_router.py - Salary routes → Salary operations: calls operations
app/api/api_v1/endpoints/salary_router.py - Salary routes → FastAPI background tasks: schedules calculation
app/api/api_v1/endpoints/salary_router.py - FastAPI background tasks → Salary operations: runs calculation
- Salary operations → Employee operations: looks up employee
app/controllers/salary_controller.py - User routes → JWT and RBAC: authenticates login
app/api/api_v1/endpoints/user_router.py - User routes → JWT and RBAC: requires admin
app/api/api_v1/endpoints/user_router.py - Employee routes → JWT and RBAC: checks access
app/api/api_v1/endpoints/employee_router.py - Salary routes → JWT and RBAC: requires admin
app/api/api_v1/endpoints/salary_router.py - User operations → JWT and RBAC: hashes passwords
app/controllers/user_controller.py - User operations → User model: queries and writes
app/controllers/user_controller.py - Employee operations → Employee model: queries and writes
app/controllers/employee_controller.py - Employee operations → User model: checks user role
app/controllers/employee_controller.py - Salary operations → Salary model: queries and writes
app/controllers/salary_controller.py - JWT and RBAC → User model: loads user
app/utils/auth.py - JWT and RBAC → Settings: reads JWT settings
app/utils/auth.py - JWT and RBAC → Database sessions: gets database session
app/utils/auth.py - User routes → Database sessions: gets database session
app/api/api_v1/endpoints/user_router.py - Employee routes → Database sessions: gets database session
app/api/api_v1/endpoints/employee_router.py - Salary routes → Database sessions: gets database session
app/api/api_v1/endpoints/salary_router.py - User operations → Database sessions: uses session
app/controllers/user_controller.py - Employee operations → Database sessions: uses session
app/controllers/employee_controller.py - Salary operations → Database sessions: uses session
app/controllers/salary_controller.py - Database sessions → Settings: loads connection settings
app/database.py - Database sessions → PostgreSQL: connects to
README.md - User model → Database sessions: uses ORM base
app/models/user_table.py - Employee model → Database sessions: uses ORM base
app/models/employee_table.py - Salary model → Database sessions: uses ORM base
app/models/salary_table.py