# fahad-011/bookmyshow-clone architecture

> Architecture diagram of the GitHub repository fahad-011/bookmyshow-clone, 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/fahad-011/bookmyshow-clone
- Repository: https://github.com/fahad-011/bookmyshow-clone

## Overview

##### Project type and purpose
- This is a single-page application (SPA) built in React that clones the BookMyShow front-end experience.
- It has no custom backend code in the repo; instead it relies on third-party APIs (TheMovieDB, Google OAuth, Razorpay, OpenCage) and is hosted as a static site (Netlify).

##### File structure
- Top level:
- public/ – static HTML, manifest, robots.txt
- src/ – React source
- netlify.toml – deployment configuration
- package.json / package-lock.json
- src/ breakdown:
- src/index.js + src/index.css – app entry, global CSS (Tailwind)
- src/App.js – root component with Router setup
- src/context/Movie.context.jsx – Context provider for global movie state
- src/layout/… – layout wrappers (Default.layout, Movie.layout)
- src/pages/… – routed pages (Home, Movie, Play, 404)
- src/components/… – feature-based components (Navbar, HeroCarousel, PosterSlider, MovieHero, Cast, Modal, PaymentModel, Loader, Footer, etc.)

##### README for insights
- Key features: Home page with carousel, Movie page with details and booking flow, Event and Order pages.
- Technical stack: React, React Router, Axios, React Slick, headlessui/react, react-oauth/google, Razorpay SDK, OpenCage geolocation, Tailwind CSS.
- Environment variables for API keys.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User and Hosting Layer
    UserBrowser["User Browser"]:::external
    NetlifyCDN["Netlify CDN"]:::hosting
    UserBrowser -->|"requests bundle"| NetlifyCDN
    NetlifyCDN -->|"serves static bundle"| UserBrowser

    %% Frontend Application Layer
    subgraph "Frontend Application" 
        direction TB
        Entry["index.js & index.css"]:::frontend
        App["App.js (Router Setup)"]:::frontend
        Context["Movie.context.jsx (Context API)"]:::frontend
        subgraph "Layout Wrappers"
            direction TB
            DefaultLayout["Default.layout.jsx"]:::frontend
            MovieLayout["Movie.layout.jsx"]:::frontend
        end
        subgraph "Page Components (Routes)"
            direction TB
            HomePage["Home.Page.jsx"]:::frontend
            MoviePage["Movie.Page.jsx"]:::frontend
            PlayPage["Play.Page.jsx"]:::frontend
            NotFoundPage["404.jsx"]:::frontend
        end
        subgraph "UI Components"
            direction TB
            subgraph "Navbar"
                Navbar["Navbar.Component.jsx"]:::frontend
                MovieNavbar["MovieNavbar.Component.jsx"]:::frontend
            end
            subgraph "Hero Carousel"
                HeroCarousel["HeroCarousel.Component.jsx"]:::frontend
                CarouselArrows["Arrows.Component.jsx"]:::frontend
            end
            Poster["Poster.Component.jsx"]:::frontend
            PosterSlider["PosterSlider.Component.jsx"]:::frontend
            MovieHero["MovieHero.Component.jsx"]:::frontend
            MovieInfo["MovieInfo.Component.jsx"]:::frontend
            Cast["Cast.Component.jsx"]:::frontend
            EntertainmentCard["EntertainmentCard.Component.jsx"]:::frontend
            LoaderComp["Loader.jsx & Loader.css"]:::frontend
            ModalComp["Modal.Component.jsx"]:::frontend
            PaymentModal["Payment.Component.jsx"]:::frontend
            Footer["Footer.Component.jsx"]:::frontend
        end
    end

    %% Application Flow
    UserBrowser -->|"loads bundle"| Entry
    Entry --> App
    App --> Context
    App --> DefaultLayout
    App --> MovieLayout
    App --> HomePage
    App --> MoviePage
    App --> PlayPage
    App --> NotFoundPage

    HomePage --> Navbar
    HomePage --> HeroCarousel
    HomePage --> PosterSlider
    HomePage --> Footer

    MoviePage --> MovieNavbar
    MoviePage --> MovieHero
    MoviePage --> MovieInfo
    MoviePage --> Cast
    MoviePage --> PosterSlider
    MoviePage --> Footer

    PlayPage --> Navbar
    PlayPage --> EntertainmentCard
    PlayPage --> Footer

    DefaultLayout -->|wraps| UIComponents["UI Components"]:::frontend

    %% Context and Data Flow
    Context -->|provides state| HomePage
    Context -->|provides state| MoviePage
    Context -->|provides state| PlayPage

    %% External Services Layer
    subgraph "External APIs & Integrations"
        direction TB
        TheMovieDB["TheMovieDB API"]:::external
        GoogleOAuth["Google OAuth"]:::external
        Razorpay["Razorpay API"]:::external
        OpenCage["OpenCage API"]:::external
    end

    %% API Calls
    Context -->|"fetch movies"| TheMovieDB
    HeroCarousel -->|"fetch carousel data"| TheMovieDB
    PosterSlider -->|"fetch posters"| TheMovieDB
    MovieHero -->|"fetch details"| TheMovieDB
    MovieInfo -->|"fetch details"| TheMovieDB

    ModalComp -->|"location lookup"| OpenCage
    Context -->|"location lookup"| OpenCage

    ModalComp -->|"authentication"| GoogleOAuth
    App -->|"login flow"| GoogleOAuth

    PaymentModal -->|"process payment"| Razorpay

    %% Hosting Interaction
    NetlifyCDN -->|deploys| Entry

    %% Click Events
    click Entry "https://github.com/fahad-011/bookmyshow-clone/blob/main/src/index.js"
    click Entry "https://github.com/fahad-011/bookmyshow-clone/blob/main/src/index.css"
    click App "https://github.com/fahad-011/bookmyshow-clone/blob/main/src/App.js"
    click Context "https://github.com/fahad-011/bookmyshow-clone/blob/main/src/context/Movie.context.jsx"
    click DefaultLayout "https://github.com/fahad-011/bookmyshow-clone/blob/main/src/layout/Default.layout.jsx"
    click MovieLayout "https://github.com/fahad-011/bookmyshow-clone/blob/main/src/layout/Movie.layout.jsx"
    click HomePage "https://github.com/fahad-011/bookmyshow-clone/blob/main/src/pages/Home.Page.jsx"
    click MoviePage "https://github.com/fahad-011/bookmyshow-clone/blob/main/src/pages/Movie.Page.jsx"
    click PlayPage "https://github.com/fahad-011/bookmyshow-clone/blob/main/src/pages/Play.Page.jsx"
    click NotFoundPage "https://github.com/fahad-011/bookmyshow-clone/blob/main/src/pages/404.jsx"
    click Navbar "https://github.com/fahad-011/bookmyshow-clone/blob/main/src/components/Navbar/Navbar.Component.jsx"
    click MovieNavbar "https://github.com/fahad-011/bookmyshow-clone/blob/main/src/components/Navbar/MovieNavbar.Component.jsx"
    click HeroCarousel "https://github.com/fahad-011/bookmyshow-clone/blob/main/src/components/HeroCarousel/HeroCarousel.Component.jsx"
    click CarouselArrows "https://github.com/fahad-011/bookmyshow-clone/blob/main/src/components/HeroCarousel/Arrows.Component.jsx"
    click Poster "https://github.com/fahad-011/bookmyshow-clone/blob/main/src/components/Poster/Poster.Component.jsx"
    click PosterSlider "https://github.com/fahad-011/bookmyshow-clone/blob/main/src/components/PosterSlider/PosterSlider.Component.jsx"
    click MovieHero "https://github.com/fahad-011/bookmyshow-clone/blob/main/src/components/MovieHero/MovieHero.Component.jsx"
    click MovieInfo "https://github.com/fahad-011/bookmyshow-clone/blob/main/src/components/MovieHero/MovieInfo.Component.jsx"
    click Cast "https://github.com/fahad-011/bookmyshow-clone/blob/main/src/components/Cast/Cast.Component.jsx"
    click EntertainmentCard "https://github.com/fahad-011/bookmyshow-clone/blob/main/src/components/Entertainment/EntertainmentCard.Component.jsx"
    click LoaderComp "https://github.com/fahad-011/bookmyshow-clone/blob/main/src/components/Loader/Loader.jsx"
    click LoaderComp "https://github.com/fahad-011/bookmyshow-clone/blob/main/src/components/Loader/Loader.css"
    click ModalComp "https://github.com/fahad-011/bookmyshow-clone/blob/main/src/components/Modal/Modal.Component.jsx"
    click PaymentModal "https://github.com/fahad-011/bookmyshow-clone/blob/main/src/components/PaymentModel/Payment.Component.jsx"
    click Footer "https://github.com/fahad-011/bookmyshow-clone/blob/main/src/components/Footer/Footer.Component.jsx"
    click NetlifyCDN "https://github.com/fahad-011/bookmyshow-clone/blob/main/netlify.toml"

    %% Styles
    classDef frontend fill:#cce5ff,stroke:#333,stroke-width:1px
    classDef external fill:#d4edda,stroke:#333,stroke-width:1px
    classDef hosting fill:#e2e3e5,stroke:#333,stroke-width:1px
```
