# danielraab/my-cars architecture

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

- Interactive diagram: https://gitdiagram.com/danielraab/my-cars
- Repository: https://github.com/danielraab/my-cars

## Overview

My Car is an in-progress rewrite of a car-management app for vehicles, refuels, repairs, tickets, and expenses. The documented user workflow is a browser-based React app calling a Go REST backend; the legacy app shows the earlier domain scope but is read-only and is not part of the rewrite runtime. Current source confirms frontend startup and backend startup, database setup, and server assembly, but not implemented domain handlers or authentication. The graph therefore treats those capabilities as documented architecture, not verified code.

Main entry points: [`backend/main.go`](https://github.com/danielraab/my-cars/blob/master/backend/main.go) (Server startup), [`backend/internal/httpserver/mux.go`](https://github.com/danielraab/my-cars/blob/master/backend/internal/httpserver/mux.go) (HTTP mux), [`frontend/src/routeTree.gen.ts`](https://github.com/danielraab/my-cars/blob/master/frontend/src/routeTree.gen.ts) (Route tree), [`frontend/src/main.tsx`](https://github.com/danielraab/my-cars/blob/master/frontend/src/main.tsx) (React entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Frontend"]
  node_frontend_entry["React entry<br/>[main.tsx]"]
  node_frontend_router["App router<br/>[router.tsx]"]
  node_route_tree["Route tree<br/>[routeTree.gen.ts]"]
  node_root_route["Root route<br/>[__root.tsx]"]
  node_home_route["Home route<br/>[index.tsx]"]
end

subgraph group_backend["Backend runtime"]
  node_backend_main["Server startup<br/>[main.go]"]
  node_configuration["Runtime config<br/>[config.go]"]
  node_migrations["DB migrations<br/>[migrate.go]"]
  node_db_pool["DB pool<br/>[pool.go]"]
  node_http_mux["HTTP mux<br/>[mux.go]"]
  node_health_endpoint["Health endpoint<br/>[healthz.go]"]
  node_openapi_handler["OpenAPI serving<br/>[openapi.go]"]
  node_static_handler["Static serving<br/>[static.go]"]
  node_health_probe["Health probe<br/>[probe.go]"]
end

subgraph group_integrations["External systems"]
  node_database[("Application database")]
end

node_browser(("User browser"))
node_rest_client(("REST API client"))

node_browser -->|"loads app"| node_frontend_entry
node_frontend_entry -->|"creates router"| node_frontend_router
node_frontend_entry -->|"uses routes"| node_route_tree
node_frontend_router -->|"uses routes"| node_route_tree
node_route_tree -->|"routes to"| node_root_route
node_route_tree -->|"routes to"| node_home_route
node_rest_client -.->|"REST requests"| node_http_mux
node_backend_main -->|"loads config"| node_configuration
node_backend_main -->|"runs migrations"| node_migrations
node_backend_main -->|"creates pool"| node_db_pool
node_backend_main -->|"builds mux"| node_http_mux
node_backend_main -->|"runs probe"| node_health_probe
node_migrations -->|"changes schema"| node_database
node_db_pool -->|"connects"| node_database
node_http_mux -.-> node_health_endpoint
node_http_mux -.-> node_openapi_handler
node_http_mux -.-> node_static_handler

click node_frontend_entry "https://github.com/danielraab/my-cars/blob/master/frontend/src/main.tsx"
click node_frontend_router "https://github.com/danielraab/my-cars/blob/master/frontend/src/router.tsx"
click node_route_tree "https://github.com/danielraab/my-cars/blob/master/frontend/src/routeTree.gen.ts"
click node_root_route "https://github.com/danielraab/my-cars/blob/master/frontend/src/routes/__root.tsx"
click node_home_route "https://github.com/danielraab/my-cars/blob/master/frontend/src/routes/index.tsx"
click node_backend_main "https://github.com/danielraab/my-cars/blob/master/backend/main.go"
click node_configuration "https://github.com/danielraab/my-cars/blob/master/backend/internal/config/config.go"
click node_migrations "https://github.com/danielraab/my-cars/blob/master/backend/internal/db/migrate.go"
click node_db_pool "https://github.com/danielraab/my-cars/blob/master/backend/internal/db/pool.go"
click node_http_mux "https://github.com/danielraab/my-cars/blob/master/backend/internal/httpserver/mux.go"
click node_health_endpoint "https://github.com/danielraab/my-cars/blob/master/backend/internal/httpserver/healthz.go"
click node_openapi_handler "https://github.com/danielraab/my-cars/blob/master/backend/internal/httpserver/openapi.go"
click node_static_handler "https://github.com/danielraab/my-cars/blob/master/backend/internal/httpserver/static.go"
click node_health_probe "https://github.com/danielraab/my-cars/blob/master/backend/internal/healthcheck/probe.go"

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_frontend_entry,node_frontend_router,node_route_tree,node_root_route,node_home_route,node_browser,node_rest_client toneBlue
class node_backend_main,node_configuration,node_migrations,node_db_pool,node_http_mux,node_health_endpoint,node_openapi_handler,node_static_handler,node_health_probe toneAmber
class node_database toneMint
```

## Components

### Frontend

- [React entry](https://github.com/danielraab/my-cars/blob/master/frontend/src/main.tsx): `frontend/src/main.tsx`
- [App router](https://github.com/danielraab/my-cars/blob/master/frontend/src/router.tsx): `frontend/src/router.tsx`
- [Route tree](https://github.com/danielraab/my-cars/blob/master/frontend/src/routeTree.gen.ts): `frontend/src/routeTree.gen.ts`
- [Root route](https://github.com/danielraab/my-cars/blob/master/frontend/src/routes/__root.tsx): `frontend/src/routes/__root.tsx`
- [Home route](https://github.com/danielraab/my-cars/blob/master/frontend/src/routes/index.tsx): `frontend/src/routes/index.tsx`

### Backend runtime

- [Server startup](https://github.com/danielraab/my-cars/blob/master/backend/main.go): `backend/main.go`
- [Runtime config](https://github.com/danielraab/my-cars/blob/master/backend/internal/config/config.go): `backend/internal/config/config.go`
- [DB migrations](https://github.com/danielraab/my-cars/blob/master/backend/internal/db/migrate.go): `backend/internal/db/migrate.go`
- [DB pool](https://github.com/danielraab/my-cars/blob/master/backend/internal/db/pool.go): `backend/internal/db/pool.go`
- [HTTP mux](https://github.com/danielraab/my-cars/blob/master/backend/internal/httpserver/mux.go): `backend/internal/httpserver/mux.go`
- [Health endpoint](https://github.com/danielraab/my-cars/blob/master/backend/internal/httpserver/healthz.go): `backend/internal/httpserver/healthz.go`
- [OpenAPI serving](https://github.com/danielraab/my-cars/blob/master/backend/internal/httpserver/openapi.go): `backend/internal/httpserver/openapi.go`
- [Static serving](https://github.com/danielraab/my-cars/blob/master/backend/internal/httpserver/static.go): `backend/internal/httpserver/static.go`
- [Health probe](https://github.com/danielraab/my-cars/blob/master/backend/internal/healthcheck/probe.go): `backend/internal/healthcheck/probe.go`

### External systems

- **Application database**

### Other components

- **User browser**
- **REST API client**

## Connections

- User browser → React entry: loads app
- React entry → App router: creates router
- React entry → Route tree: uses routes
- App router → Route tree: uses routes
- Route tree → Root route: routes to
- Route tree → Home route: routes to
- REST API client → HTTP mux: REST requests
- Server startup → Runtime config: loads config
- Server startup → DB migrations: runs migrations
- Server startup → DB pool: creates pool
- Server startup → HTTP mux: builds mux
- Server startup → Health probe: runs probe
- DB migrations → Application database: changes schema
- DB pool → Application database: connects
- HTTP mux → Health endpoint
- HTTP mux → OpenAPI serving
- HTTP mux → Static serving
