# niakun/high-diploma architecture

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

- Interactive diagram: https://gitdiagram.com/niakun/high-diploma
- Repository: https://github.com/niakun/high-diploma

## Overview

AI MOVIE is a bilingual movie discovery app with plot-based semantic search, movie browsing, favorites, authentication, and admin data tools. The main user path is entering a query on the home page, sending it to the backend search API, retrieving and ranking movie matches using embeddings and database search, then browsing results. Admins can import movie data and synchronize vectors. The source excerpts support the home-to-API call, backend-to-AI service usage, and several direct Supabase operations; unsampled page behavior and some API routes are not inferred.

Main entry points: [`backend/src/index.ts`](https://github.com/niakun/high-diploma/blob/main/backend/src/index.ts) (HTTP API), [`backend/src/ai-service.ts`](https://github.com/niakun/high-diploma/blob/main/backend/src/ai-service.ts) (Embedding service), [`frontend/app/pages/Admin/index.vue`](https://github.com/niakun/high-diploma/blob/main/frontend/app/pages/Admin/index.vue) (Admin console), [`frontend/app/pages/index.vue`](https://github.com/niakun/high-diploma/blob/main/frontend/app/pages/index.vue) (Home search)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Movie Discovery"]
  node_home["Home search<br/>[index.vue]"]
  node_movie["Movie details<br/>[&#91;id&#93;.vue]"]
  node_searchpage["Search page<br/>[index.vue]"]
end

subgraph group_backend["Search Backend"]
  node_api["HTTP API<br/>[index.ts]"]
  node_searchlogic["Search &amp; ranking<br/>[index.ts]"]
  node_importlogic["Movie import<br/>[index.ts]"]
  node_embed["Embedding service<br/>[ai-service.ts]"]
  node_model["Embedding model"]
  node_supabase[("Supabase data")]
end

subgraph group_account["Accounts &amp; Favorites"]
  node_authpage["Sign in &amp; register<br/>[index.vue]"]
  node_favorites["Saved favorites<br/>[index.vue]"]
  node_profile["User profile<br/>[index.vue]"]
end

subgraph group_admin["Administration"]
  node_adminpage["Admin console<br/>[index.vue]"]
end

subgraph group_shared["Shared Interface"]
  node_navbar["Navigation<br/>[Navbar.vue]"]
  node_layout["App layout<br/>[default.vue]"]
  node_locale["Locale state<br/>[useLocale.ts]"]
  node_app["App shell<br/>[app.vue]"]
end

node_visitor(("Movie seeker"))
node_tmdb["TMDB catalog"]

node_visitor -->|"searches"| node_home
node_home -->|"requests search"| node_api
node_api -.->|"routes requests"| node_searchlogic
node_searchlogic -->|"generates vectors"| node_embed
node_embed -->|"runs inference"| node_model
node_searchlogic -->|"queries movies"| node_supabase
node_importlogic -->|"writes catalog"| node_supabase
node_importlogic -->|"syncs vectors"| node_embed
node_importlogic -->|"fetches catalog"| node_tmdb
node_authpage -->|"authenticates users"| node_supabase
node_favorites -->|"loads and removes"| node_supabase
node_adminpage -->|"manages records"| node_supabase
node_adminpage -->|"runs data tools"| node_api
node_api -->|"uses service"| node_embed
node_visitor -->|"signs in"| node_authpage
node_visitor -->|"views favorites"| node_favorites
node_visitor -->|"administers catalog"| node_adminpage
node_app -->|"reads language"| node_locale

click node_home "https://github.com/niakun/high-diploma/blob/main/frontend/app/pages/index.vue"
click node_movie "https://github.com/niakun/high-diploma/blob/main/frontend/app/pages/Movie/%5Bid%5D.vue"
click node_searchpage "https://github.com/niakun/high-diploma/blob/main/frontend/app/pages/search_page/index.vue"
click node_api "https://github.com/niakun/high-diploma/blob/main/backend/src/index.ts"
click node_searchlogic "https://github.com/niakun/high-diploma/blob/main/backend/src/index.ts"
click node_importlogic "https://github.com/niakun/high-diploma/blob/main/backend/src/index.ts"
click node_embed "https://github.com/niakun/high-diploma/blob/main/backend/src/ai-service.ts"
click node_authpage "https://github.com/niakun/high-diploma/blob/main/frontend/app/pages/login_page/index.vue"
click node_favorites "https://github.com/niakun/high-diploma/blob/main/frontend/app/pages/favorites/index.vue"
click node_profile "https://github.com/niakun/high-diploma/blob/main/frontend/app/pages/profile/index.vue"
click node_adminpage "https://github.com/niakun/high-diploma/blob/main/frontend/app/pages/Admin/index.vue"
click node_navbar "https://github.com/niakun/high-diploma/blob/main/frontend/app/components/Navbar.vue"
click node_layout "https://github.com/niakun/high-diploma/blob/main/frontend/app/layouts/default.vue"
click node_locale "https://github.com/niakun/high-diploma/blob/main/frontend/app/composables/useLocale.ts"
click node_app "https://github.com/niakun/high-diploma/blob/main/frontend/app/app.vue"

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_home,node_movie,node_searchpage toneBlue
class node_api,node_searchlogic,node_importlogic,node_embed,node_model,node_supabase toneAmber
class node_authpage,node_favorites,node_profile toneMint
class node_adminpage toneRose
class node_navbar,node_layout,node_locale,node_app,node_visitor,node_tmdb toneIndigo
```

## Components

### Movie Discovery

- [Home search](https://github.com/niakun/high-diploma/blob/main/frontend/app/pages/index.vue): `frontend/app/pages/index.vue`
- [Movie details](https://github.com/niakun/high-diploma/blob/main/frontend/app/pages/Movie/%5Bid%5D.vue): `frontend/app/pages/Movie/[id].vue`
- [Search page](https://github.com/niakun/high-diploma/blob/main/frontend/app/pages/search_page/index.vue): `frontend/app/pages/search_page/index.vue`

### Search Backend

- [HTTP API](https://github.com/niakun/high-diploma/blob/main/backend/src/index.ts): `backend/src/index.ts`
- [Search & ranking](https://github.com/niakun/high-diploma/blob/main/backend/src/index.ts): `backend/src/index.ts`
- [Movie import](https://github.com/niakun/high-diploma/blob/main/backend/src/index.ts): `backend/src/index.ts`
- [Embedding service](https://github.com/niakun/high-diploma/blob/main/backend/src/ai-service.ts): `backend/src/ai-service.ts`
- **Embedding model**
- **Supabase data**

### Accounts & Favorites

- [Sign in & register](https://github.com/niakun/high-diploma/blob/main/frontend/app/pages/login_page/index.vue): `frontend/app/pages/login_page/index.vue`
- [Saved favorites](https://github.com/niakun/high-diploma/blob/main/frontend/app/pages/favorites/index.vue): `frontend/app/pages/favorites/index.vue`
- [User profile](https://github.com/niakun/high-diploma/blob/main/frontend/app/pages/profile/index.vue): `frontend/app/pages/profile/index.vue`

### Administration

- [Admin console](https://github.com/niakun/high-diploma/blob/main/frontend/app/pages/Admin/index.vue): `frontend/app/pages/Admin/index.vue`

### Shared Interface

- [Navigation](https://github.com/niakun/high-diploma/blob/main/frontend/app/components/Navbar.vue): `frontend/app/components/Navbar.vue`
- [App layout](https://github.com/niakun/high-diploma/blob/main/frontend/app/layouts/default.vue): `frontend/app/layouts/default.vue`
- [Locale state](https://github.com/niakun/high-diploma/blob/main/frontend/app/composables/useLocale.ts): `frontend/app/composables/useLocale.ts`
- [App shell](https://github.com/niakun/high-diploma/blob/main/frontend/app/app.vue): `frontend/app/app.vue`

### Other components

- **Movie seeker**
- **TMDB catalog**

## Connections

- Movie seeker → Home search: searches (evidence: `frontend/app/pages/index.vue`)
- Home search → HTTP API: requests search (evidence: `frontend/app/pages/index.vue`)
- HTTP API → Search & ranking: routes requests (evidence: `backend/src/index.ts`)
- Search & ranking → Embedding service: generates vectors (evidence: `backend/src/index.ts`)
- Embedding service → Embedding model: runs inference (evidence: `backend/src/ai-service.ts`)
- Search & ranking → Supabase data: queries movies (evidence: `backend/src/index.ts`)
- Movie import → Supabase data: writes catalog (evidence: `backend/src/index.ts`)
- Movie import → Embedding service: syncs vectors (evidence: `backend/src/index.ts`)
- Movie import → TMDB catalog: fetches catalog (evidence: `backend/src/index.ts`)
- Sign in & register → Supabase data: authenticates users (evidence: `frontend/app/pages/login_page/index.vue`)
- Saved favorites → Supabase data: loads and removes (evidence: `frontend/app/pages/favorites/index.vue`)
- Admin console → Supabase data: manages records (evidence: `frontend/app/pages/Admin/index.vue`)
- Admin console → HTTP API: runs data tools (evidence: `frontend/app/pages/Admin/index.vue`)
- HTTP API → Embedding service: uses service (evidence: `backend/src/index.ts`)
- Movie seeker → Sign in & register: signs in (evidence: `frontend/app/pages/login_page/index.vue`)
- Movie seeker → Saved favorites: views favorites (evidence: `frontend/app/pages/favorites/index.vue`)
- Movie seeker → Admin console: administers catalog (evidence: `frontend/app/pages/Admin/index.vue`)
- App shell → Locale state: reads language (evidence: `frontend/app/app.vue`)
