# dzakyfzl/webuft architecture

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

- Interactive diagram: https://gitdiagram.com/dzakyfzl/webuft
- Repository: https://github.com/dzakyfzl/webuft

## Overview

This repository implements a UKM Fotografi Telkom event, gallery, and administration platform, with a Next.js frontend and FastAPI backend. The main visitor workflow is browsing events and creative works; administrators also manage events, accounts, galleries, links, and media migration. Event forms support attendance or voting, while Angie provides a separate AI chat workflow using knowledge retrieval and public event context. The README is empty, and sampled backend excerpts are incomplete, so uncertain connections among unsampled feature modules are not drawn.

Main entry points: [`Backend/main.py`](https://github.com/dzakyfzl/webuft/blob/main/Backend/main.py) (FastAPI App), [`Backend/app/routers`](https://github.com/dzakyfzl/webuft/tree/main/Backend/app/routers) (Content Routes), [`Backend/app/services/chatbot_service.py`](https://github.com/dzakyfzl/webuft/blob/main/Backend/app/services/chatbot_service.py) (Chat Service), [`frontend/app`](https://github.com/dzakyfzl/webuft/tree/main/frontend/app) (Web Pages)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Visitor and Admin Web"]
  node_frontend["Web Pages"]
  node_api_client["API Client<br/>[api.ts]"]
  node_chat_widget["Chat Widget<br/>[ChatWidget.tsx]"]
end

subgraph group_api["Backend API"]
  node_backend_app["FastAPI App<br/>[main.py]"]
  node_db_session["DB Sessions<br/>[database.py]"]
  node_database[("Application Database")]
end

subgraph group_content["Events and Submissions"]
  node_content_routes["Content Routes"]
  node_event_service["Event Service<br/>[acara_service.py]"]
  node_work_service["Creative Works<br/>[karya_service.py]"]
  node_album_service["Albums and Photos<br/>[album_service.py]"]
  node_form_service["Event Forms<br/>[form_service.py]"]
  node_form_repository["Form Data<br/>[form_repository.py]"]
end

subgraph group_management["Administration"]
  node_admin_routes["Admin Routes"]
  node_account_service["Account Management<br/>[akun_service.py]"]
  node_shortlink_service["Shortlinks<br/>[shortlink.py]"]
  node_migration_service["Media Migration<br/>[migrate_service.py]"]
  node_file_repository["Media File Records<br/>[file_repository.py]"]
end

subgraph group_assistant["Angie Chatbot"]
  node_chat_routes["Chat Routes<br/>[chatbot.py]"]
  node_chat_service["Chat Service<br/>[chatbot_service.py]"]
  node_chat_repository["Chat Data"]
  node_context_service["Live Event Context"]
  node_context_repository["Public Event Reads"]
end

node_visitor(("Visitor"))
node_admin(("Administrator"))
node_gemini["Google Gemini"]

node_visitor -->|"browses"| node_frontend
node_admin -->|"manages"| node_frontend
node_frontend -->|"requests data"| node_api_client
node_api_client -->|"calls API"| node_backend_app
node_backend_app -->|"includes routes"| node_content_routes
node_backend_app -->|"includes routes"| node_admin_routes
node_backend_app -->|"includes route"| node_chat_routes
node_backend_app -->|"initializes"| node_db_session
node_db_session -->|"connects"| node_database
node_content_routes -->|"dispatches"| node_event_service
node_content_routes -->|"dispatches"| node_work_service
node_content_routes -->|"dispatches"| node_album_service
node_content_routes -->|"dispatches"| node_form_service
node_form_service -->|"reads and writes"| node_form_repository
node_admin_routes -->|"dispatches"| node_account_service
node_admin_routes -->|"dispatches"| node_shortlink_service
node_admin_routes -->|"dispatches"| node_migration_service
node_migration_service -->|"reads paths"| node_file_repository
node_chat_widget -->|"sends messages"| node_chat_routes
node_chat_routes -->|"dispatches"| node_chat_service
node_chat_service -->|"queries and stores"| node_chat_repository
node_chat_service -->|"builds context"| node_context_service
node_context_service -->|"reads events"| node_context_repository
node_context_repository -->|"selects public events"| node_database
node_chat_service -.->|"embeds and generates"| node_gemini

click node_frontend "https://github.com/dzakyfzl/webuft/tree/main/frontend/app"
click node_api_client "https://github.com/dzakyfzl/webuft/blob/main/frontend/app/lib/api.ts"
click node_backend_app "https://github.com/dzakyfzl/webuft/blob/main/Backend/main.py"
click node_db_session "https://github.com/dzakyfzl/webuft/blob/main/Backend/app/core/database.py"
click node_content_routes "https://github.com/dzakyfzl/webuft/tree/main/Backend/app/routers"
click node_event_service "https://github.com/dzakyfzl/webuft/blob/main/Backend/app/services/acara_service.py"
click node_work_service "https://github.com/dzakyfzl/webuft/blob/main/Backend/app/services/karya_service.py"
click node_album_service "https://github.com/dzakyfzl/webuft/blob/main/Backend/app/services/album_service.py"
click node_form_service "https://github.com/dzakyfzl/webuft/blob/main/Backend/app/services/form_service.py"
click node_form_repository "https://github.com/dzakyfzl/webuft/blob/main/Backend/app/repositories/form_repository.py"
click node_admin_routes "https://github.com/dzakyfzl/webuft/tree/main/Backend/app/routers"
click node_account_service "https://github.com/dzakyfzl/webuft/blob/main/Backend/app/services/akun_service.py"
click node_shortlink_service "https://github.com/dzakyfzl/webuft/blob/main/Backend/app/services/shortlink.py"
click node_migration_service "https://github.com/dzakyfzl/webuft/blob/main/Backend/app/services/migrate_service.py"
click node_file_repository "https://github.com/dzakyfzl/webuft/blob/main/Backend/app/repositories/file_repository.py"
click node_chat_widget "https://github.com/dzakyfzl/webuft/blob/main/frontend/app/components/ChatWidget.tsx"
click node_chat_routes "https://github.com/dzakyfzl/webuft/blob/main/Backend/app/routers/chatbot.py"
click node_chat_service "https://github.com/dzakyfzl/webuft/blob/main/Backend/app/services/chatbot_service.py"
click node_chat_repository "https://github.com/dzakyfzl/webuft/blob/main/Backend/app/repositories/chatbot_repository.py"
click node_context_service "https://github.com/dzakyfzl/webuft/blob/main/Backend/app/services/chatbot_context_service.py"
click node_context_repository "https://github.com/dzakyfzl/webuft/blob/main/Backend/app/repositories/chatbot_context_repository.py"

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,node_api_client,node_chat_widget toneBlue
class node_backend_app,node_db_session,node_database toneAmber
class node_content_routes,node_event_service,node_work_service,node_album_service,node_form_service,node_form_repository toneMint
class node_admin_routes,node_account_service,node_shortlink_service,node_migration_service,node_file_repository toneRose
class node_chat_routes,node_chat_service,node_chat_repository,node_context_service,node_context_repository,node_visitor,node_admin,node_gemini toneIndigo
```

## Components

### Visitor and Admin Web

- [Web Pages](https://github.com/dzakyfzl/webuft/tree/main/frontend/app): `frontend/app`
- [API Client](https://github.com/dzakyfzl/webuft/blob/main/frontend/app/lib/api.ts): `frontend/app/lib/api.ts`
- [Chat Widget](https://github.com/dzakyfzl/webuft/blob/main/frontend/app/components/ChatWidget.tsx): `frontend/app/components/ChatWidget.tsx`

### Backend API

- [FastAPI App](https://github.com/dzakyfzl/webuft/blob/main/Backend/main.py): `Backend/main.py`
- [DB Sessions](https://github.com/dzakyfzl/webuft/blob/main/Backend/app/core/database.py): `Backend/app/core/database.py`
- **Application Database**

### Events and Submissions

- [Content Routes](https://github.com/dzakyfzl/webuft/tree/main/Backend/app/routers): `Backend/app/routers`
- [Event Service](https://github.com/dzakyfzl/webuft/blob/main/Backend/app/services/acara_service.py): `Backend/app/services/acara_service.py`
- [Creative Works](https://github.com/dzakyfzl/webuft/blob/main/Backend/app/services/karya_service.py): `Backend/app/services/karya_service.py`
- [Albums and Photos](https://github.com/dzakyfzl/webuft/blob/main/Backend/app/services/album_service.py): `Backend/app/services/album_service.py`
- [Event Forms](https://github.com/dzakyfzl/webuft/blob/main/Backend/app/services/form_service.py): `Backend/app/services/form_service.py`
- [Form Data](https://github.com/dzakyfzl/webuft/blob/main/Backend/app/repositories/form_repository.py): `Backend/app/repositories/form_repository.py`

### Administration

- [Admin Routes](https://github.com/dzakyfzl/webuft/tree/main/Backend/app/routers): `Backend/app/routers`
- [Account Management](https://github.com/dzakyfzl/webuft/blob/main/Backend/app/services/akun_service.py): `Backend/app/services/akun_service.py`
- [Shortlinks](https://github.com/dzakyfzl/webuft/blob/main/Backend/app/services/shortlink.py): `Backend/app/services/shortlink.py`
- [Media Migration](https://github.com/dzakyfzl/webuft/blob/main/Backend/app/services/migrate_service.py): `Backend/app/services/migrate_service.py`
- [Media File Records](https://github.com/dzakyfzl/webuft/blob/main/Backend/app/repositories/file_repository.py): `Backend/app/repositories/file_repository.py`

### Angie Chatbot

- [Chat Routes](https://github.com/dzakyfzl/webuft/blob/main/Backend/app/routers/chatbot.py): `Backend/app/routers/chatbot.py`
- [Chat Service](https://github.com/dzakyfzl/webuft/blob/main/Backend/app/services/chatbot_service.py): `Backend/app/services/chatbot_service.py`
- [Chat Data](https://github.com/dzakyfzl/webuft/blob/main/Backend/app/repositories/chatbot_repository.py): `Backend/app/repositories/chatbot_repository.py`
- [Live Event Context](https://github.com/dzakyfzl/webuft/blob/main/Backend/app/services/chatbot_context_service.py): `Backend/app/services/chatbot_context_service.py`
- [Public Event Reads](https://github.com/dzakyfzl/webuft/blob/main/Backend/app/repositories/chatbot_context_repository.py): `Backend/app/repositories/chatbot_context_repository.py`

### Other components

- **Visitor**
- **Administrator**
- **Google Gemini**

## Connections

- Visitor → Web Pages: browses
- Administrator → Web Pages: manages
- Web Pages → API Client: requests data
- API Client → FastAPI App: calls API
- FastAPI App → Content Routes: includes routes
- FastAPI App → Admin Routes: includes routes
- FastAPI App → Chat Routes: includes route
- FastAPI App → DB Sessions: initializes
- DB Sessions → Application Database: connects
- Content Routes → Event Service: dispatches
- Content Routes → Creative Works: dispatches
- Content Routes → Albums and Photos: dispatches
- Content Routes → Event Forms: dispatches
- Event Forms → Form Data: reads and writes
- Admin Routes → Account Management: dispatches
- Admin Routes → Shortlinks: dispatches
- Admin Routes → Media Migration: dispatches
- Media Migration → Media File Records: reads paths
- Chat Widget → Chat Routes: sends messages
- Chat Routes → Chat Service: dispatches
- Chat Service → Chat Data: queries and stores
- Chat Service → Live Event Context: builds context
- Live Event Context → Public Event Reads: reads events
- Public Event Reads → Application Database: selects public events
- Chat Service → Google Gemini: embeds and generates
