How mseyyiddev/ticket-system-api works
This is a FastAPI REST API for IT support ticketing. Users authenticate to obtain a JWT, then use role-protected endpoints to manage tickets, assignments, lifecycle status, comments, tags, users, and analytics; responses follow Pydantic schemas and persistence uses SQLAlchemy with SQLite. The README documents the layered request flow, while the source index and excerpts support several specific service and repository relationships. Some router internals and analytics/comment/tag implementations were not excerpted, so those links rely on indexed references rather than inspected call bodies.
Main entry points: routers API routers · repositories Query repositories · main.py FastAPI application · database.py DB sessions
Components 18
HTTP API
- FastAPI application
app/main.py - API routers
app/routers - API schemas
app/schemas
Business Services
- Authentication
app/services/auth_service.py - Ticket lifecycle
app/services/ticket_service.py - User management
app/services/user_service.py - Comments
app/services/comment_service.py - Tags
app/services/tag_service.py - Analytics
app/services/stats_service.py - Synthetic data seed
app/seed.py
Persistence
- Query repositories
app/repositories - Domain models
app/models - SQLite database
Core Foundation
- DB sessions
app/core/database.py - Auth dependencies
app/core/dependencies.py - JWT and passwords
app/core/security.py - Configuration
app/core/config.py
Other components
- HTTP client
Connections 27
- HTTP client → FastAPI application: sends requests
README.md - FastAPI application → API routers: registers routes
README.md - API routers → Authentication: dispatches login
app/routers/auth.py - API routers → Ticket lifecycle: dispatches tickets
app/routers/tickets.py - API routers → User management: dispatches users
app/routers/users.py - API routers → Comments: dispatches comments
app/routers/comments.py - API routers → Tags: dispatches tags
app/routers/tags.py - API routers → Analytics: dispatches analytics
app/routers/stats.py - API routers → Domain models: reads categories
app/routers/categories.py - API routers → API schemas: validates payloads
app/routers/tickets.py - Authentication → Query repositories: looks up users
app/services/auth_service.py - Authentication → JWT and passwords: verifies and signs
app/services/auth_service.py - Ticket lifecycle → Query repositories: queries and mutates
app/services/ticket_service.py - User management → Query repositories: queries and mutates
app/services/user_service.py - Comments → Query repositories: uses data queries
app/services/comment_service.py - Tags → Query repositories: uses tag queries
app/services/tag_service.py - Analytics → Query repositories: aggregates queries
app/services/stats_service.py - Query repositories → Domain models: queries entities
app/repositories/ticket_repository.py - DB sessions → SQLite database: creates sessions
app/core/database.py - Query repositories → DB sessions: uses sessions
- FastAPI application → DB sessions: initializes storage
app/main.py - FastAPI application → Configuration: loads settings
app/main.py - API routers → Auth dependencies: protects routes
app/routers/tickets.py - Auth dependencies → JWT and passwords: decodes tokens
app/core/dependencies.py - Auth dependencies → Query repositories: resolves accounts
app/core/dependencies.py - Synthetic data seed → Domain models: creates demo records
app/seed.py - Synthetic data seed → DB sessions: writes seed data
app/seed.py