# youchen624/bkhome-webapp architecture

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

- Interactive diagram: https://gitdiagram.com/youchen624/bkhome-webapp
- Repository: https://github.com/youchen624/bkhome-webapp

## Overview

BKHome-WebAPP is currently a small web application scaffold: the visible user workflow is loading the React page, checking API health, and displaying the response or an error. The API also serves the compiled frontend in production. Authentication is represented by shared Zod schemas, but the sampled code does not show registration or login endpoints using them. The API database helper is likewise not connected to a shown route. Edges reflect visible calls or documented configuration; the health request’s matching route is shown in separate files, so that link is dashed.

Main entry points: [`apps/web/src/main.tsx`](https://github.com/youchen624/bkhome-webapp/blob/main/apps/web/src/main.tsx) (React entry), [`apps/web/src/App.tsx`](https://github.com/youchen624/bkhome-webapp/blob/main/apps/web/src/App.tsx) (Health status UI), [`apps/api/src/shared/db.ts`](https://github.com/youchen624/bkhome-webapp/blob/main/apps/api/src/shared/db.ts) (Postgres access), [`apps/api/src/server.ts`](https://github.com/youchen624/bkhome-webapp/blob/main/apps/api/src/server.ts) (Express API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web frontend"]
  node_web_entry["React entry<br/>[main.tsx]"]
  node_home["Health status UI<br/>[App.tsx]"]
end

subgraph group_api["API service"]
  node_api_service["Express API<br/>[server.ts]"]
end

subgraph group_shared["Shared domain and data"]
  node_auth_schemas["Auth schemas<br/>[auth.schema.ts]"]
  node_db_helper["Postgres access<br/>[db.ts]"]
end

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

node_user -->|"opens app"| node_web_entry
node_web_entry -->|"renders"| node_home
node_home -.->|"requests health"| node_api_service
node_db_helper -->|"queries"| node_postgres

click node_web_entry "https://github.com/youchen624/bkhome-webapp/blob/main/apps/web/src/main.tsx"
click node_home "https://github.com/youchen624/bkhome-webapp/blob/main/apps/web/src/App.tsx"
click node_api_service "https://github.com/youchen624/bkhome-webapp/blob/main/apps/api/src/server.ts"
click node_auth_schemas "https://github.com/youchen624/bkhome-webapp/blob/main/packages/core/src/auth/auth.schema.ts"
click node_db_helper "https://github.com/youchen624/bkhome-webapp/blob/main/apps/api/src/shared/db.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_web_entry,node_home,node_user toneBlue
class node_api_service,node_postgres toneAmber
class node_auth_schemas,node_db_helper toneMint
```

## Components

### Web frontend

- [React entry](https://github.com/youchen624/bkhome-webapp/blob/main/apps/web/src/main.tsx): `apps/web/src/main.tsx`
- [Health status UI](https://github.com/youchen624/bkhome-webapp/blob/main/apps/web/src/App.tsx): `apps/web/src/App.tsx`

### API service

- [Express API](https://github.com/youchen624/bkhome-webapp/blob/main/apps/api/src/server.ts): `apps/api/src/server.ts`

### Shared domain and data

- [Auth schemas](https://github.com/youchen624/bkhome-webapp/blob/main/packages/core/src/auth/auth.schema.ts): `packages/core/src/auth/auth.schema.ts`
- [Postgres access](https://github.com/youchen624/bkhome-webapp/blob/main/apps/api/src/shared/db.ts): `apps/api/src/shared/db.ts`

### Other components

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

## Connections

- User → React entry: opens app
- React entry → Health status UI: renders (evidence: `apps/web/src/main.tsx`)
- Health status UI → Express API: requests health
- Postgres access → PostgreSQL: queries (evidence: `apps/api/src/shared/db.ts`)
