# mariacacacho/kraft architecture

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

- Interactive diagram: https://gitdiagram.com/mariacacacho/kraft
- Repository: https://github.com/mariacacacho/kraft

## Overview

Kraft is a project and ticket management application: users sign in, select or manage projects, track tickets on a Kanban board, and open ticket details to edit work, comment, upload attachments, and view billing fields. The client routes those workflows to an Express API backed by PostgreSQL. The graph preserves project, ticket, authentication, and ticket-detail stages; relationships for unsampled project and ticket handlers are based on the source index, while no README was provided.

Main entry points: [`client/src/App.tsx`](https://github.com/mariacacacho/kraft/blob/main/client/src/App.tsx) (Route guard), [`client/src/pages/BoardPage.tsx`](https://github.com/mariacacacho/kraft/blob/main/client/src/pages/BoardPage.tsx) (Kanban board), [`client/src/lib/api.ts`](https://github.com/mariacacacho/kraft/blob/main/client/src/lib/api.ts) (API client), [`server/src/app.ts`](https://github.com/mariacacacho/kraft/blob/main/server/src/app.ts) (HTTP application)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_app["Route guard<br/>[App.tsx]"]
  node_login["Sign in<br/>[LoginPage.tsx]"]
  node_authstate["Session state<br/>[auth.ts]"]
  node_projectspage["Projects<br/>[ProjectsPage.tsx]"]
  node_projectstate["Project state<br/>[project.ts]"]
  node_api["API client<br/>[api.ts]"]
end

subgraph group_server["API and persistence"]
  node_express["HTTP application<br/>[app.ts]"]
  node_authroute["Auth routes<br/>[auth.ts]"]
  node_authmw["JWT middleware<br/>[auth.ts]"]
  node_projectroute["Project routes<br/>[projects.ts]"]
  node_ticketroute["Ticket routes<br/>[tickets.ts]"]
  node_db[("PostgreSQL pool<br/>[index.ts]")]
  node_migrator["Schema migrator<br/>[migrator.ts]"]
end

subgraph group_ticketing["Ticket workflows"]
  node_board["Kanban board<br/>[BoardPage.tsx]"]
  node_column["Board columns<br/>[KanbanColumn.tsx]"]
  node_ticketcard["Ticket cards<br/>[TicketCard.tsx]"]
  node_create["Create ticket"]
  node_detail["Ticket details"]
  node_types["Domain types<br/>[index.ts]"]
end

node_user(("User"))
node_postgres[("PostgreSQL")]

node_user -->|"opens app"| node_app
node_app -->|"routes to"| node_login
node_app -->|"routes to"| node_board
node_app -->|"routes to"| node_detail
node_app -->|"routes to"| node_projectspage
node_app -->|"checks session"| node_authstate
node_login -->|"submits credentials"| node_authstate
node_authstate -->|"requests auth"| node_api
node_projectspage -->|"requests projects"| node_api
node_projectspage -->|"updates selection"| node_projectstate
node_board -->|"loads tickets"| node_api
node_board -->|"reads active project"| node_projectstate
node_board -->|"renders columns"| node_column
node_board -->|"opens modal"| node_create
node_column -->|"renders cards"| node_ticketcard
node_create -->|"creates ticket"| node_api
node_detail -->|"reads and updates"| node_api
node_api -.->|"sends API requests"| node_express
node_express -->|"mounts auth"| node_authroute
node_express -->|"mounts projects"| node_projectroute
node_express -->|"mounts tickets"| node_ticketroute
node_authroute -->|"protects profile"| node_authmw
node_projectroute -.->|"authenticates requests"| node_authmw
node_ticketroute -.->|"authenticates requests"| node_authmw
node_authroute -->|"queries users"| node_db
node_projectroute -->|"queries projects"| node_db
node_ticketroute -->|"queries tickets"| node_db
node_db -->|"queries"| node_postgres
node_migrator -->|"applies schema"| node_postgres
node_board -->|"uses ticket types"| node_types
node_detail -->|"uses ticket types"| node_types

click node_app "https://github.com/mariacacacho/kraft/blob/main/client/src/App.tsx"
click node_login "https://github.com/mariacacacho/kraft/blob/main/client/src/pages/LoginPage.tsx"
click node_authstate "https://github.com/mariacacacho/kraft/blob/main/client/src/store/auth.ts"
click node_projectspage "https://github.com/mariacacacho/kraft/blob/main/client/src/pages/ProjectsPage.tsx"
click node_projectstate "https://github.com/mariacacacho/kraft/blob/main/client/src/store/project.ts"
click node_board "https://github.com/mariacacacho/kraft/blob/main/client/src/pages/BoardPage.tsx"
click node_column "https://github.com/mariacacacho/kraft/blob/main/client/src/components/KanbanColumn.tsx"
click node_ticketcard "https://github.com/mariacacacho/kraft/blob/main/client/src/components/TicketCard.tsx"
click node_create "https://github.com/mariacacacho/kraft/blob/main/client/src/components/CreateTicketModal.tsx"
click node_detail "https://github.com/mariacacacho/kraft/blob/main/client/src/pages/TicketDetailPage.tsx"
click node_types "https://github.com/mariacacacho/kraft/blob/main/client/src/types/index.ts"
click node_api "https://github.com/mariacacacho/kraft/blob/main/client/src/lib/api.ts"
click node_express "https://github.com/mariacacacho/kraft/blob/main/server/src/app.ts"
click node_authroute "https://github.com/mariacacacho/kraft/blob/main/server/src/routes/auth.ts"
click node_authmw "https://github.com/mariacacacho/kraft/blob/main/server/src/middleware/auth.ts"
click node_projectroute "https://github.com/mariacacacho/kraft/blob/main/server/src/routes/projects.ts"
click node_ticketroute "https://github.com/mariacacacho/kraft/blob/main/server/src/routes/tickets.ts"
click node_db "https://github.com/mariacacacho/kraft/blob/main/server/src/db/index.ts"
click node_migrator "https://github.com/mariacacacho/kraft/blob/main/server/src/db/migrator.ts"

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_app,node_login,node_authstate,node_projectspage,node_projectstate,node_api,node_user toneBlue
class node_express,node_authroute,node_authmw,node_projectroute,node_ticketroute,node_db,node_migrator,node_postgres toneAmber
class node_board,node_column,node_ticketcard,node_create,node_detail,node_types toneMint
```

## Components

### Web client

- [Route guard](https://github.com/mariacacacho/kraft/blob/main/client/src/App.tsx): `client/src/App.tsx`
- [Sign in](https://github.com/mariacacacho/kraft/blob/main/client/src/pages/LoginPage.tsx): `client/src/pages/LoginPage.tsx`
- [Session state](https://github.com/mariacacacho/kraft/blob/main/client/src/store/auth.ts): `client/src/store/auth.ts`
- [Projects](https://github.com/mariacacacho/kraft/blob/main/client/src/pages/ProjectsPage.tsx): `client/src/pages/ProjectsPage.tsx`
- [Project state](https://github.com/mariacacacho/kraft/blob/main/client/src/store/project.ts): `client/src/store/project.ts`
- [API client](https://github.com/mariacacacho/kraft/blob/main/client/src/lib/api.ts): `client/src/lib/api.ts`

### API and persistence

- [HTTP application](https://github.com/mariacacacho/kraft/blob/main/server/src/app.ts): `server/src/app.ts`
- [Auth routes](https://github.com/mariacacacho/kraft/blob/main/server/src/routes/auth.ts): `server/src/routes/auth.ts`
- [JWT middleware](https://github.com/mariacacacho/kraft/blob/main/server/src/middleware/auth.ts): `server/src/middleware/auth.ts`
- [Project routes](https://github.com/mariacacacho/kraft/blob/main/server/src/routes/projects.ts): `server/src/routes/projects.ts`
- [Ticket routes](https://github.com/mariacacacho/kraft/blob/main/server/src/routes/tickets.ts): `server/src/routes/tickets.ts`
- [PostgreSQL pool](https://github.com/mariacacacho/kraft/blob/main/server/src/db/index.ts): `server/src/db/index.ts`
- [Schema migrator](https://github.com/mariacacacho/kraft/blob/main/server/src/db/migrator.ts): `server/src/db/migrator.ts`

### Ticket workflows

- [Kanban board](https://github.com/mariacacacho/kraft/blob/main/client/src/pages/BoardPage.tsx): `client/src/pages/BoardPage.tsx`
- [Board columns](https://github.com/mariacacacho/kraft/blob/main/client/src/components/KanbanColumn.tsx): `client/src/components/KanbanColumn.tsx`
- [Ticket cards](https://github.com/mariacacacho/kraft/blob/main/client/src/components/TicketCard.tsx): `client/src/components/TicketCard.tsx`
- [Create ticket](https://github.com/mariacacacho/kraft/blob/main/client/src/components/CreateTicketModal.tsx): `client/src/components/CreateTicketModal.tsx`
- [Ticket details](https://github.com/mariacacacho/kraft/blob/main/client/src/pages/TicketDetailPage.tsx): `client/src/pages/TicketDetailPage.tsx`
- [Domain types](https://github.com/mariacacacho/kraft/blob/main/client/src/types/index.ts): `client/src/types/index.ts`

### Other components

- **User**
- **PostgreSQL**

## Connections

- User → Route guard: opens app (evidence: `client/src/App.tsx`)
- Route guard → Sign in: routes to (evidence: `client/src/App.tsx`)
- Route guard → Kanban board: routes to (evidence: `client/src/App.tsx`)
- Route guard → Ticket details: routes to (evidence: `client/src/App.tsx`)
- Route guard → Projects: routes to (evidence: `client/src/App.tsx`)
- Route guard → Session state: checks session (evidence: `client/src/App.tsx`)
- Sign in → Session state: submits credentials (evidence: `client/src/pages/LoginPage.tsx`)
- Session state → API client: requests auth (evidence: `client/src/store/auth.ts`)
- Projects → API client: requests projects (evidence: `client/src/pages/ProjectsPage.tsx`)
- Projects → Project state: updates selection (evidence: `client/src/pages/ProjectsPage.tsx`)
- Kanban board → API client: loads tickets (evidence: `client/src/pages/BoardPage.tsx`)
- Kanban board → Project state: reads active project (evidence: `client/src/pages/BoardPage.tsx`)
- Kanban board → Board columns: renders columns (evidence: `client/src/pages/BoardPage.tsx`)
- Kanban board → Create ticket: opens modal (evidence: `client/src/pages/BoardPage.tsx`)
- Board columns → Ticket cards: renders cards (evidence: `client/src/components/KanbanColumn.tsx`)
- Create ticket → API client: creates ticket (evidence: `client/src/components/CreateTicketModal.tsx`)
- Ticket details → API client: reads and updates (evidence: `client/src/pages/TicketDetailPage.tsx`)
- API client → HTTP application: sends API requests
- HTTP application → Auth routes: mounts auth (evidence: `server/src/app.ts`)
- HTTP application → Project routes: mounts projects (evidence: `server/src/app.ts`)
- HTTP application → Ticket routes: mounts tickets (evidence: `server/src/app.ts`)
- Auth routes → JWT middleware: protects profile (evidence: `server/src/routes/auth.ts`)
- Project routes → JWT middleware: authenticates requests (evidence: `server/src/routes/projects.ts`)
- Ticket routes → JWT middleware: authenticates requests (evidence: `server/src/routes/tickets.ts`)
- Auth routes → PostgreSQL pool: queries users (evidence: `server/src/routes/auth.ts`)
- Project routes → PostgreSQL pool: queries projects (evidence: `server/src/routes/projects.ts`)
- Ticket routes → PostgreSQL pool: queries tickets (evidence: `server/src/routes/tickets.ts`)
- PostgreSQL pool → PostgreSQL: queries (evidence: `server/src/db/index.ts`)
- Schema migrator → PostgreSQL: applies schema (evidence: `server/src/db/migrator.ts`)
- Kanban board → Domain types: uses ticket types (evidence: `client/src/pages/BoardPage.tsx`)
- Ticket details → Domain types: uses ticket types (evidence: `client/src/pages/TicketDetailPage.tsx`)
