# hakkul/exam_ta_v2 architecture

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

- Interactive diagram: https://gitdiagram.com/hakkul/exam_ta_v2
- Repository: https://github.com/hakkul/exam_ta_v2

## Overview

This repository combines a room-booking API on a Cloudflare Worker with an otherwise unconnected Vue/Vite starter screen. The principal API workflow covers room browsing and creation, booking submission and listing, and administrator approval or rejection; booking submissions are validated and start pending. The Worker uses a Drizzle adapter over D1, with room and booking tables defined in the schema. The sampled Vue component only renders starter content and a local counter, so no connection between it and the API is shown. The frontend and database behavior are described only to the extent supported by the sampled files.

Main entry points: [`worker/db/index.ts`](https://github.com/hakkul/exam_ta_v2/blob/master/worker/db/index.ts) (Drizzle adapter), [`worker/index.ts`](https://github.com/hakkul/exam_ta_v2/blob/master/worker/index.ts) (HTTP routes), [`src/App.vue`](https://github.com/hakkul/exam_ta_v2/blob/master/src/App.vue) (App shell), [`src/main.ts`](https://github.com/hakkul/exam_ta_v2/blob/master/src/main.ts) (Vue mount)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Vue starter"]
  node_vue_entry["Vue mount<br/>[main.ts]"]
  node_app_shell["App shell<br/>[App.vue]"]
  node_starter_view["Starter view<br/>[HelloWorld.vue]"]
end

subgraph group_api["Booking API"]
  node_worker_api["HTTP routes<br/>[index.ts]"]
  node_room_list["List rooms<br/>[index.ts]"]
  node_room_create["Create room<br/>[index.ts]"]
  node_booking_list["List bookings<br/>[index.ts]"]
  node_booking_submit["Submit booking<br/>[index.ts]"]
  node_booking_review["Review booking<br/>[index.ts]"]
end

subgraph group_data["Persistence"]
  node_db_adapter["Drizzle adapter<br/>[index.ts]"]
  node_booking_schema["Room and booking tables<br/>[schema.ts]"]
end

node_visitor(("API client"))
node_d1[("Cloudflare D1")]

node_visitor -->|"requests endpoints"| node_worker_api
node_vue_entry -->|"mounts"| node_app_shell
node_app_shell -->|"renders"| node_starter_view
node_worker_api -->|"routes"| node_room_list
node_worker_api -->|"routes"| node_room_create
node_worker_api -->|"routes"| node_booking_list
node_worker_api -->|"routes"| node_booking_submit
node_worker_api -->|"routes"| node_booking_review
node_room_list -->|"queries through"| node_db_adapter
node_room_create -->|"inserts through"| node_db_adapter
node_booking_list -->|"queries through"| node_db_adapter
node_booking_submit -->|"inserts through"| node_db_adapter
node_booking_review -->|"updates through"| node_db_adapter
node_db_adapter -->|"configures schema"| node_booking_schema
node_db_adapter -->|"uses binding"| node_d1

click node_vue_entry "https://github.com/hakkul/exam_ta_v2/blob/master/src/main.ts"
click node_app_shell "https://github.com/hakkul/exam_ta_v2/blob/master/src/App.vue"
click node_starter_view "https://github.com/hakkul/exam_ta_v2/blob/master/src/components/HelloWorld.vue"
click node_worker_api "https://github.com/hakkul/exam_ta_v2/blob/master/worker/index.ts"
click node_room_list "https://github.com/hakkul/exam_ta_v2/blob/master/worker/index.ts"
click node_room_create "https://github.com/hakkul/exam_ta_v2/blob/master/worker/index.ts"
click node_booking_list "https://github.com/hakkul/exam_ta_v2/blob/master/worker/index.ts"
click node_booking_submit "https://github.com/hakkul/exam_ta_v2/blob/master/worker/index.ts"
click node_booking_review "https://github.com/hakkul/exam_ta_v2/blob/master/worker/index.ts"
click node_db_adapter "https://github.com/hakkul/exam_ta_v2/blob/master/worker/db/index.ts"
click node_booking_schema "https://github.com/hakkul/exam_ta_v2/blob/master/worker/db/schema.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_vue_entry,node_app_shell,node_starter_view,node_visitor toneBlue
class node_worker_api,node_room_list,node_room_create,node_booking_list,node_booking_submit,node_booking_review,node_d1 toneAmber
class node_db_adapter,node_booking_schema toneMint
```

## Components

### Vue starter

- [Vue mount](https://github.com/hakkul/exam_ta_v2/blob/master/src/main.ts): `src/main.ts`
- [App shell](https://github.com/hakkul/exam_ta_v2/blob/master/src/App.vue): `src/App.vue`
- [Starter view](https://github.com/hakkul/exam_ta_v2/blob/master/src/components/HelloWorld.vue): `src/components/HelloWorld.vue`

### Booking API

- [HTTP routes](https://github.com/hakkul/exam_ta_v2/blob/master/worker/index.ts): `worker/index.ts`
- [List rooms](https://github.com/hakkul/exam_ta_v2/blob/master/worker/index.ts): `worker/index.ts`
- [Create room](https://github.com/hakkul/exam_ta_v2/blob/master/worker/index.ts): `worker/index.ts`
- [List bookings](https://github.com/hakkul/exam_ta_v2/blob/master/worker/index.ts): `worker/index.ts`
- [Submit booking](https://github.com/hakkul/exam_ta_v2/blob/master/worker/index.ts): `worker/index.ts`
- [Review booking](https://github.com/hakkul/exam_ta_v2/blob/master/worker/index.ts): `worker/index.ts`

### Persistence

- [Drizzle adapter](https://github.com/hakkul/exam_ta_v2/blob/master/worker/db/index.ts): `worker/db/index.ts`
- [Room and booking tables](https://github.com/hakkul/exam_ta_v2/blob/master/worker/db/schema.ts): `worker/db/schema.ts`

### Other components

- **API client**
- **Cloudflare D1**

## Connections

- API client → HTTP routes: requests endpoints (evidence: `worker/index.ts`)
- Vue mount → App shell: mounts (evidence: `src/main.ts`)
- App shell → Starter view: renders (evidence: `src/App.vue`)
- HTTP routes → List rooms: routes (evidence: `worker/index.ts`)
- HTTP routes → Create room: routes (evidence: `worker/index.ts`)
- HTTP routes → List bookings: routes (evidence: `worker/index.ts`)
- HTTP routes → Submit booking: routes (evidence: `worker/index.ts`)
- HTTP routes → Review booking: routes (evidence: `worker/index.ts`)
- List rooms → Drizzle adapter: queries through (evidence: `worker/index.ts`)
- Create room → Drizzle adapter: inserts through (evidence: `worker/index.ts`)
- List bookings → Drizzle adapter: queries through (evidence: `worker/index.ts`)
- Submit booking → Drizzle adapter: inserts through (evidence: `worker/index.ts`)
- Review booking → Drizzle adapter: updates through (evidence: `worker/index.ts`)
- Drizzle adapter → Room and booking tables: configures schema (evidence: `worker/db/index.ts`)
- Drizzle adapter → Cloudflare D1: uses binding
