# akashahane/ticketapi architecture

> Architecture diagram of the GitHub repository akashahane/ticketapi, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/akashahane/ticketapi
- Repository: https://github.com/akashahane/ticketapi

## Overview

TicketApi is an ASP.NET Core REST API for account registration/login and authenticated support-ticket management. Users register, log in for a JWT, then send it to ticket endpoints to create, list, retrieve, update status, or delete tickets; TicketDbContext persists ticket and user records through EF Core and SQLite. The graph also shows startup authentication/authorization and the documented Swagger interface. Core controller, model, and context relationships are supported by excerpts; some documented runtime wiring is represented from README or startup configuration.

Main entry points: [`Program.cs`](https://github.com/akashahane/ticketapi/blob/main/Program.cs) (Application setup), [`TicketDbContext.cs`](https://github.com/akashahane/ticketapi/blob/main/TicketDbContext.cs) (EF data context), [`controllers/AuthController.cs`](https://github.com/akashahane/ticketapi/blob/main/controllers/AuthController.cs) (Registration and login), [`controllers/TicketsController.cs`](https://github.com/akashahane/ticketapi/blob/main/controllers/TicketsController.cs) (Ticket endpoints)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_startup["API startup"]
  node_program["Application setup<br/>[Program.cs]"]
  node_swagger["Swagger UI<br/>[Program.cs]"]
end

subgraph group_accounts["Account access"]
  node_auth["Registration and login<br/>[AuthController.cs]"]
  node_jwt["JWT validation<br/>[Program.cs]"]
  node_user_model["User record<br/>[User.cs]"]
end

subgraph group_tickets["Ticket workflow"]
  node_ticket_api["Ticket endpoints"]
  node_ticket_model["Ticket and DTOs<br/>[Ticket.cs]"]
end

subgraph group_persistence["Persistence"]
  node_db_context["EF data context<br/>[TicketDbContext.cs]"]
  node_sqlite[("SQLite database")]
end

node_client(("API client"))

node_client -->|"sends requests"| node_program
node_program -->|"maps controllers"| node_auth
node_program -->|"maps controllers"| node_ticket_api
node_program -->|"enables in development"| node_swagger
node_client -->|"explores API"| node_swagger
node_auth -->|"reads and saves"| node_db_context
node_auth -->|"creates and verifies"| node_user_model
node_auth -->|"issues signed token"| node_jwt
node_client -->|"presents bearer token"| node_jwt
node_program -->|"configures validation"| node_jwt
node_ticket_api -->|"queries and saves"| node_db_context
node_ticket_api -->|"creates and updates"| node_ticket_model
node_db_context -->|"maps tickets"| node_ticket_model
node_db_context -->|"maps users"| node_user_model
node_program -->|"configures SQLite"| node_db_context
node_db_context -.->|"persists records"| node_sqlite

click node_program "https://github.com/akashahane/ticketapi/blob/main/Program.cs"
click node_swagger "https://github.com/akashahane/ticketapi/blob/main/Program.cs"
click node_auth "https://github.com/akashahane/ticketapi/blob/main/controllers/AuthController.cs"
click node_jwt "https://github.com/akashahane/ticketapi/blob/main/Program.cs"
click node_ticket_api "https://github.com/akashahane/ticketapi/blob/main/controllers/TicketsController.cs"
click node_ticket_model "https://github.com/akashahane/ticketapi/blob/main/Ticket.cs"
click node_user_model "https://github.com/akashahane/ticketapi/blob/main/User.cs"
click node_db_context "https://github.com/akashahane/ticketapi/blob/main/TicketDbContext.cs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_program,node_swagger,node_client toneBlue
class node_auth,node_jwt,node_user_model toneAmber
class node_ticket_api,node_ticket_model toneMint
class node_db_context,node_sqlite toneRose
```

## Components

### API startup

- [Application setup](https://github.com/akashahane/ticketapi/blob/main/Program.cs): `Program.cs`
- [Swagger UI](https://github.com/akashahane/ticketapi/blob/main/Program.cs): `Program.cs`

### Account access

- [Registration and login](https://github.com/akashahane/ticketapi/blob/main/controllers/AuthController.cs): `controllers/AuthController.cs`
- [JWT validation](https://github.com/akashahane/ticketapi/blob/main/Program.cs): `Program.cs`
- [User record](https://github.com/akashahane/ticketapi/blob/main/User.cs): `User.cs`

### Ticket workflow

- [Ticket endpoints](https://github.com/akashahane/ticketapi/blob/main/controllers/TicketsController.cs): `controllers/TicketsController.cs`
- [Ticket and DTOs](https://github.com/akashahane/ticketapi/blob/main/Ticket.cs): `Ticket.cs`

### Persistence

- [EF data context](https://github.com/akashahane/ticketapi/blob/main/TicketDbContext.cs): `TicketDbContext.cs`
- **SQLite database**

### Other components

- **API client**

## Connections

- API client → Application setup: sends requests (evidence: `README.md`)
- Application setup → Registration and login: maps controllers (evidence: `Program.cs`)
- Application setup → Ticket endpoints: maps controllers (evidence: `Program.cs`)
- Application setup → Swagger UI: enables in development (evidence: `Program.cs`)
- API client → Swagger UI: explores API (evidence: `README.md`)
- Registration and login → EF data context: reads and saves (evidence: `controllers/AuthController.cs`)
- Registration and login → User record: creates and verifies (evidence: `controllers/AuthController.cs`)
- Registration and login → JWT validation: issues signed token (evidence: `controllers/AuthController.cs`)
- API client → JWT validation: presents bearer token (evidence: `README.md`)
- Application setup → JWT validation: configures validation (evidence: `Program.cs`)
- Ticket endpoints → EF data context: queries and saves (evidence: `controllers/TicketsController.cs`)
- Ticket endpoints → Ticket and DTOs: creates and updates (evidence: `controllers/TicketsController.cs`)
- EF data context → Ticket and DTOs: maps tickets (evidence: `TicketDbContext.cs`)
- EF data context → User record: maps users (evidence: `TicketDbContext.cs`)
- Application setup → EF data context: configures SQLite (evidence: `Program.cs`)
- EF data context → SQLite database: persists records
