# di-kar/repos_pmd_team2 architecture

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

- Interactive diagram: https://gitdiagram.com/di-kar/repos_pmd_team2
- Repository: https://github.com/di-kar/repos_pmd_team2

## Overview

PMD is a multi-service online cinema platform with administration, film discovery, identity, user-generated content, event analytics, and notification capabilities. Its user-facing flow spans film APIs and search, with separate services for authentication, profiles, and engagement; asynchronous event and notification pipelines provide supporting capabilities. Edges follow explicit README statements or shown imports/calls; several internal service-to-storage relationships are omitted where their implementation was not sampled.

Main entry points: [`auth_service/src/api/v1/auth.py`](https://github.com/di-kar/repos_pmd_team2/blob/main/auth_service/src/api/v1/auth.py) (Authentication), [`notification_api/src/api/v1/notifications.py`](https://github.com/di-kar/repos_pmd_team2/blob/main/notification_api/src/api/v1/notifications.py) (Notification intake), [`admin_panel/movies/api/v1/views.py`](https://github.com/di-kar/repos_pmd_team2/blob/main/admin_panel/movies/api/v1/views.py) (Cinema admin), [`async_api/src/api/v1/films.py`](https://github.com/di-kar/repos_pmd_team2/blob/main/async_api/src/api/v1/films.py) (Film API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_media["Cinema and discovery"]
  node_admin["Cinema admin<br/>[views.py]"]
  node_film_api["Film API<br/>[films.py]"]
  node_catalog_store[("Search storage<br/>[storage.py]")]
  node_search_etl["Catalog ETL<br/>[main.py]"]
end

subgraph group_identity["Identity and profiles"]
  node_auth["Authentication<br/>[auth.py]"]
  node_auth_data[("Auth database<br/>[postgres.py]")]
  node_profiles["User profiles<br/>[profiles.py]"]
end

subgraph group_ugc["User content"]
  node_ugc_api["UGC API<br/>[reviews.py]"]
  node_ugc_data[("UGC store<br/>[connection.py]")]
end

subgraph group_analytics["Events and analytics"]
  node_event_api["Event intake<br/>[events.py]"]
  node_event_kafka["Event Kafka"]
  node_analytics_etl["Analytics ETL<br/>[main.py]"]
  node_clickhouse[("ClickHouse")]
end

subgraph group_notifications["Notifications"]
  node_notification_admin["Notification admin<br/>[services.py]"]
  node_notification_api["Notification intake<br/>[notifications.py]"]
  node_notification_kafka["Notification Kafka"]
  node_notification_worker["Notification worker<br/>[send_service.py]"]
end

subgraph group_links["Short links"]
  node_link_service["Short-link service<br/>[link_service.py]"]
end

node_viewer(("Viewer"))
node_email["Email delivery"]

node_viewer -->|"browses films"| node_film_api
node_film_api -.->|"searches catalog"| node_catalog_store
node_admin -.->|"manages catalog"| node_search_etl
node_search_etl -->|"indexes catalog"| node_catalog_store
node_viewer -->|"authenticates"| node_auth
node_auth -->|"stores identities"| node_auth_data
node_viewer -->|"manages profile"| node_profiles
node_viewer -->|"creates content"| node_ugc_api
node_ugc_api -->|"stores UGC"| node_ugc_data
node_viewer -->|"submits events"| node_event_api
node_event_api -->|"publishes events"| node_event_kafka
node_event_kafka -->|"provides events"| node_analytics_etl
node_analytics_etl -->|"loads analytics"| node_clickhouse
node_admin -->|"requests notifications"| node_notification_api
node_notification_admin -->|"submits campaigns"| node_notification_api
node_auth -->|"requests notices"| node_notification_api
node_notification_api -->|"publishes requests"| node_notification_kafka
node_notification_kafka -->|"delivers requests"| node_notification_worker
node_notification_worker -->|"sends email"| node_email
node_auth -->|"creates confirmation link"| node_link_service
node_link_service -->|"confirms email"| node_auth

click node_admin "https://github.com/di-kar/repos_pmd_team2/blob/main/admin_panel/movies/api/v1/views.py"
click node_film_api "https://github.com/di-kar/repos_pmd_team2/blob/main/async_api/src/api/v1/films.py"
click node_catalog_store "https://github.com/di-kar/repos_pmd_team2/blob/main/async_api/src/db/storage.py"
click node_search_etl "https://github.com/di-kar/repos_pmd_team2/blob/main/fulltext_search/etl/main.py"
click node_auth "https://github.com/di-kar/repos_pmd_team2/blob/main/auth_service/src/api/v1/auth.py"
click node_auth_data "https://github.com/di-kar/repos_pmd_team2/blob/main/auth_service/src/db/postgres.py"
click node_profiles "https://github.com/di-kar/repos_pmd_team2/blob/main/user_profiles/src/api/v1/profiles.py"
click node_ugc_api "https://github.com/di-kar/repos_pmd_team2/blob/main/ugc_service/src/api/v1/reviews.py"
click node_ugc_data "https://github.com/di-kar/repos_pmd_team2/blob/main/ugc_service/src/db/connection.py"
click node_event_api "https://github.com/di-kar/repos_pmd_team2/blob/main/event_api/src/api/v1/events.py"
click node_analytics_etl "https://github.com/di-kar/repos_pmd_team2/blob/main/analytics_etl/src/main.py"
click node_notification_admin "https://github.com/di-kar/repos_pmd_team2/blob/main/notification_admin_panel/notifications/services.py"
click node_notification_api "https://github.com/di-kar/repos_pmd_team2/blob/main/notification_api/src/api/v1/notifications.py"
click node_notification_worker "https://github.com/di-kar/repos_pmd_team2/blob/main/notification_worker/src/services/send_service.py"
click node_link_service "https://github.com/di-kar/repos_pmd_team2/blob/main/link_shortener_service/src/services/link_service.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_admin,node_film_api,node_catalog_store,node_search_etl,node_viewer toneBlue
class node_auth,node_auth_data,node_profiles toneAmber
class node_ugc_api,node_ugc_data toneMint
class node_event_api,node_event_kafka,node_analytics_etl,node_clickhouse toneRose
class node_notification_admin,node_notification_api,node_notification_kafka,node_notification_worker,node_email toneIndigo
class node_link_service toneTeal
```

## Components

### Cinema and discovery

- [Cinema admin](https://github.com/di-kar/repos_pmd_team2/blob/main/admin_panel/movies/api/v1/views.py): `admin_panel/movies/api/v1/views.py`
- [Film API](https://github.com/di-kar/repos_pmd_team2/blob/main/async_api/src/api/v1/films.py): `async_api/src/api/v1/films.py`
- [Search storage](https://github.com/di-kar/repos_pmd_team2/blob/main/async_api/src/db/storage.py): `async_api/src/db/storage.py`
- [Catalog ETL](https://github.com/di-kar/repos_pmd_team2/blob/main/fulltext_search/etl/main.py): `fulltext_search/etl/main.py`

### Identity and profiles

- [Authentication](https://github.com/di-kar/repos_pmd_team2/blob/main/auth_service/src/api/v1/auth.py): `auth_service/src/api/v1/auth.py`
- [Auth database](https://github.com/di-kar/repos_pmd_team2/blob/main/auth_service/src/db/postgres.py): `auth_service/src/db/postgres.py`
- [User profiles](https://github.com/di-kar/repos_pmd_team2/blob/main/user_profiles/src/api/v1/profiles.py): `user_profiles/src/api/v1/profiles.py`

### User content

- [UGC API](https://github.com/di-kar/repos_pmd_team2/blob/main/ugc_service/src/api/v1/reviews.py): `ugc_service/src/api/v1/reviews.py`
- [UGC store](https://github.com/di-kar/repos_pmd_team2/blob/main/ugc_service/src/db/connection.py): `ugc_service/src/db/connection.py`

### Events and analytics

- [Event intake](https://github.com/di-kar/repos_pmd_team2/blob/main/event_api/src/api/v1/events.py): `event_api/src/api/v1/events.py`
- **Event Kafka**
- [Analytics ETL](https://github.com/di-kar/repos_pmd_team2/blob/main/analytics_etl/src/main.py): `analytics_etl/src/main.py`
- **ClickHouse**

### Notifications

- [Notification admin](https://github.com/di-kar/repos_pmd_team2/blob/main/notification_admin_panel/notifications/services.py): `notification_admin_panel/notifications/services.py`
- [Notification intake](https://github.com/di-kar/repos_pmd_team2/blob/main/notification_api/src/api/v1/notifications.py): `notification_api/src/api/v1/notifications.py`
- **Notification Kafka**
- [Notification worker](https://github.com/di-kar/repos_pmd_team2/blob/main/notification_worker/src/services/send_service.py): `notification_worker/src/services/send_service.py`

### Short links

- [Short-link service](https://github.com/di-kar/repos_pmd_team2/blob/main/link_shortener_service/src/services/link_service.py): `link_shortener_service/src/services/link_service.py`

### Other components

- **Viewer**
- **Email delivery**

## Connections

- Viewer → Film API: browses films (evidence: `README.md`)
- Film API → Search storage: searches catalog
- Cinema admin → Catalog ETL: manages catalog
- Catalog ETL → Search storage: indexes catalog (evidence: `README.md`)
- Viewer → Authentication: authenticates (evidence: `README.md`)
- Authentication → Auth database: stores identities
- Viewer → User profiles: manages profile (evidence: `README.md`)
- Viewer → UGC API: creates content (evidence: `README.md`)
- UGC API → UGC store: stores UGC (evidence: `ugc_service/src/main.py`)
- Viewer → Event intake: submits events (evidence: `README.md`)
- Event intake → Event Kafka: publishes events
- Event Kafka → Analytics ETL: provides events (evidence: `README.md`)
- Analytics ETL → ClickHouse: loads analytics (evidence: `README.md`)
- Cinema admin → Notification intake: requests notifications (evidence: `README.md`)
- Notification admin → Notification intake: submits campaigns (evidence: `notification_admin_panel/notifications/services.py`)
- Authentication → Notification intake: requests notices (evidence: `README.md`)
- Notification intake → Notification Kafka: publishes requests (evidence: `README.md`)
- Notification Kafka → Notification worker: delivers requests (evidence: `README.md`)
- Notification worker → Email delivery: sends email (evidence: `README.md`)
- Authentication → Short-link service: creates confirmation link (evidence: `README.md`)
- Short-link service → Authentication: confirms email
