# di-sukharev/vibe architecture

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

- Interactive diagram: https://gitdiagram.com/di-sukharev/vibe
- Repository: https://github.com/di-sukharev/vibe

## Overview

This is a web-product template with a public Astro site, a signed-in React application, and a backend API backed by PostgreSQL. The principal workflow is a user interacting with the webapp, which routes requests to backend authentication and account services; the backend also provides admin and avatar-upload capabilities. Backend storage drivers, email delivery, and outbox processing form supporting layers. The graph reflects README statements and sampled source; unsampled subsystem links are omitted where their callers were not shown.

Main entry points: [`backend/src/app.ts`](https://github.com/di-sukharev/vibe/blob/master/backend/src/app.ts) (HTTP application), [`backend/src/modules/auth/application/auth-service.ts`](https://github.com/di-sukharev/vibe/blob/master/backend/src/modules/auth/application/auth-service.ts) (Authentication), [`backend/src/modules/auth/infrastructure/auth-repository.ts`](https://github.com/di-sukharev/vibe/blob/master/backend/src/modules/auth/infrastructure/auth-repository.ts) (Auth repository), [`backend/src/storage/port.ts`](https://github.com/di-sukharev/vibe/blob/master/backend/src/storage/port.ts) (Private storage)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["Web clients"]
  node_public_site["Public site"]
  node_webapp_routes["App routes<br/>[routes.tsx]"]
  node_webapp_pages["App pages<br/>[pages.tsx]"]
end

subgraph group_api["Backend API"]
  node_backend_app["HTTP application<br/>[app.ts]"]
  node_auth_routes["Auth routes<br/>[routes.ts]"]
  node_users_routes["User routes<br/>[routes.ts]"]
  node_uploads_routes["Upload routes<br/>[routes.ts]"]
end

subgraph group_domain["Product services"]
  node_auth_service["Authentication<br/>[auth-service.ts]"]
  node_auth_repository["Auth repository<br/>[auth-repository.ts]"]
  node_users_service["User management<br/>[users-service.ts]"]
  node_avatar_service["Avatar handling<br/>[avatars-service.ts]"]
end

subgraph group_support["Backend infrastructure"]
  node_postgres[("PostgreSQL<br/>[db.ts]")]
  node_private_storage["Private storage<br/>[port.ts]"]
  node_filesystem_storage["Filesystem driver"]
  node_s3_storage["S3 driver<br/>[s3-storage.ts]"]
  node_email_delivery["Email delivery<br/>[index.ts]"]
  node_outbox["Outbox handlers<br/>[handlers.ts]"]
end

subgraph group_shared["Shared API"]
  node_contracts["API contracts<br/>[auth.ts]"]
end

node_visitor(("Visitor"))
node_api_user(("API client"))

node_visitor -->|"views pages"| node_public_site
node_visitor -->|"uses app"| node_webapp_routes
node_webapp_routes -->|"loads pages"| node_webapp_pages
node_webapp_pages -.->|"requests API"| node_backend_app
node_api_user -->|"calls API"| node_backend_app
node_backend_app -->|"mounts routes"| node_auth_routes
node_backend_app -->|"mounts routes"| node_users_routes
node_backend_app -->|"mounts routes"| node_uploads_routes
node_auth_routes -->|"calls service"| node_auth_service
node_auth_service -->|"uses repository"| node_auth_repository
node_auth_repository -->|"queries database"| node_postgres
node_users_routes -->|"calls service"| node_users_service
node_uploads_routes -->|"calls service"| node_avatar_service
node_backend_app -->|"configures storage"| node_private_storage
node_private_storage -.->|"uses driver"| node_filesystem_storage
node_private_storage -.->|"uses driver"| node_s3_storage
node_auth_service -.->|"sends email"| node_email_delivery
node_auth_repository -->|"enqueues tasks"| node_outbox
node_auth_service -->|"uses schemas"| node_contracts

click node_public_site "https://github.com/di-sukharev/vibe/blob/master/website/src/components/landing/HeroSceneCanvas.tsx"
click node_webapp_routes "https://github.com/di-sukharev/vibe/blob/master/webapp/src/routes.tsx"
click node_webapp_pages "https://github.com/di-sukharev/vibe/blob/master/webapp/src/pages.tsx"
click node_backend_app "https://github.com/di-sukharev/vibe/blob/master/backend/src/app.ts"
click node_auth_routes "https://github.com/di-sukharev/vibe/blob/master/backend/src/modules/auth/transport/routes.ts"
click node_users_routes "https://github.com/di-sukharev/vibe/blob/master/backend/src/modules/users/transport/routes.ts"
click node_uploads_routes "https://github.com/di-sukharev/vibe/blob/master/backend/src/modules/uploads/transport/routes.ts"
click node_auth_service "https://github.com/di-sukharev/vibe/blob/master/backend/src/modules/auth/application/auth-service.ts"
click node_auth_repository "https://github.com/di-sukharev/vibe/blob/master/backend/src/modules/auth/infrastructure/auth-repository.ts"
click node_users_service "https://github.com/di-sukharev/vibe/blob/master/backend/src/modules/users/application/users-service.ts"
click node_avatar_service "https://github.com/di-sukharev/vibe/blob/master/backend/src/modules/uploads/application/avatars-service.ts"
click node_postgres "https://github.com/di-sukharev/vibe/blob/master/backend/src/db.ts"
click node_private_storage "https://github.com/di-sukharev/vibe/blob/master/backend/src/storage/port.ts"
click node_filesystem_storage "https://github.com/di-sukharev/vibe/blob/master/backend/src/storage/filesystem-storage.ts"
click node_s3_storage "https://github.com/di-sukharev/vibe/blob/master/backend/src/storage/s3-storage.ts"
click node_email_delivery "https://github.com/di-sukharev/vibe/blob/master/backend/src/email/index.ts"
click node_outbox "https://github.com/di-sukharev/vibe/blob/master/backend/src/outbox/handlers.ts"
click node_contracts "https://github.com/di-sukharev/vibe/blob/master/packages/contracts/src/auth.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_public_site,node_webapp_routes,node_webapp_pages,node_api_user toneBlue
class node_backend_app,node_auth_routes,node_users_routes,node_uploads_routes toneAmber
class node_auth_service,node_auth_repository,node_users_service,node_avatar_service toneMint
class node_postgres,node_private_storage,node_filesystem_storage,node_s3_storage,node_email_delivery,node_outbox toneRose
class node_contracts,node_visitor toneIndigo
```

## Components

### Web clients

- [Public site](https://github.com/di-sukharev/vibe/blob/master/website/src/components/landing/HeroSceneCanvas.tsx): `website/src/components/landing/HeroSceneCanvas.tsx`
- [App routes](https://github.com/di-sukharev/vibe/blob/master/webapp/src/routes.tsx): `webapp/src/routes.tsx`
- [App pages](https://github.com/di-sukharev/vibe/blob/master/webapp/src/pages.tsx): `webapp/src/pages.tsx`

### Backend API

- [HTTP application](https://github.com/di-sukharev/vibe/blob/master/backend/src/app.ts): `backend/src/app.ts`
- [Auth routes](https://github.com/di-sukharev/vibe/blob/master/backend/src/modules/auth/transport/routes.ts): `backend/src/modules/auth/transport/routes.ts`
- [User routes](https://github.com/di-sukharev/vibe/blob/master/backend/src/modules/users/transport/routes.ts): `backend/src/modules/users/transport/routes.ts`
- [Upload routes](https://github.com/di-sukharev/vibe/blob/master/backend/src/modules/uploads/transport/routes.ts): `backend/src/modules/uploads/transport/routes.ts`

### Product services

- [Authentication](https://github.com/di-sukharev/vibe/blob/master/backend/src/modules/auth/application/auth-service.ts): `backend/src/modules/auth/application/auth-service.ts`
- [Auth repository](https://github.com/di-sukharev/vibe/blob/master/backend/src/modules/auth/infrastructure/auth-repository.ts): `backend/src/modules/auth/infrastructure/auth-repository.ts`
- [User management](https://github.com/di-sukharev/vibe/blob/master/backend/src/modules/users/application/users-service.ts): `backend/src/modules/users/application/users-service.ts`
- [Avatar handling](https://github.com/di-sukharev/vibe/blob/master/backend/src/modules/uploads/application/avatars-service.ts): `backend/src/modules/uploads/application/avatars-service.ts`

### Backend infrastructure

- [PostgreSQL](https://github.com/di-sukharev/vibe/blob/master/backend/src/db.ts): `backend/src/db.ts`
- [Private storage](https://github.com/di-sukharev/vibe/blob/master/backend/src/storage/port.ts): `backend/src/storage/port.ts`
- [Filesystem driver](https://github.com/di-sukharev/vibe/blob/master/backend/src/storage/filesystem-storage.ts): `backend/src/storage/filesystem-storage.ts`
- [S3 driver](https://github.com/di-sukharev/vibe/blob/master/backend/src/storage/s3-storage.ts): `backend/src/storage/s3-storage.ts`
- [Email delivery](https://github.com/di-sukharev/vibe/blob/master/backend/src/email/index.ts): `backend/src/email/index.ts`
- [Outbox handlers](https://github.com/di-sukharev/vibe/blob/master/backend/src/outbox/handlers.ts): `backend/src/outbox/handlers.ts`

### Shared API

- [API contracts](https://github.com/di-sukharev/vibe/blob/master/packages/contracts/src/auth.ts): `packages/contracts/src/auth.ts`

### Other components

- **Visitor**
- **API client**

## Connections

- Visitor → Public site: views pages (evidence: `README.md`)
- Visitor → App routes: uses app (evidence: `README.md`)
- App routes → App pages: loads pages (evidence: `webapp/src/routes.tsx`)
- App pages → HTTP application: requests API (evidence: `README.md`)
- API client → HTTP application: calls API (evidence: `README.md`)
- HTTP application → Auth routes: mounts routes (evidence: `backend/src/app.ts`)
- HTTP application → User routes: mounts routes (evidence: `backend/src/app.ts`)
- HTTP application → Upload routes: mounts routes (evidence: `backend/src/app.ts`)
- Auth routes → Authentication: calls service (evidence: `backend/src/modules/auth/transport/routes.ts`)
- Authentication → Auth repository: uses repository (evidence: `backend/src/modules/auth/index.ts`)
- Auth repository → PostgreSQL: queries database (evidence: `backend/src/modules/auth/infrastructure/auth-repository.ts`)
- User routes → User management: calls service (evidence: `backend/src/modules/users/transport/routes.ts`)
- Upload routes → Avatar handling: calls service (evidence: `backend/src/modules/uploads/transport/routes.ts`)
- HTTP application → Private storage: configures storage (evidence: `backend/src/app.ts`)
- Private storage → Filesystem driver: uses driver (evidence: `backend/src/storage/filesystem-storage.ts`)
- Private storage → S3 driver: uses driver (evidence: `backend/src/storage/s3-storage.ts`)
- Authentication → Email delivery: sends email
- Auth repository → Outbox handlers: enqueues tasks (evidence: `backend/src/modules/auth/infrastructure/auth-repository.ts`)
- Authentication → API contracts: uses schemas (evidence: `backend/src/modules/auth/application/auth-service.ts`)
