# dt0072/capstone-project architecture

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

- Interactive diagram: https://gitdiagram.com/dt0072/capstone-project
- Repository: https://github.com/dt0072/capstone-project

## Overview

##### Project type and purpose
- This is a single‐page application (SPA) built with Angular (v15), intended to run in the browser and be hosted on Firebase.
- The README indicates it uses the Angular CLI, runs locally via `ng serve`, builds to `dist/`, and is set up for Firebase deployment (`.firebaserc`, `firebase.json`).

##### File structure
- Top‐level config files:
- angular.json, tsconfig*.json: Angular build & compile configuration
- firebase.json, .firebaserc: Firebase hosting/deploy settings
- package.json / package‐lock.json: dependencies (Angular, Firebase SDK, etc.)
- src/app:
- A large collection of feature modules/components (e.g., attractions, eateries, bookings, cart, admin, user dashboards, login/register, searchbar, etc.)
- Shared services under src/app/shared (AuthenticationService, DataService)
- Domain models under src/app/model (att-data.ts, eat-data.ts, etc.)
- Business‐logic services at top‐level of src/app (booking.service.ts, cart.service.ts, searchbar.service.ts, plus an InMemoryDataService for local mock)
- app-routing.module.ts: defines client‐side routes
- app.module.ts: bootstraps the root NgModule
- src/environments: environment.ts / environment.development.ts for injecting Firebase config and other environment variables.
- assets: static assets (images, etc.).

##### README for additional insights
- The Angular CLI setup implies a classic component‐service layered front‐end.

