# duvsr01/cmpe-281-drone-cloud-project architecture

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

- Interactive diagram: https://gitdiagram.com/duvsr01/cmpe-281-drone-cloud-project
- Repository: https://github.com/duvsr01/cmpe-281-drone-cloud-project

## Overview

##### Project Type and Purpose
- Full-stack web application for Agriculture Drone Platform.
- Purpose: offer cloud services—drone catalog, service booking, real-time tracking, billing, and an admin/user dashboard.

##### File Structure
- Top-level:
- backend/ – Node.js + Express REST API
- frontend/ – React + Redux SPA
- backend/config – database (MongoDB via Mongoose, MySQL via SQL driver) and credentials.
- backend/models – MongoDB data models (e.g., tracking).
- backend/routes/cmpe281 – REST endpoints by service (Agriculture, Booking, Billing, Drone, Order, Tracking, User, Dashboard).
- frontend/src – React components by domain (Account, BookingService, Customer, Dashboard, Home, Orders, Tracking, admin, appEntry, navBar), Redux actions & reducers, global store.
- Deployment-related: AWS config implied in README (EC2, auto-scaling, load-balancer, CloudWatch).

##### README for Additional Insights
- Frontend uses React, Redux, Firebase Authentication, Google Maps APIs.
- Backend uses Express, Mongoose (MongoDB), MySQL (AWS RDS).
- Data Storage: AWS RDS MySQL, AWS MongoDB, AWS S3.
- Deployed on AWS EC2 instances behind an Auto Scaling group & Load Balancer; monitored by CloudWatch.

