# tharun52/moviesdb architecture

> Architecture diagram of the GitHub repository tharun52/moviesdb, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/tharun52/moviesdb
- Repository: https://github.com/tharun52/moviesdb

## Overview

##### Project type and purpose
- This is a single-page web application built with ASP.NET Core Blazor (WebAssembly) named “MoviesDB.”
- Its purpose is to deliver a client-side UI that lets users search, sort and page through a movie catalog stored in a SQLite database.

##### File structure
- Top-level
- Program.cs / MoviesDB.csproj – entry point & project definition for ASP.NET Core host + Blazor Wasm.
- wwwroot/ – static web assets (CSS/JS/Bootstrap, plus movies.db and other assets).
- Components/ – all Razor UI components (layouts, navigation, pages, routing).
- Data/ – MovieService.cs (data access layer).
- Models/ – Movie.cs (domain model).
- appsettings*.json – configuration for hosting environment.
- Build artifacts (bin/Debug/net9.0) include runtimes/browser-wasm/nativeassets/e_sqlite3 – you are shipping SQLite compiled to WebAssembly.

##### README for additional insights
- Describes a movie sorter with search, sort (title, date, rating), pagination – all driven client-side.
- Shows a simplified folder layout (Pages, Data, Models, wwwroot).
- No separate server-side API: data is fetched via the MovieService in the client.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Server Layer
    subgraph "Server (Static Host)"
        direction TB
        ProgramCS["Program.cs"]:::server
        CSProj["MoviesDB.csproj"]:::server
        AppSettings["appsettings.json\nappsettings.Development.json"]:::server
        LaunchSettings["Properties/launchSettings.json"]:::server
        subgraph "wwwroot (Static Assets)"
            direction TB
            Bootstrap["bootstrap (wwwroot/lib/bootstrap/dist/)"]:::assets
            SiteCSS["site.css"]:::assets
            MoviesDBFile["movies.db"]:::assets
        end
    end

    %% Client Layer
    subgraph "Browser (User Agent)"
        direction TB
        BlazorRuntime["Blazor WebAssembly Runtime"]:::runtime
        subgraph "UI Components"
            direction TB
            AppRazor["App.razor"]:::ui
            MainLayout["MainLayout.razor"]:::ui
            NavMenu["NavMenu.razor"]:::ui
            MoviesPage["Movies.razor"]:::ui
            ErrorPage["Error.razor"]:::ui
            Routes["Routes.razor"]:::ui
            Imports["_Imports.razor"]:::ui
        end
        MovieService["MovieService.cs"]:::service
        MovieModel["Movie.cs (DTO)"]:::model
        subgraph "SQLite (Wasm Native)"
            direction TB
            ESqlite3["e_sqlite3.a"]:::db
        end
        ClientDB["movies.db (Client Datastore)"]:::db
    end

    %% Relationships
    Server -->|"Serves HTML, DLLs, Static Assets"| BlazorRuntime
    BlazorRuntime -->|"Bootstraps UI"| AppRazor
    AppRazor --> MainLayout
    AppRazor --> Routes
    MainLayout --> NavMenu
    Routes --> MoviesPage
    Routes --> ErrorPage
    MoviesPage -->|"Injects"| MovieService
    MovieService --> ESqlite3
    ESqlite3 -->|"Opens/Queries"| ClientDB
    MovieService -->|"Returns Movie DTOs"| MovieModel
    MovieModel --> MoviesPage

    %% Click Events
    click ProgramCS "https://github.com/tharun52/moviesdb/blob/main/Program.cs"
    click CSProj "https://github.com/tharun52/moviesdb/blob/main/MoviesDB.csproj"
    click AppSettings "https://github.com/tharun52/moviesdb/blob/main/appsettings.json"
    click LaunchSettings "https://github.com/tharun52/moviesdb/blob/main/Properties/launchSettings.json"
    click Bootstrap "https://github.com/tharun52/moviesdb/tree/main/wwwroot/lib/bootstrap/dist/"
    click SiteCSS "https://github.com/tharun52/moviesdb/blob/main/wwwroot/css/site.css"
    click MoviesDBFile "https://github.com/tharun52/moviesdb/blob/main/wwwroot/movies.db"
    click AppRazor "https://github.com/tharun52/moviesdb/blob/main/Components/App.razor"
    click MainLayout "https://github.com/tharun52/moviesdb/blob/main/Components/Layout/MainLayout.razor"
    click NavMenu "https://github.com/tharun52/moviesdb/blob/main/Components/Layout/NavMenu.razor"
    click MoviesPage "https://github.com/tharun52/moviesdb/blob/main/Components/Pages/Movies.razor"
    click ErrorPage "https://github.com/tharun52/moviesdb/blob/main/Components/Pages/Error.razor"
    click Routes "https://github.com/tharun52/moviesdb/blob/main/Components/Routes.razor"
    click Imports "https://github.com/tharun52/moviesdb/blob/main/Components/_Imports.razor"
    click MovieService "https://github.com/tharun52/moviesdb/blob/main/Data/MovieService.cs"
    click MovieModel "https://github.com/tharun52/moviesdb/blob/main/Models/Movie.cs"
    click ESqlite3 "https://github.com/tharun52/moviesdb/blob/main/bin/Debug/net9.0/runtimes/browser-wasm/nativeassets/net9.0/e_sqlite3.a"

    %% Styles
    classDef server fill:#d9d9d9,stroke:#333,stroke-width:1px
    classDef assets fill:#f2f2f2,stroke:#333,stroke-width:1px
    classDef runtime fill:#cce5ff,stroke:#004085,stroke-width:1px
    classDef ui fill:#d4edda,stroke:#155724,stroke-width:1px
    classDef service fill:#fff3cd,stroke:#856404,stroke-width:1px
    classDef model fill:#e2e3e5,stroke:#6c757d,stroke-width:1px
    classDef db fill:#ffe5b4,stroke:#cc7a00,stroke-width:1px
```