##### Be detailed & capture essential elements
- Feature modules or group them logically (e.g., “Booking features,” “Cart features,” “Admin features”)
- Router module connecting components to URL paths

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Browser
    subgraph "User Browser"
        direction TB
        Browser["User Browser"]:::external
    end

    %% Presentation Layer
    subgraph "Presentation Layer (Components)"
        direction TB
        AppComponent["AppComponent"]:::frontend
        AttractionsComp["AttractionsComponent"]:::frontend
        EateriesComp["EateriesComponent"]:::frontend
        EventsComp["EventsComponent"]:::frontend
        BookingComp["BookingComponent"]:::frontend
        CartComp["CartComponent"]:::frontend
        AdminComp["AdminDashboardComponent"]:::frontend
    end

    %% Routing Layer
    subgraph "Routing Layer"
        direction TB
        AppRouting["AppRoutingModule"]:::routing
    end

    %% Service Layer
    subgraph "Service Layer"
        direction TB
        AuthService["AuthenticationService"]:::service
        DataService["DataService"]:::service
        BookingService["BookingService"]:::service
        CartService["CartService"]:::service
        SearchService["SearchBarService"]:::service
        InMemoryService["InMemoryDataService"]:::service
    end

    %% Domain Model Layer
    subgraph "Domain Model Layer"
        direction TB
        AttModel["AttData"]:::model
        EatModel["EatData"]:::model
        EventModel["EventData"]:::model
        BookModel["BookData"]:::model
        CartModel["CartData"]:::model
        UserModel["UserData"]:::model
    end

    %% Environment Configuration
    subgraph "Environment Config"
        direction TB
        EnvProd["environment.ts"]:::config
        EnvDev["environment.development.ts"]:::config
    end

    %% External Firebase Systems
    subgraph "Firebase Services"
        direction TB
        FirebaseAuth["Firebase Auth"]:::external
        Firestore["Firestore/Realtime DB"]:::external
        FirebaseHost["Firebase Hosting"]:::external
    end

    %% Deployment Config
    subgraph "Build & Deploy"
        direction TB
        AngularConf["angular.json"]:::config
        FirebaseConf["firebase.json/.firebaserc"]:::config
    end

    %% Connections
    Browser -->|navigates to| AppComponent
    AppComponent -->|uses| AppRouting

    AppRouting -->|routes to| AttractionsComp
    AppRouting -->|routes to| EateriesComp
    AppRouting -->|routes to| EventsComp
    AppRouting -->|routes to| BookingComp
    AppRouting -->|routes to| CartComp
    AppRouting -->|routes to| AdminComp

    AttractionsComp -->|calls| DataService
    EateriesComp -->|calls| DataService
    EventsComp -->|calls| DataService
    BookingComp -->|calls| BookingService
    BookingComp -->|calls| AuthService
    CartComp -->|calls| CartService
    CartComp -->|calls| AuthService
    AdminComp -->|calls| DataService

    DataService -->|HTTP / SDK| FirebaseAuth
    AuthService -->|SDK| FirebaseAuth
    DataService -->|HTTP / SDK| Firestore
    BookingService -->|HTTP / SDK| Firestore
    CartService -->|HTTP / SDK| Firestore
    SearchService -->|HTTP / SDK| Firestore

    DataService -->|uses| AttModel
    DataService -->|uses| EatModel
    DataService -->|uses| EventModel
    BookingService -->|uses| BookModel
    CartService -->|uses| CartModel
    AuthService -->|uses| UserModel

    EnvProd -->|injects config| AuthService
    EnvProd -->|injects config| DataService
    EnvDev -->|injects config| InMemoryService
    InMemoryService -.->|mocks| DataService

    AngularConf -->|build| FirebaseHost
    FirebaseConf -->|deploy| FirebaseHost
    AppComponent -->|served by| FirebaseHost

    %% Click Events
    click AppComponent "https://github.com/dt0072/capstone-project/blob/master/src/app/app.component.ts"
    click AppRouting "https://github.com/dt0072/capstone-project/blob/master/src/app/app-routing.module.ts"
    click AttractionsComp "https://github.com/dt0072/capstone-project/blob/master/src/app/attractions/attractions.component.ts"
    click EateriesComp "https://github.com/dt0072/capstone-project/blob/master/src/app/eateries/eateries.component.ts"
    click EventsComp "https://github.com/dt0072/capstone-project/blob/master/src/app/events/events.component.ts"
    click BookingComp "https://github.com/dt0072/capstone-project/blob/master/src/app/booking/booking.component.ts"
    click CartComp "https://github.com/dt0072/capstone-project/blob/master/src/app/cart/cart.component.ts"
    click AdminComp "https://github.com/dt0072/capstone-project/blob/master/src/app/admin-dashboard/admin-dashboard.component.ts"
    click AuthService "https://github.com/dt0072/capstone-project/blob/master/src/app/shared/authentication.service.ts"
    click DataService "https://github.com/dt0072/capstone-project/blob/master/src/app/shared/data.service.ts"
    click BookingService "https://github.com/dt0072/capstone-project/blob/master/src/app/booking.service.ts"
    click CartService "https://github.com/dt0072/capstone-project/blob/master/src/app/cart.service.ts"
    click SearchService "https://github.com/dt0072/capstone-project/blob/master/src/app/searchbar.service.ts"
    click InMemoryService "https://github.com/dt0072/capstone-project/blob/master/src/app/in-memory-data.service.ts"
    click AttModel "https://github.com/dt0072/capstone-project/blob/master/src/app/model/att-data.ts"
    click EatModel "https://github.com/dt0072/capstone-project/blob/master/src/app/model/eat-data.ts"
    click EventModel "https://github.com/dt0072/capstone-project/blob/master/src/app/model/event-data.ts"
    click BookModel "https://github.com/dt0072/capstone-project/blob/master/src/app/model/book-data.ts"
    click CartModel "https://github.com/dt0072/capstone-project/blob/master/src/app/model/cart-data.ts"
    click UserModel "https://github.com/dt0072/capstone-project/blob/master/src/app/model/user-data.ts"
    click EnvProd "https://github.com/dt0072/capstone-project/blob/master/src/environments/environment.ts"
    click EnvDev "https://github.com/dt0072/capstone-project/blob/master/src/environments/environment.development.ts"
    click AngularConf "https://github.com/dt0072/capstone-project/blob/master/angular.json"
    click FirebaseConf "https://github.com/dt0072/capstone-project/blob/master/firebase.json"

    %% Styles
    classDef frontend fill:#D0E8FF,stroke:#0366d6,color:#0366d6
    classDef routing fill:#E8F4D0,stroke:#6A983C,color:#6A983C
    classDef service fill:#DFFFE0,stroke:#50A14F,color:#50A14F
    classDef model fill:#FFF4D0,stroke:#D97706,color:#B45309
    classDef external fill:#FFE4D0,stroke:#D64500,color:#CB2431
    classDef config fill:#F0F0F0,stroke:#6A737D,color:#6A737D
```
