# amoghphadnis/quickswift architecture

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

- Interactive diagram: https://gitdiagram.com/amoghphadnis/quickswift
- Repository: https://github.com/amoghphadnis/quickswift

## Overview

##### Project type and purpose
- This is a full-stack web application implementing a multi-role food-delivery/order system.
- The front end is a React single-page app (client/), the back end is a Node/Express server exposing both REST routes and a GraphQL API (server/), and it persists data in a database (server/model/database.js). Authentication is handled via Firebase, and payment via PayPal.

##### File structure
- Top level:
- client/ – React app, organized by feature (components/, redux/, pages/)
- server/ – Node/Express app with:
– controllers/ & routes/ (REST endpoints)
– graphql/schemas & resolvers (GraphQL)
– firebase/ (Auth config)
– paypal/ (payment integration)
– middleware/ (token verification)
– model/ (data models + DB connection)
- Bundler/config: webpack.config.js, .env files
- Deployment/build scripts in package.json

##### Diagramming conventions
- From Browser → REST/GraphQL endpoints (annotate “HTTP/HTTPS”)
- From API → Database (annotate “mongoose queries”)
- From Auth middleware → Firebase (annotate “verify JWT”)
- From PayPal client → PayPal API (annotate “payment request”)
- Purple clouds for external services

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Frontend Layer"
        ReactSPA["React SPA"]:::client
        Redux["Redux Store"]:::client
        CartSlice["Cart Slice"]:::client
        ProductsSlice["Products Slice"]:::client
        Context["User Context (Context API)"]:::client
        AdminUI["Admin UI Module"]:::client
        BusinessUI["Business UI Module"]:::client
        DriverUI["Driver UI Module"]:::client
        CustomerUI["Customer UI Module"]:::client
        ConfigClient["Webpack Config & .env"]:::client
        Assets["Public Static Assets"]:::client
    end

    subgraph "Backend Layer"
        RESTAPI["Express REST API"]:::backend
        Routes["REST Routes"]:::backend
        Controllers["Controllers"]:::backend
        GraphQLAPI["GraphQL Server"]:::backend
        Schema["GraphQL Schema"]:::backend
        Resolvers["GraphQL Resolvers"]:::backend
        AuthMiddleware["Auth Middleware"]:::backend
        FirebaseAuth["Firebase Auth Integration"]:::backend
        PayPalClient["PayPal Payment Integration"]:::backend
        DataAccess["Data Models (Mongoose)"]:::backend
        DBConn["Database Connection"]:::backend
        ConfigServer[".env Configuration"]:::backend
    end

    DB["MongoDB"]:::db

    subgraph "External Services"
        Firebase["Firebase Auth"]:::external
        PayPal["PayPal API"]:::external
        GoogleMaps["Google Maps API"]:::external
    end

    ReactSPA -->|uses| Redux
    Redux --> CartSlice
    Redux --> ProductsSlice
    ReactSPA -->|uses| Context
    ReactSPA --> AdminUI
    ReactSPA --> BusinessUI
    ReactSPA --> DriverUI
    ReactSPA --> CustomerUI
    ReactSPA -->|HTTP/HTTPS| RESTAPI
    ReactSPA -->|HTTP/HTTPS| GraphQLAPI

    RESTAPI --> Routes
    Routes --> Controllers
    RESTAPI --> AuthMiddleware
    Controllers --> DataAccess
    GraphQLAPI --> Schema
    Schema --> Resolvers
    Resolvers --> DataAccess
    GraphQLAPI --> AuthMiddleware
    AuthMiddleware --> Firebase
    DataAccess --> DBConn
    DBConn --> DB
    RESTAPI --> ConfigServer
    GraphQLAPI --> ConfigServer
    PayPalClient --> PayPal
    Controllers -.->|invokes| PayPalClient
    ConfigClient --> ReactSPA

    classDef client fill:#cceeff,stroke:#007acc
    classDef backend fill:#e0ffe0,stroke:#008000
    classDef db fill:#ffddaa,stroke:#ee7600
    classDef external fill:#f3e5ff,stroke:#a020f0

    click ReactSPA "https://github.com/amoghphadnis/quickswift/blob/main/client/src/index.js"
    click Redux "https://github.com/amoghphadnis/quickswift/blob/main/client/src/redux/store.js"
    click CartSlice "https://github.com/amoghphadnis/quickswift/blob/main/client/src/redux/cartSlice.js"
    click ProductsSlice "https://github.com/amoghphadnis/quickswift/blob/main/client/src/redux/productsSlice.js"
    click Context "https://github.com/amoghphadnis/quickswift/blob/main/client/src/components/context/UserContext.js"
    click AdminUI "https://github.com/amoghphadnis/quickswift/tree/main/client/src/components/Admin/"
    click BusinessUI "https://github.com/amoghphadnis/quickswift/tree/main/client/src/components/Business/"
    click DriverUI "https://github.com/amoghphadnis/quickswift/tree/main/client/src/components/Driver/"
    click CustomerUI "https://github.com/amoghphadnis/quickswift/tree/main/client/src/components/customer/"
    click ConfigClient "https://github.com/amoghphadnis/quickswift/blob/main/client/webpack.config.js"
    click Assets "https://github.com/amoghphadnis/quickswift/blob/main/client/public/index.html"
    click RESTAPI "https://github.com/amoghphadnis/quickswift/blob/main/server/server.js"
    click Routes "https://github.com/amoghphadnis/quickswift/blob/main/server/routes/products.js"
    click Controllers "https://github.com/amoghphadnis/quickswift/blob/main/server/controllers/products.js"
    click Schema "https://github.com/amoghphadnis/quickswift/blob/main/server/graphql/schemas/schema.graphql"
    click Resolvers "https://github.com/amoghphadnis/quickswift/blob/main/server/graphql/resolvers/resolver.js"
    click AuthMiddleware "https://github.com/amoghphadnis/quickswift/blob/main/server/middleware/verifyAuthToken.js"
    click FirebaseAuth "https://github.com/amoghphadnis/quickswift/blob/main/server/firebase/firebaseConfig.js"
    click PayPalClient "https://github.com/amoghphadnis/quickswift/blob/main/server/paypal/paypalClient.js"
    click DataAccess "https://github.com/amoghphadnis/quickswift/blob/main/server/model/User.js"
    click DBConn "https://github.com/amoghphadnis/quickswift/blob/main/server/model/database.js"
    click ConfigServer "https://github.com/amoghphadnis/quickswift/blob/main/server/.env"
```