##### Detail
- Which datastore each module uses.
- Object flow for a use case (e.g., user books drone → BookingService → MySQL write → response to UI).
- Authentication flow (token issuance, verification).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend Layer
    subgraph "Frontend (React SPA)"
        Browser["React SPA"]:::frontend
        subgraph "UI Components"
            NavBar["NavBar"]:::frontend
            LandingPage["LandingPage"]:::frontend
            Login["Login"]:::frontend
            AccountComp["Account Component"]:::frontend
            BookingReq["ReviewServiceRequests"]:::frontend
            CustomerComp["Customer UI Components"]:::frontend
            OrdersComp["Orders Components"]:::frontend
            TrackingComp["Tracking UI Components"]:::frontend
            AdminComp["Admin Dashboard Components"]:::frontend
            DashboardMap["DashboardMap"]:::frontend
        end
        subgraph "State Management"
            ReduxStore["Redux Store"]:::state
            ReduxState["Redux State"]:::state
        end
    end

    %% AWS Infrastructure
    ELB["AWS ELB"]:::backend
    subgraph "AWS Auto Scaling Group"
        APIServer["Node.js API"]:::backend
    end

    %% Backend Layer
    subgraph "Backend Services (Express)"
        subgraph "Domain Services"
            AgrSvc["AgricultureService"]:::backend
            BookSvc["BookingService"]:::backend
            BillSvc["BillingService"]:::backend
            DroneSvc["DroneService"]:::backend
            OrderSvc["OrderService"]:::backend
            TrackSvc["TrackingService"]:::backend
            UserSvc["UserService"]:::backend
            DashSvc["DashboardService"]:::backend
        end
        Config["Config (keys & connections)"]:::backend
        ModelTrack["Tracking Model"]:::backend
    end

    %% Datastores
    subgraph "Datastore"
        MySQL["MySQL RDS"]:::db
        MongoDB["MongoDB (DocumentDB)"]:::db
        S3["AWS S3"]:::db
    end

    %% External Services
    subgraph "External Services"
        Firebase["Firebase Auth"]:::ext
        GMaps["Google Maps API"]:::ext
    end

    %% Monitoring
    CloudWatch["AWS CloudWatch"]:::monitor

    %% Connections
    Browser -->|"HTTPS requests/API calls"| ELB
    ELB --> APIServer
    APIServer --> AgrSvc
    APIServer --> BookSvc
    APIServer --> BillSvc
    APIServer --> DroneSvc
    APIServer --> OrderSvc
    APIServer --> TrackSvc
    APIServer --> UserSvc
    APIServer --> DashSvc
    APIServer --> Config
    APIServer --> ModelTrack
    AgrSvc --> MySQL
    BookSvc --> MySQL
    BillSvc --> MySQL
    OrderSvc --> MySQL
    DroneSvc --> MongoDB
    TrackSvc --> MongoDB
    UserSvc --> MongoDB
    DashSvc --> MongoDB
    APIServer --> S3
    Browser --> Firebase
    APIServer --> Firebase
    Browser --> GMaps
    APIServer --> CloudWatch
    ELB --> CloudWatch

    Browser --> ReduxStore
    ReduxStore --> ReduxState
    ReduxStore --> NavBar
    ReduxStore --> LandingPage
    ReduxStore --> Login
    ReduxStore --> AccountComp
    ReduxStore --> BookingReq
    ReduxStore --> CustomerComp
    ReduxStore --> OrdersComp
    ReduxStore --> TrackingComp
    ReduxStore --> AdminComp
    ReduxStore --> DashboardMap

    %% Click Events
    click Browser "https://github.com/duvsr01/cmpe-281-drone-cloud-project/tree/Prod/frontend/src"
    click ReduxStore "https://github.com/duvsr01/cmpe-281-drone-cloud-project/blob/Prod/frontend/src/store/store.js"
    click ReduxState "https://github.com/duvsr01/cmpe-281-drone-cloud-project/blob/Prod/frontend/src/store/state.js"
    click Login "https://github.com/duvsr01/cmpe-281-drone-cloud-project/blob/Prod/frontend/src/components/appEntry/Login.jsx"
    click LandingPage "https://github.com/duvsr01/cmpe-281-drone-cloud-project/blob/Prod/frontend/src/components/appEntry/LandingPage.jsx"
    click DashboardMap "https://github.com/duvsr01/cmpe-281-drone-cloud-project/blob/Prod/frontend/src/components/Dashboard/DashboardMap.jsx"
    click NavBar "https://github.com/duvsr01/cmpe-281-drone-cloud-project/blob/Prod/frontend/src/components/navBar/NavBar.jsx"
    click AccountComp "https://github.com/duvsr01/cmpe-281-drone-cloud-project/blob/Prod/frontend/src/components/Account/Account.jsx"
    click BookingReq "https://github.com/duvsr01/cmpe-281-drone-cloud-project/blob/Prod/frontend/src/components/BookingService/ReviewServiceRequests.jsx"
    click CustomerComp "https://github.com/duvsr01/cmpe-281-drone-cloud-project/tree/Prod/frontend/src/components/Customer"
    click OrdersComp "https://github.com/duvsr01/cmpe-281-drone-cloud-project/tree/Prod/frontend/src/components/Orders"
    click TrackingComp "https://github.com/duvsr01/cmpe-281-drone-cloud-project/tree/Prod/frontend/src/components/Tracking"
    click AdminComp "https://github.com/duvsr01/cmpe-281-drone-cloud-project/tree/Prod/frontend/src/components/admin"
    click APIServer "https://github.com/duvsr01/cmpe-281-drone-cloud-project/blob/Prod/backend/index.js"
    click Config "https://github.com/duvsr01/cmpe-281-drone-cloud-project/blob/Prod/backend/config/keys.js"
    click Config "https://github.com/duvsr01/cmpe-281-drone-cloud-project/blob/Prod/backend/config/mongoConnection.js"
    click Config "https://github.com/duvsr01/cmpe-281-drone-cloud-project/blob/Prod/backend/config/sqlConnection.js"
    click ModelTrack "https://github.com/duvsr01/cmpe-281-drone-cloud-project/blob/Prod/backend/models/tracking.js"
    click AgrSvc "https://github.com/duvsr01/cmpe-281-drone-cloud-project/blob/Prod/backend/routes/cmpe281/AgricultureService.js"
    click BookSvc "https://github.com/duvsr01/cmpe-281-drone-cloud-project/blob/Prod/backend/routes/cmpe281/BookingService.js"
    click BillSvc "https://github.com/duvsr01/cmpe-281-drone-cloud-project/blob/Prod/backend/routes/cmpe281/BillingService.js"
    click DroneSvc "https://github.com/duvsr01/cmpe-281-drone-cloud-project/blob/Prod/backend/routes/cmpe281/DroneService.js"
    click OrderSvc "https://github.com/duvsr01/cmpe-281-drone-cloud-project/blob/Prod/backend/routes/cmpe281/OrderService.js"
    click TrackSvc "https://github.com/duvsr01/cmpe-281-drone-cloud-project/blob/Prod/backend/routes/cmpe281/TrackingService.js"
    click UserSvc "https://github.com/duvsr01/cmpe-281-drone-cloud-project/blob/Prod/backend/routes/cmpe281/UserService.js"
    click DashSvc "https://github.com/duvsr01/cmpe-281-drone-cloud-project/blob/Prod/backend/routes/cmpe281/DashboardService.js"

    %% Styles
    classDef frontend fill:#AEDFF7,stroke:#333,stroke-width:1px
    classDef backend fill:#A1D99B,stroke:#333,stroke-width:1px
    classDef db fill:#FDBE74,stroke:#333,stroke-width:1px
    classDef ext fill:#D3D3D3,stroke:#333,stroke-width:1px
    classDef monitor fill:#FDE047,stroke:#333,stroke-width:1px
    classDef state fill:#B2B2FF,stroke:#333,stroke-width:1px
```
