# quantum0059/hyper_local_market architecture

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

- Interactive diagram: https://gitdiagram.com/quantum0059/hyper_local_market
- Repository: https://github.com/quantum0059/hyper_local_market

## Overview

LocalLinc is a hyperlocal marketplace: owners register shops and publish promotions; customers discover nearby sales, inspect offers, and use QR-based redemption, while the platform tracks visits. The map separates the React user journeys, Express routing and domain handlers, and persistence/integrations. The README documents several product capabilities whose frontend or backend implementation was not sampled; those are represented at the subsystem level, without guessing their internal call paths.

Main entry points: [`FrontEnd/src/App.jsx`](https://github.com/quantum0059/hyper_local_market/blob/main/FrontEnd/src/App.jsx) (Route shell), [`BackEnd/src/Controllers/shop.controller.js`](https://github.com/quantum0059/hyper_local_market/blob/main/BackEnd/src/Controllers/shop.controller.js) (Shop workflows), [`BackEnd/src/Controllers/sales.controller.js`](https://github.com/quantum0059/hyper_local_market/blob/main/BackEnd/src/Controllers/sales.controller.js) (Sale workflows), [`BackEnd/src/Controllers/couponController.js`](https://github.com/quantum0059/hyper_local_market/blob/main/BackEnd/src/Controllers/couponController.js) (Coupon redemption)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Customer and owner app"]
  node_app["Route shell<br/>[App.jsx]"]
  node_auth_pages["Sign in and signup<br/>[LoginPage.jsx]"]
  node_discovery["Nearby offers<br/>[HomePage.jsx]"]
  node_sale_detail["Sale details<br/>[SalesInfo.jsx]"]
  node_shop_detail["Shop details<br/>[ShopInfo.jsx]"]
  node_owner_shop["Shop registration"]
  node_owner_sales["Sale management<br/>[CreateSale.jsx]"]
  node_owner_profile["Shop profile<br/>[ShopProfile.jsx]"]
  node_qr_scan["QR redemption scan<br/>[QrScanner.jsx]"]
  node_user_account["Cart and profile<br/>[CartPage.jsx]"]
  node_context["Shared UI state"]
end

subgraph group_api["API and domain workflows"]
  node_server["Express application<br/>[app.js]"]
  node_auth_routes["Authentication routes<br/>[route.auth.js]"]
  node_auth["Authentication"]
  node_auth_guard["JWT authorization<br/>[auth.middleware.js]"]
  node_shop_routes["Shop routes<br/>[shopRouter.auth.js]"]
  node_shop_ops["Shop workflows<br/>[shop.controller.js]"]
  node_sale_routes["Sale routes<br/>[sales.routes.js]"]
  node_sale_ops["Sale workflows"]
  node_coupon_routes["Coupon routes<br/>[coupon.routes.js]"]
  node_coupon_ops["Coupon redemption"]
end

subgraph group_data["Marketplace data"]
  node_user_model[("User records<br/>[userschema.js]")]
  node_shop_model[("Shop records<br/>[shopschema.js]")]
  node_sale_model[("Sale records<br/>[saleschema.js]")]
  node_coupon_model[("Coupon records<br/>[couponschema.js]")]
end

subgraph group_integrations["External services"]
  node_geocode["Address geocoding<br/>[Geocode.js]"]
  node_cloudinary["Image hosting<br/>[cloudinary.js]"]
  node_google["Google OAuth"]
end

node_visitor(("Marketplace user"))

node_visitor -->|"uses"| node_app
node_app -->|"routes to"| node_auth_pages
node_app -->|"routes to"| node_discovery
node_app -->|"routes to"| node_sale_detail
node_app -->|"routes to"| node_shop_detail
node_app -->|"routes to"| node_owner_shop
node_app -->|"routes to"| node_owner_sales
node_app -->|"routes to"| node_owner_profile
node_app -->|"routes to"| node_user_account
node_context -->|"provides UI state"| node_app
node_server -->|"mounts"| node_auth_routes
node_server -->|"mounts"| node_shop_routes
node_server -->|"mounts"| node_sale_routes
node_server -->|"mounts"| node_coupon_routes
node_auth_routes -->|"dispatches to"| node_auth
node_shop_routes -->|"checks identity"| node_auth_guard
node_shop_routes -->|"dispatches to"| node_shop_ops
node_sale_routes -->|"checks identity"| node_auth_guard
node_sale_routes -->|"dispatches to"| node_sale_ops
node_coupon_routes -->|"checks identity"| node_auth_guard
node_coupon_routes -->|"dispatches to"| node_coupon_ops
node_auth -->|"reads and writes"| node_user_model
node_auth_guard -->|"loads user"| node_user_model
node_shop_ops -->|"reads and writes"| node_shop_model
node_shop_ops -->|"updates owner"| node_user_model
node_shop_ops -->|"reads sales"| node_sale_model
node_sale_ops -->|"reads and writes"| node_sale_model
node_sale_ops -->|"queries shops"| node_shop_model
node_sale_ops -->|"reads location"| node_user_model
node_coupon_ops -->|"uses coupon data"| node_coupon_model
node_coupon_ops -->|"checks sale"| node_sale_model
node_shop_ops -->|"geocodes address"| node_geocode
node_shop_ops -->|"uploads images"| node_cloudinary
node_auth -->|"verifies OAuth"| node_google
node_owner_profile -->|"renders scanner"| node_qr_scan
node_discovery -.->|"requests nearby offers"| node_sale_ops
node_owner_sales -.->|"submits sale"| node_shop_ops
node_sale_detail -.->|"requests redemption QR"| node_coupon_ops
node_qr_scan -.->|"validates redemption"| node_coupon_ops

click node_app "https://github.com/quantum0059/hyper_local_market/blob/main/FrontEnd/src/App.jsx"
click node_auth_pages "https://github.com/quantum0059/hyper_local_market/blob/main/FrontEnd/src/pages/LoginPage.jsx"
click node_discovery "https://github.com/quantum0059/hyper_local_market/blob/main/FrontEnd/src/pages/HomePage.jsx"
click node_sale_detail "https://github.com/quantum0059/hyper_local_market/blob/main/FrontEnd/src/pages/SalesInfo.jsx"
click node_shop_detail "https://github.com/quantum0059/hyper_local_market/blob/main/FrontEnd/src/pages/ShopInfo.jsx"
click node_owner_shop "https://github.com/quantum0059/hyper_local_market/blob/main/FrontEnd/src/pages/OwnerRegistrationPage.jsx"
click node_owner_sales "https://github.com/quantum0059/hyper_local_market/blob/main/FrontEnd/src/pages/CreateSale.jsx"
click node_owner_profile "https://github.com/quantum0059/hyper_local_market/blob/main/FrontEnd/src/pages/ShopProfile.jsx"
click node_qr_scan "https://github.com/quantum0059/hyper_local_market/blob/main/FrontEnd/src/Components/QrScanner.jsx"
click node_user_account "https://github.com/quantum0059/hyper_local_market/blob/main/FrontEnd/src/pages/CartPage.jsx"
click node_context "https://github.com/quantum0059/hyper_local_market/blob/main/FrontEnd/src/Context/ContextProvider.jsx"
click node_server "https://github.com/quantum0059/hyper_local_market/blob/main/BackEnd/src/app.js"
click node_auth_routes "https://github.com/quantum0059/hyper_local_market/blob/main/BackEnd/src/routes/route.auth.js"
click node_auth "https://github.com/quantum0059/hyper_local_market/blob/main/BackEnd/src/Controllers/login.controller.js"
click node_auth_guard "https://github.com/quantum0059/hyper_local_market/blob/main/BackEnd/src/middleware/auth.middleware.js"
click node_shop_routes "https://github.com/quantum0059/hyper_local_market/blob/main/BackEnd/src/routes/shopRouter.auth.js"
click node_shop_ops "https://github.com/quantum0059/hyper_local_market/blob/main/BackEnd/src/Controllers/shop.controller.js"
click node_sale_routes "https://github.com/quantum0059/hyper_local_market/blob/main/BackEnd/src/routes/sales.routes.js"
click node_sale_ops "https://github.com/quantum0059/hyper_local_market/blob/main/BackEnd/src/Controllers/sales.controller.js"
click node_coupon_routes "https://github.com/quantum0059/hyper_local_market/blob/main/BackEnd/src/routes/coupon.routes.js"
click node_coupon_ops "https://github.com/quantum0059/hyper_local_market/blob/main/BackEnd/src/Controllers/couponController.js"
click node_user_model "https://github.com/quantum0059/hyper_local_market/blob/main/BackEnd/src/models/userschema.js"
click node_shop_model "https://github.com/quantum0059/hyper_local_market/blob/main/BackEnd/src/models/shopschema.js"
click node_sale_model "https://github.com/quantum0059/hyper_local_market/blob/main/BackEnd/src/models/saleschema.js"
click node_coupon_model "https://github.com/quantum0059/hyper_local_market/blob/main/BackEnd/src/models/couponschema.js"
click node_geocode "https://github.com/quantum0059/hyper_local_market/blob/main/BackEnd/src/utilities/Geocode.js"
click node_cloudinary "https://github.com/quantum0059/hyper_local_market/blob/main/BackEnd/src/utilities/cloudinary.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_auth_pages,node_discovery,node_sale_detail,node_shop_detail,node_owner_shop,node_owner_sales,node_owner_profile,node_qr_scan,node_user_account,node_context,node_visitor toneBlue
class node_server,node_auth_routes,node_auth,node_auth_guard,node_shop_routes,node_shop_ops,node_sale_routes,node_sale_ops,node_coupon_routes,node_coupon_ops toneAmber
class node_user_model,node_shop_model,node_sale_model,node_coupon_model toneMint
class node_geocode,node_cloudinary,node_google toneRose
```

## Components

### Customer and owner app

- [Route shell](https://github.com/quantum0059/hyper_local_market/blob/main/FrontEnd/src/App.jsx): `FrontEnd/src/App.jsx`
- [Sign in and signup](https://github.com/quantum0059/hyper_local_market/blob/main/FrontEnd/src/pages/LoginPage.jsx): `FrontEnd/src/pages/LoginPage.jsx`
- [Nearby offers](https://github.com/quantum0059/hyper_local_market/blob/main/FrontEnd/src/pages/HomePage.jsx): `FrontEnd/src/pages/HomePage.jsx`
- [Sale details](https://github.com/quantum0059/hyper_local_market/blob/main/FrontEnd/src/pages/SalesInfo.jsx): `FrontEnd/src/pages/SalesInfo.jsx`
- [Shop details](https://github.com/quantum0059/hyper_local_market/blob/main/FrontEnd/src/pages/ShopInfo.jsx): `FrontEnd/src/pages/ShopInfo.jsx`
- [Shop registration](https://github.com/quantum0059/hyper_local_market/blob/main/FrontEnd/src/pages/OwnerRegistrationPage.jsx): `FrontEnd/src/pages/OwnerRegistrationPage.jsx`
- [Sale management](https://github.com/quantum0059/hyper_local_market/blob/main/FrontEnd/src/pages/CreateSale.jsx): `FrontEnd/src/pages/CreateSale.jsx`
- [Shop profile](https://github.com/quantum0059/hyper_local_market/blob/main/FrontEnd/src/pages/ShopProfile.jsx): `FrontEnd/src/pages/ShopProfile.jsx`
- [QR redemption scan](https://github.com/quantum0059/hyper_local_market/blob/main/FrontEnd/src/Components/QrScanner.jsx): `FrontEnd/src/Components/QrScanner.jsx`
- [Cart and profile](https://github.com/quantum0059/hyper_local_market/blob/main/FrontEnd/src/pages/CartPage.jsx): `FrontEnd/src/pages/CartPage.jsx`
- [Shared UI state](https://github.com/quantum0059/hyper_local_market/blob/main/FrontEnd/src/Context/ContextProvider.jsx): `FrontEnd/src/Context/ContextProvider.jsx`

### API and domain workflows

- [Express application](https://github.com/quantum0059/hyper_local_market/blob/main/BackEnd/src/app.js): `BackEnd/src/app.js`
- [Authentication routes](https://github.com/quantum0059/hyper_local_market/blob/main/BackEnd/src/routes/route.auth.js): `BackEnd/src/routes/route.auth.js`
- [Authentication](https://github.com/quantum0059/hyper_local_market/blob/main/BackEnd/src/Controllers/login.controller.js): `BackEnd/src/Controllers/login.controller.js`
- [JWT authorization](https://github.com/quantum0059/hyper_local_market/blob/main/BackEnd/src/middleware/auth.middleware.js): `BackEnd/src/middleware/auth.middleware.js`
- [Shop routes](https://github.com/quantum0059/hyper_local_market/blob/main/BackEnd/src/routes/shopRouter.auth.js): `BackEnd/src/routes/shopRouter.auth.js`
- [Shop workflows](https://github.com/quantum0059/hyper_local_market/blob/main/BackEnd/src/Controllers/shop.controller.js): `BackEnd/src/Controllers/shop.controller.js`
- [Sale routes](https://github.com/quantum0059/hyper_local_market/blob/main/BackEnd/src/routes/sales.routes.js): `BackEnd/src/routes/sales.routes.js`
- [Sale workflows](https://github.com/quantum0059/hyper_local_market/blob/main/BackEnd/src/Controllers/sales.controller.js): `BackEnd/src/Controllers/sales.controller.js`
- [Coupon routes](https://github.com/quantum0059/hyper_local_market/blob/main/BackEnd/src/routes/coupon.routes.js): `BackEnd/src/routes/coupon.routes.js`
- [Coupon redemption](https://github.com/quantum0059/hyper_local_market/blob/main/BackEnd/src/Controllers/couponController.js): `BackEnd/src/Controllers/couponController.js`

### Marketplace data

- [User records](https://github.com/quantum0059/hyper_local_market/blob/main/BackEnd/src/models/userschema.js): `BackEnd/src/models/userschema.js`
- [Shop records](https://github.com/quantum0059/hyper_local_market/blob/main/BackEnd/src/models/shopschema.js): `BackEnd/src/models/shopschema.js`
- [Sale records](https://github.com/quantum0059/hyper_local_market/blob/main/BackEnd/src/models/saleschema.js): `BackEnd/src/models/saleschema.js`
- [Coupon records](https://github.com/quantum0059/hyper_local_market/blob/main/BackEnd/src/models/couponschema.js): `BackEnd/src/models/couponschema.js`

### External services

- [Address geocoding](https://github.com/quantum0059/hyper_local_market/blob/main/BackEnd/src/utilities/Geocode.js): `BackEnd/src/utilities/Geocode.js`
- [Image hosting](https://github.com/quantum0059/hyper_local_market/blob/main/BackEnd/src/utilities/cloudinary.js): `BackEnd/src/utilities/cloudinary.js`
- **Google OAuth**

### Other components

- **Marketplace user**

## Connections

- Marketplace user → Route shell: uses (evidence: `FrontEnd/src/App.jsx`)
- Route shell → Sign in and signup: routes to (evidence: `FrontEnd/src/App.jsx`)
- Route shell → Nearby offers: routes to (evidence: `FrontEnd/src/App.jsx`)
- Route shell → Sale details: routes to (evidence: `FrontEnd/src/App.jsx`)
- Route shell → Shop details: routes to (evidence: `FrontEnd/src/App.jsx`)
- Route shell → Shop registration: routes to (evidence: `FrontEnd/src/App.jsx`)
- Route shell → Sale management: routes to (evidence: `FrontEnd/src/App.jsx`)
- Route shell → Shop profile: routes to (evidence: `FrontEnd/src/App.jsx`)
- Route shell → Cart and profile: routes to (evidence: `FrontEnd/src/App.jsx`)
- Shared UI state → Route shell: provides UI state (evidence: `FrontEnd/src/main.jsx`)
- Express application → Authentication routes: mounts (evidence: `BackEnd/src/app.js`)
- Express application → Shop routes: mounts (evidence: `BackEnd/src/app.js`)
- Express application → Sale routes: mounts (evidence: `BackEnd/src/app.js`)
- Express application → Coupon routes: mounts (evidence: `BackEnd/src/app.js`)
- Authentication routes → Authentication: dispatches to (evidence: `BackEnd/src/routes/route.auth.js`)
- Shop routes → JWT authorization: checks identity (evidence: `BackEnd/src/routes/shopRouter.auth.js`)
- Shop routes → Shop workflows: dispatches to (evidence: `BackEnd/src/routes/shopRouter.auth.js`)
- Sale routes → JWT authorization: checks identity (evidence: `BackEnd/src/routes/sales.routes.js`)
- Sale routes → Sale workflows: dispatches to (evidence: `BackEnd/src/routes/sales.routes.js`)
- Coupon routes → JWT authorization: checks identity (evidence: `BackEnd/src/routes/coupon.routes.js`)
- Coupon routes → Coupon redemption: dispatches to (evidence: `BackEnd/src/routes/coupon.routes.js`)
- Authentication → User records: reads and writes (evidence: `BackEnd/src/Controllers/login.controller.js`)
- JWT authorization → User records: loads user (evidence: `BackEnd/src/middleware/auth.middleware.js`)
- Shop workflows → Shop records: reads and writes (evidence: `BackEnd/src/Controllers/shop.controller.js`)
- Shop workflows → User records: updates owner (evidence: `BackEnd/src/Controllers/shop.controller.js`)
- Shop workflows → Sale records: reads sales (evidence: `BackEnd/src/Controllers/shop.controller.js`)
- Sale workflows → Sale records: reads and writes (evidence: `BackEnd/src/Controllers/sales.controller.js`)
- Sale workflows → Shop records: queries shops (evidence: `BackEnd/src/Controllers/sales.controller.js`)
- Sale workflows → User records: reads location (evidence: `BackEnd/src/Controllers/sales.controller.js`)
- Coupon redemption → Coupon records: uses coupon data (evidence: `BackEnd/src/Controllers/couponController.js`)
- Coupon redemption → Sale records: checks sale (evidence: `BackEnd/src/Controllers/couponController.js`)
- Shop workflows → Address geocoding: geocodes address (evidence: `BackEnd/src/Controllers/shop.controller.js`)
- Shop workflows → Image hosting: uploads images (evidence: `BackEnd/src/Controllers/shop.controller.js`)
- Authentication → Google OAuth: verifies OAuth (evidence: `BackEnd/src/Controllers/login.controller.js`)
- Shop profile → QR redemption scan: renders scanner (evidence: `FrontEnd/src/pages/ShopProfile.jsx`)
- Nearby offers → Sale workflows: requests nearby offers
- Sale management → Shop workflows: submits sale
- Sale details → Coupon redemption: requests redemption QR
- QR redemption scan → Coupon redemption: validates redemption
