# johan621/deadline-guardian-ai architecture

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

- Interactive diagram: https://gitdiagram.com/johan621/deadline-guardian-ai
- Repository: https://github.com/johan621/deadline-guardian-ai

## Overview

Deadline Guardian AI is a deadline-risk and recovery app. Users enter a commitment, the server analyzes its preparation needs and risk, and the dashboard presents capacity, priorities, and actions; users can also simulate delay or request a rebuilt plan. The README documents these capabilities and a local-intelligence fallback. The sampled excerpts show the React-to-API and server-to-Gemini paths, but omit portions of the handlers, so uncertain internal wiring is not expanded.

Main entry points: [`server.ts`](https://github.com/johan621/deadline-guardian-ai/blob/master/server.ts) (HTTP API), [`src/App.tsx`](https://github.com/johan621/deadline-guardian-ai/blob/master/src/App.tsx) (App coordinator), [`src/main.tsx`](https://github.com/johan621/deadline-guardian-ai/blob/master/src/main.tsx) (React entry), [`src/components/AddGoal.tsx`](https://github.com/johan621/deadline-guardian-ai/blob/master/src/components/AddGoal.tsx) (Goal intake)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["User experience"]
  node_entry["React entry<br/>[main.tsx]"]
  node_app["App coordinator<br/>[App.tsx]"]
  node_intake["Goal intake<br/>[AddGoal.tsx]"]
  node_dashboard["Dashboard<br/>[Home.tsx]"]
  node_riskui["Risk simulator<br/>[Risks.tsx]"]
  node_recoveryui["Recovery center<br/>[Recovery.tsx]"]
end

subgraph group_backend["Application backend"]
  node_api["HTTP API<br/>[server.ts]"]
  node_goalanalysis["Goal analysis<br/>[server.ts]"]
  node_capacity["Capacity and priorities<br/>[server.ts]"]
  node_actions["Action sequencing<br/>[server.ts]"]
  node_delay["Delay simulation<br/>[server.ts]"]
  node_rebuild["Plan recovery<br/>[server.ts]"]
  node_fallback["Local fallback<br/>[server.ts]"]
end

subgraph group_state["Persistent state"]
  node_store[("JSON state<br/>[server.ts]")]
end

subgraph group_integrations["AI integration"]
  node_gemini{{"Gemini API"}}
end

node_user(("User"))

node_user -->|"opens app"| node_entry
node_entry -->|"renders"| node_app
node_app -->|"renders"| node_intake
node_app -->|"renders"| node_dashboard
node_app -->|"renders"| node_riskui
node_app -->|"renders"| node_recoveryui
node_intake -->|"submits goal"| node_app
node_riskui -->|"requests simulation"| node_app
node_recoveryui -->|"requests rebuild"| node_app
node_app -->|"fetches data"| node_api
node_api -->|"reads and writes"| node_store
node_api -->|"analyzes goal"| node_goalanalysis
node_api -->|"computes report"| node_capacity
node_api -->|"creates actions"| node_actions
node_api -->|"simulates delay"| node_delay
node_api -->|"rebuilds plan"| node_rebuild
node_api -.->|"generates analysis"| node_gemini
node_api -->|"uses if unavailable"| node_fallback

click node_entry "https://github.com/johan621/deadline-guardian-ai/blob/master/src/main.tsx"
click node_app "https://github.com/johan621/deadline-guardian-ai/blob/master/src/App.tsx"
click node_intake "https://github.com/johan621/deadline-guardian-ai/blob/master/src/components/AddGoal.tsx"
click node_dashboard "https://github.com/johan621/deadline-guardian-ai/blob/master/src/components/Home.tsx"
click node_riskui "https://github.com/johan621/deadline-guardian-ai/blob/master/src/components/Risks.tsx"
click node_recoveryui "https://github.com/johan621/deadline-guardian-ai/blob/master/src/components/Recovery.tsx"
click node_api "https://github.com/johan621/deadline-guardian-ai/blob/master/server.ts"
click node_goalanalysis "https://github.com/johan621/deadline-guardian-ai/blob/master/server.ts"
click node_capacity "https://github.com/johan621/deadline-guardian-ai/blob/master/server.ts"
click node_actions "https://github.com/johan621/deadline-guardian-ai/blob/master/server.ts"
click node_delay "https://github.com/johan621/deadline-guardian-ai/blob/master/server.ts"
click node_rebuild "https://github.com/johan621/deadline-guardian-ai/blob/master/server.ts"
click node_fallback "https://github.com/johan621/deadline-guardian-ai/blob/master/server.ts"
click node_store "https://github.com/johan621/deadline-guardian-ai/blob/master/server.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_entry,node_app,node_intake,node_dashboard,node_riskui,node_recoveryui,node_user toneBlue
class node_api,node_goalanalysis,node_capacity,node_actions,node_delay,node_rebuild,node_fallback toneAmber
class node_store toneMint
class node_gemini toneRose
```

## Components

### User experience

- [React entry](https://github.com/johan621/deadline-guardian-ai/blob/master/src/main.tsx): `src/main.tsx`
- [App coordinator](https://github.com/johan621/deadline-guardian-ai/blob/master/src/App.tsx): `src/App.tsx`
- [Goal intake](https://github.com/johan621/deadline-guardian-ai/blob/master/src/components/AddGoal.tsx): `src/components/AddGoal.tsx`
- [Dashboard](https://github.com/johan621/deadline-guardian-ai/blob/master/src/components/Home.tsx): `src/components/Home.tsx`
- [Risk simulator](https://github.com/johan621/deadline-guardian-ai/blob/master/src/components/Risks.tsx): `src/components/Risks.tsx`
- [Recovery center](https://github.com/johan621/deadline-guardian-ai/blob/master/src/components/Recovery.tsx): `src/components/Recovery.tsx`

### Application backend

- [HTTP API](https://github.com/johan621/deadline-guardian-ai/blob/master/server.ts): `server.ts`
- [Goal analysis](https://github.com/johan621/deadline-guardian-ai/blob/master/server.ts): `server.ts`
- [Capacity and priorities](https://github.com/johan621/deadline-guardian-ai/blob/master/server.ts): `server.ts`
- [Action sequencing](https://github.com/johan621/deadline-guardian-ai/blob/master/server.ts): `server.ts`
- [Delay simulation](https://github.com/johan621/deadline-guardian-ai/blob/master/server.ts): `server.ts`
- [Plan recovery](https://github.com/johan621/deadline-guardian-ai/blob/master/server.ts): `server.ts`
- [Local fallback](https://github.com/johan621/deadline-guardian-ai/blob/master/server.ts): `server.ts`

### Persistent state

- [JSON state](https://github.com/johan621/deadline-guardian-ai/blob/master/server.ts): `server.ts`

### AI integration

- **Gemini API**

### Other components

- **User**

## Connections

- User → React entry: opens app
- React entry → App coordinator: renders
- App coordinator → Goal intake: renders
- App coordinator → Dashboard: renders
- App coordinator → Risk simulator: renders
- App coordinator → Recovery center: renders
- Goal intake → App coordinator: submits goal
- Risk simulator → App coordinator: requests simulation
- Recovery center → App coordinator: requests rebuild
- App coordinator → HTTP API: fetches data
- HTTP API → JSON state: reads and writes
- HTTP API → Goal analysis: analyzes goal
- HTTP API → Capacity and priorities: computes report
- HTTP API → Action sequencing: creates actions
- HTTP API → Delay simulation: simulates delay
- HTTP API → Plan recovery: rebuilds plan
- HTTP API → Gemini API: generates analysis
- HTTP API → Local fallback: uses if unavailable
