# jeremylhomme/cinephoria-cinema-app architecture

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

- Interactive diagram: https://gitdiagram.com/jeremylhomme/cinephoria-cinema-app
- Repository: https://github.com/jeremylhomme/cinephoria-cinema-app

## Overview

##### High-Level Architecture Overview

a. Client Applications Layer:
- Web Application (React)
- Mobile Application (React Native)
- Desktop Application (Electron)

b. Backend Services Layer:
- Node.js API Server
- Authentication Services
- Email Services

c. Data Layer:
- MySQL Database (for structured data)
- MongoDB (for specific features)
- Prisma ORM

##### Component Breakdown

For each application, highlight these key components:

Web Application:
- Frontend Components (React)
- Visitor Area (Movies, Sessions, Cart)
- User Area (Profile, Orders, Reviews)
- Employee Area (Movie/Session Management)
- Admin Area (Cinema/User Management)
- Backend Services
- Controllers (User, Booking, Movie, etc.)
- Routes
- Middleware (Auth, Async Handler)

Mobile Application:
- Core Components
- Redux Store
- API Integration
- Authentication

Desktop Application:
- Main Process
- Renderer Process
- IPC Communication
- Redux Store

##### Key Relationships to Highlight

- Frontend-Backend Communication:
- REST API calls
- Authentication flow
- Real-time updates

- Data Flow:
- User authentication
- Booking process
- Content management
- Review system

##### Technical Stack Indicators

Technology badges for:
- React/React Native
- Node.js
- Electron
- Redux
- Prisma
- MySQL
- MongoDB
- Docker

##### Security Layer

Highlight:
- JWT Authentication
- Middleware protection
- Role-based access control
- API security

##### Integration Points

Connections with:
- Payment processing
- Email service
- Media storage
- External APIs

##### Deployment Architecture

Include:
- Docker containers
- Development environment
- Production environment
- Testing environment

Remember to:
- Keep components grouped logically
- Clear data flow directions
- Version/environment indicators
- Document API endpoints groups
- Scaling points

This will provide a clear understanding of the system's architecture while maintaining the right level of detail for a principal software engineer to understand both the big picture and the critical technical implementations.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Style Definitions
    classDef frontend fill:#3498db,stroke:#2980b9,color:white
    classDef backend fill:#2ecc71,stroke:#27ae60,color:white
    classDef database fill:#f1c40f,stroke:#f39c12,color:black
    classDef security fill:#e74c3c,stroke:#c0392b,color:white
    classDef service fill:#9b59b6,stroke:#8e44ad,color:white

    %% Client Applications Layer
    subgraph ClientLayer
        WA["Web Application\n(React)"]
        MA["Mobile Application\n(React Native)"]
        DA["Desktop Application\n(Electron)"]
        
        %% Redux Stores
        WebRedux["Redux Store"]
        MobileRedux["Redux Store"]
        DesktopRedux["Redux Store"]
    end

    %% Frontend Components
    subgraph FrontendComponents
        VisitorArea["Visitor Area"]
        UserArea["User Area"]
        EmployeeArea["Employee Area"]
        AdminArea["Admin Area"]
    end

    %% Backend Services Layer
    subgraph BackendLayer
        API["Node.js API Server"]
        AuthService["Authentication Service"]
        EmailService["Email Service"]
        
        %% Controllers
        Controllers["Controllers Layer"]
        Routes["API Routes"]
        Middleware["Middleware"]
    end

    %% Data Layer
    subgraph DataLayer
        MySQL[(MySQL Database)]
        MongoDB[(MongoDB)]
        PrismaORM["Prisma ORM"]
    end

    %% External Services
    subgraph ExternalServices
        Payment["Payment Processing"]
        MediaStorage["Media Storage"]
        ExternalAPIs["External APIs"]
    end

    %% Relationships
    WA --> WebRedux
    MA --> MobileRedux
    DA --> DesktopRedux
    
    WebRedux --> API
    MobileRedux --> API
    DesktopRedux --> API
    
    API --> Controllers
    Controllers --> Routes
    Routes --> Middleware
    
    Middleware --> AuthService
    AuthService --> PrismaORM
    
    Controllers --> EmailService
    Controllers --> PrismaORM
    
    PrismaORM --> MySQL
    PrismaORM --> MongoDB
    
    API --> ExternalServices

    %% Click Events
    click WA "https://github.com/jeremylhomme/cinephoria-cinema-app/tree/main/web-app/frontend/src/"
    click MA "https://github.com/jeremylhomme/cinephoria-cinema-app/tree/main/mobile-app/"
    click DA "https://github.com/jeremylhomme/cinephoria-cinema-app/tree/main/desktop-app/src/"
    click API "https://github.com/jeremylhomme/cinephoria-cinema-app/blob/main/web-app/backend/server.js"
    click AuthService "https://github.com/jeremylhomme/cinephoria-cinema-app/blob/main/web-app/backend/middlewares/authMiddleware.js"
    click EmailService "https://github.com/jeremylhomme/cinephoria-cinema-app/blob/main/web-app/backend/utils/sendEmail.js"
    click MySQL "https://github.com/jeremylhomme/cinephoria-cinema-app/blob/main/web-app/sql/create_database.sql"
    click PrismaORM "https://github.com/jeremylhomme/cinephoria-cinema-app/blob/main/web-app/prisma/schema.prisma"
    click Controllers "https://github.com/jeremylhomme/cinephoria-cinema-app/tree/main/web-app/backend/controllers/"
    click Routes "https://github.com/jeremylhomme/cinephoria-cinema-app/tree/main/web-app/backend/routes/"
    click WebRedux "https://github.com/jeremylhomme/cinephoria-cinema-app/tree/main/web-app/frontend/src/redux/"
    click MobileRedux "https://github.com/jeremylhomme/cinephoria-cinema-app/tree/main/mobile-app/redux/"
    click DesktopRedux "https://github.com/jeremylhomme/cinephoria-cinema-app/tree/main/desktop-app/src/redux/"

    %% Styling
    class WA,MA,DA,WebRedux,MobileRedux,DesktopRedux,VisitorArea,UserArea,EmployeeArea,AdminArea frontend
    class API,Controllers,Routes,Middleware backend
    class MySQL,MongoDB,PrismaORM database
    class AuthService security
    class EmailService,Payment,MediaStorage,ExternalAPIs service

    %% Legend
    subgraph Legend
        Frontend["Frontend Component"]:::frontend
        Backend["Backend Service"]:::backend
        DB["Database"]:::database
        Security["Security Component"]:::security
        Service["External Service"]:::service
    end
```
