# harshalborde17/movie-recommendation-system architecture

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

- Interactive diagram: https://gitdiagram.com/harshalborde17/movie-recommendation-system
- Repository: https://github.com/harshalborde17/movie-recommendation-system

## Overview

This is a movie scraping, storage, and search application. Users browse a JavaScript frontend that requests movie listings and details, with search, filters, sorting, pagination, statistics, and CSV export served by FastAPI. A separate scraper downloads permitted source pages, parses and normalizes movie records, then imports them into SQLite; sample data can also be seeded. The graph distinguishes API routing, persistence logic, and database modeling. Scraper-to-database and frontend-to-API relationships are shown where the excerpts support them; unsampled implementation details are omitted.

Main entry points: [`app/routes.py`](https://github.com/harshalborde17/movie-recommendation-system/blob/main/app/routes.py) (REST endpoints), [`app/crud.py`](https://github.com/harshalborde17/movie-recommendation-system/blob/main/app/crud.py) (Movie operations), [`app/database.py`](https://github.com/harshalborde17/movie-recommendation-system/blob/main/app/database.py) (SQLite database), [`app/seed.py`](https://github.com/harshalborde17/movie-recommendation-system/blob/main/app/seed.py) (Sample-data seeder)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_frontend["Interactive frontend<br/>[script.js]"]
end

subgraph group_api["API and domain"]
  node_application["Application setup<br/>[main.py]"]
  node_routes["REST endpoints<br/>[routes.py]"]
  node_schemas["Movie schemas<br/>[schemas.py]"]
end

subgraph group_storage["Persistence"]
  node_crud["Movie operations<br/>[crud.py]"]
  node_models["Movie model<br/>[models.py]"]
  node_database[("SQLite database<br/>[database.py]")]
end

subgraph group_ingestion["Data ingestion"]
  node_scraper["Scrape and normalize<br/>[scraper.py]"]
  node_seeder["Sample-data seeder<br/>[seed.py]"]
  node_sample_data["Sample movie records<br/>[sample_movies.json]"]
end

node_visitor(("Movie browser"))
node_source_site(("Movie source site"))

node_visitor -->|"uses"| node_frontend
node_frontend -->|"fetches API"| node_routes
node_application -->|"registers routes"| node_routes
node_application -->|"creates tables"| node_database
node_application -->|"serves static UI"| node_frontend
node_routes -->|"calls"| node_crud
node_routes -->|"gets sessions"| node_database
node_routes -->|"queries"| node_models
node_routes -->|"validates responses"| node_schemas
node_crud -->|"queries and writes"| node_models
node_crud -->|"accepts movie data"| node_schemas
node_models -->|"uses base"| node_database
node_source_site -->|"provides HTML"| node_scraper
node_scraper -->|"imports records"| node_crud
node_scraper -->|"opens session"| node_database
node_scraper -->|"builds movie input"| node_schemas
node_seeder -->|"loads records"| node_sample_data
node_seeder -->|"imports records"| node_crud
node_seeder -->|"opens session"| node_database
node_seeder -->|"builds movie input"| node_schemas

click node_frontend "https://github.com/harshalborde17/movie-recommendation-system/blob/main/frontend/script.js"
click node_application "https://github.com/harshalborde17/movie-recommendation-system/blob/main/app/main.py"
click node_routes "https://github.com/harshalborde17/movie-recommendation-system/blob/main/app/routes.py"
click node_schemas "https://github.com/harshalborde17/movie-recommendation-system/blob/main/app/schemas.py"
click node_crud "https://github.com/harshalborde17/movie-recommendation-system/blob/main/app/crud.py"
click node_models "https://github.com/harshalborde17/movie-recommendation-system/blob/main/app/models.py"
click node_database "https://github.com/harshalborde17/movie-recommendation-system/blob/main/app/database.py"
click node_scraper "https://github.com/harshalborde17/movie-recommendation-system/blob/main/app/scraper.py"
click node_seeder "https://github.com/harshalborde17/movie-recommendation-system/blob/main/app/seed.py"
click node_sample_data "https://github.com/harshalborde17/movie-recommendation-system/blob/main/data/sample_movies.json"

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_visitor toneBlue
class node_application,node_routes,node_schemas toneAmber
class node_crud,node_models,node_database toneMint
class node_scraper,node_seeder,node_sample_data toneRose
class node_source_site toneIndigo
```

## Components

### User experience

- [Interactive frontend](https://github.com/harshalborde17/movie-recommendation-system/blob/main/frontend/script.js): `frontend/script.js`

### API and domain

- [Application setup](https://github.com/harshalborde17/movie-recommendation-system/blob/main/app/main.py): `app/main.py`
- [REST endpoints](https://github.com/harshalborde17/movie-recommendation-system/blob/main/app/routes.py): `app/routes.py`
- [Movie schemas](https://github.com/harshalborde17/movie-recommendation-system/blob/main/app/schemas.py): `app/schemas.py`

### Persistence

- [Movie operations](https://github.com/harshalborde17/movie-recommendation-system/blob/main/app/crud.py): `app/crud.py`
- [Movie model](https://github.com/harshalborde17/movie-recommendation-system/blob/main/app/models.py): `app/models.py`
- [SQLite database](https://github.com/harshalborde17/movie-recommendation-system/blob/main/app/database.py): `app/database.py`

### Data ingestion

- [Scrape and normalize](https://github.com/harshalborde17/movie-recommendation-system/blob/main/app/scraper.py): `app/scraper.py`
- [Sample-data seeder](https://github.com/harshalborde17/movie-recommendation-system/blob/main/app/seed.py): `app/seed.py`
- [Sample movie records](https://github.com/harshalborde17/movie-recommendation-system/blob/main/data/sample_movies.json): `data/sample_movies.json`

### Other components

- **Movie browser**
- **Movie source site**

## Connections

- Movie browser → Interactive frontend: uses (evidence: `README.md`)
- Interactive frontend → REST endpoints: fetches API (evidence: `frontend/script.js`)
- Application setup → REST endpoints: registers routes (evidence: `app/main.py`)
- Application setup → SQLite database: creates tables (evidence: `app/main.py`)
- Application setup → Interactive frontend: serves static UI (evidence: `app/main.py`)
- REST endpoints → Movie operations: calls (evidence: `app/routes.py`)
- REST endpoints → SQLite database: gets sessions (evidence: `app/routes.py`)
- REST endpoints → Movie model: queries (evidence: `app/routes.py`)
- REST endpoints → Movie schemas: validates responses (evidence: `app/routes.py`)
- Movie operations → Movie model: queries and writes (evidence: `app/crud.py`)
- Movie operations → Movie schemas: accepts movie data (evidence: `app/crud.py`)
- Movie model → SQLite database: uses base (evidence: `app/models.py`)
- Movie source site → Scrape and normalize: provides HTML (evidence: `app/scraper.py`)
- Scrape and normalize → Movie operations: imports records (evidence: `app/scraper.py`)
- Scrape and normalize → SQLite database: opens session (evidence: `app/scraper.py`)
- Scrape and normalize → Movie schemas: builds movie input (evidence: `app/scraper.py`)
- Sample-data seeder → Sample movie records: loads records (evidence: `app/seed.py`)
- Sample-data seeder → Movie operations: imports records (evidence: `app/seed.py`)
- Sample-data seeder → SQLite database: opens session (evidence: `app/seed.py`)
- Sample-data seeder → Movie schemas: builds movie input (evidence: `app/seed.py`)
