# coachemmy/movieers architecture

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

- Interactive diagram: https://gitdiagram.com/coachemmy/movieers
- Repository: https://github.com/coachemmy/movieers

## Overview

##### Project type and purpose
- Movieers is a full-stack web application:
- Frontend: React single-page app (SPA) with internationalization (i18n) and Tailwind CSS.
- Backend: Node.js/Express server that serves the SPA, provides a REST API, and manages an SQLite database.
- Database: SQLite (movieers.db) for storing user movie lists and any persisted data.
- External Services: Likely a third-party movie data API used by src/services/api.js for movie searches and popular movie data.

##### File structure
- Top-level:
- public & dist: Static assets and production build of the frontend (dist contains final index.html, robots.txt).
- src: React source code—App.js mounts the SPA; components/ holds UI pieces; pages/ holds route targets; context/ for state management; services/ for API calls; i18n.js for localization.
- server.js & database.js: Express server entry point and database connection/initialization logic (auto-creates schema on startup).
- Configuration files: package.json, tailwind.config.js, postcss.config.js.
- Patterns:
- SPA served by Express.
- React Context for global state (movie list).
- REST endpoints in server.js interacting with the SQLite database.

##### README for additional insights
- Confirms that starting the server auto-creates the SQLite schema.
- Usage instructions imply a single process runs both the API and static file server.

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "Client (Browser)"
        A1["SPA Entry Point\nsrc/index.js"]:::frontend
        A2["SPA Root Component\nsrc/App.js"]:::frontend
        A3["UI Components\nsrc/components/"]:::frontend
        A4["Page Routes\nsrc/pages/"]:::frontend
        A5["Global State\nsrc/context/MovieListContext.js"]:::frontend
        A6["i18n Setup\nsrc/i18n.js"]:::frontend
        A7["Locales\npublic/locales/"]:::frontend
        F1["Tailwind Config\ntailwind.config.js"]:::frontend
        F2["PostCSS Config\npostcss.config.js"]:::frontend
        F3["Global Styles\nsrc/index.css"]:::frontend
        A9["Movie API Service\nsrc/services/api.js"]:::frontend
        E1["Production Build\n/dist"]:::frontend
    end

    subgraph "Server (Express)"
        B1["Express Server\nserver.js"]:::backend
        B2["Database Init\ndatabase.js"]:::backend
    end

    subgraph "Database"
        C1["SQLite DB\nmovieers.db"]:::db
    end

    subgraph "External Service"
        D1["External Movie API"]:::external
    end

    %% Client internal flow
    A1 --> A2
    A2 --> A3
    A2 --> A4
    A2 --> A5
    A2 --> A6
    A2 --> A9
    A6 --> A7
    F3 --> F1
    F3 --> F2
    A1 --> F3

    %% Client ↔ Server
    A1 -->|"GET / (static)"| B1
    B1 -->|"Serves dist files"| E1
    A9 -->|"REST API calls"| B1

    %% Server internals
    B1 -->|"DB operations"| B2
    B2 -->|"SQL Queries"| C1
    B1 -->|"Fetch movie data"| D1
    D1 -->|"API response"| B1

    %% Context consumption
    A5 -->|"Uses API service"| A9

    %% Click Events
    click A1 "https://github.com/coachemmy/movieers/blob/master/src/index.js"
    click A2 "https://github.com/coachemmy/movieers/blob/master/src/App.js"
    click A3 "https://github.com/coachemmy/movieers/tree/master/src/components/"
    click A4 "https://github.com/coachemmy/movieers/tree/master/src/pages/"
    click A5 "https://github.com/coachemmy/movieers/blob/master/src/context/MovieListContext.js"
    click A6 "https://github.com/coachemmy/movieers/blob/master/src/i18n.js"
    click A7 "https://github.com/coachemmy/movieers/tree/master/public/locales/"
    click F1 "https://github.com/coachemmy/movieers/blob/master/tailwind.config.js"
    click F2 "https://github.com/coachemmy/movieers/blob/master/postcss.config.js"
    click F3 "https://github.com/coachemmy/movieers/blob/master/src/index.css"
    click A9 "https://github.com/coachemmy/movieers/blob/master/src/services/api.js"
    click B1 "https://github.com/coachemmy/movieers/blob/master/server.js"
    click B2 "https://github.com/coachemmy/movieers/blob/master/database.js"
    click E1 "https://github.com/coachemmy/movieers/tree/master/dist/"

    %% Styles
    classDef frontend fill:#E8F0FE,stroke:#4A90E2,color:#000
    classDef backend fill:#FDEBD0,stroke:#E67E22,color:#000
    classDef db fill:#D5F5E3,stroke:#27AE60,color:#000
    classDef external fill:#F5EEF8,stroke:#8E44AD,color:#000
```
