# akash2236/stikcoins architecture

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

- Interactive diagram: https://gitdiagram.com/akash2236/stikcoins
- Repository: https://github.com/akash2236/stikcoins

## Overview

Stikbook is a mock rewards wallet and merchant POS: customers claim rewards, find nearby shops, redeem products with an OTP/QR, and merchants approve checkout while balances and transaction history update. React dashboards use shared context to communicate with an Express API backed by in-memory state; the backend can send OTP and receipt emails through Brevo. The README documents geolocation, map discovery, and polling capabilities; some wiring is not visible in the sampled excerpts, so uncertain links are omitted.

Main entry points: [`src/App.jsx`](https://github.com/akash2236/stikcoins/blob/main/src/App.jsx) (App Router), [`src/pages/CustomerDashboard.jsx`](https://github.com/akash2236/stikcoins/blob/main/src/pages/CustomerDashboard.jsx) (Customer Dashboard), [`src/context/AppContext.jsx`](https://github.com/akash2236/stikcoins/blob/main/src/context/AppContext.jsx) (Shared App Context), [`backend/server.js`](https://github.com/akash2236/stikcoins/blob/main/backend/server.js) (REST API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Customer App"]
  node_app["App Router<br/>[App.jsx]"]
  node_login["Login<br/>[LoginPage.jsx]"]
  node_customer_dashboard["Customer Dashboard"]
  node_app_context["Shared App Context<br/>[AppContext.jsx]"]
  node_shop_data["Shop Catalog<br/>[appData.js]"]
  node_legacy_emulator["Legacy Emulator"]
  node_sound_effects["Sound Effects<br/>[soundEffects.js]"]
end

subgraph group_merchant["Merchant POS"]
  node_merchant_dashboard["Merchant POS"]
end

subgraph group_backend["Backend Services"]
  node_api["REST API<br/>[server.js]"]
  node_memory_state[("In-Memory State<br/>[server.js]")]
  node_email_sender["Email Sender<br/>[brevo.js]"]
end

subgraph group_integrations["External Integrations"]
  node_gps(("Device GPS"))
  node_map_tiles["Map Tiles"]
  node_brevo["Brevo Email API"]
end

node_customer(("Customer"))
node_shopkeeper(("Shopkeeper"))
node_inbox(("Customer Inbox"))

node_customer -->|"uses"| node_app
node_app -->|"routes"| node_login
node_app -->|"routes"| node_customer_dashboard
node_app -->|"routes"| node_merchant_dashboard
node_app -->|"routes"| node_legacy_emulator
node_login -->|"signs in via"| node_app_context
node_customer_dashboard -->|"requests rewards"| node_app_context
node_customer_dashboard -->|"reads catalog"| node_shop_data
node_customer_dashboard -.->|"gets location"| node_gps
node_customer_dashboard -->|"loads tiles"| node_map_tiles
node_shopkeeper -->|"uses"| node_merchant_dashboard
node_merchant_dashboard -->|"approves orders"| node_app_context
node_app_context -->|"calls API"| node_api
node_api -->|"reads and writes"| node_memory_state
node_api -->|"sends OTP and receipt"| node_email_sender
node_email_sender -.->|"dispatches email"| node_brevo
node_brevo -.->|"delivers email"| node_inbox
node_app_context -->|"plays sounds"| node_sound_effects

click node_app "https://github.com/akash2236/stikcoins/blob/main/src/App.jsx"
click node_login "https://github.com/akash2236/stikcoins/blob/main/src/pages/LoginPage.jsx"
click node_customer_dashboard "https://github.com/akash2236/stikcoins/blob/main/src/pages/CustomerDashboard.jsx"
click node_app_context "https://github.com/akash2236/stikcoins/blob/main/src/context/AppContext.jsx"
click node_shop_data "https://github.com/akash2236/stikcoins/blob/main/src/data/appData.js"
click node_merchant_dashboard "https://github.com/akash2236/stikcoins/blob/main/src/pages/ShopkeeperDashboard.jsx"
click node_legacy_emulator "https://github.com/akash2236/stikcoins/blob/main/src/components/StikcoinsScreen.jsx"
click node_sound_effects "https://github.com/akash2236/stikcoins/blob/main/src/utils/soundEffects.js"
click node_api "https://github.com/akash2236/stikcoins/blob/main/backend/server.js"
click node_memory_state "https://github.com/akash2236/stikcoins/blob/main/backend/server.js"
click node_email_sender "https://github.com/akash2236/stikcoins/blob/main/backend/utils/brevo.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_login,node_customer_dashboard,node_app_context,node_shop_data,node_legacy_emulator,node_sound_effects toneBlue
class node_merchant_dashboard toneAmber
class node_api,node_memory_state,node_email_sender toneMint
class node_gps,node_map_tiles,node_brevo toneRose
class node_customer,node_shopkeeper,node_inbox toneIndigo
```

## Components

### Customer App

- [App Router](https://github.com/akash2236/stikcoins/blob/main/src/App.jsx): `src/App.jsx`
- [Login](https://github.com/akash2236/stikcoins/blob/main/src/pages/LoginPage.jsx): `src/pages/LoginPage.jsx`
- [Customer Dashboard](https://github.com/akash2236/stikcoins/blob/main/src/pages/CustomerDashboard.jsx): `src/pages/CustomerDashboard.jsx`
- [Shared App Context](https://github.com/akash2236/stikcoins/blob/main/src/context/AppContext.jsx): `src/context/AppContext.jsx`
- [Shop Catalog](https://github.com/akash2236/stikcoins/blob/main/src/data/appData.js): `src/data/appData.js`
- [Legacy Emulator](https://github.com/akash2236/stikcoins/blob/main/src/components/StikcoinsScreen.jsx): `src/components/StikcoinsScreen.jsx`
- [Sound Effects](https://github.com/akash2236/stikcoins/blob/main/src/utils/soundEffects.js): `src/utils/soundEffects.js`

### Merchant POS

- [Merchant POS](https://github.com/akash2236/stikcoins/blob/main/src/pages/ShopkeeperDashboard.jsx): `src/pages/ShopkeeperDashboard.jsx`

### Backend Services

- [REST API](https://github.com/akash2236/stikcoins/blob/main/backend/server.js): `backend/server.js`
- [In-Memory State](https://github.com/akash2236/stikcoins/blob/main/backend/server.js): `backend/server.js`
- [Email Sender](https://github.com/akash2236/stikcoins/blob/main/backend/utils/brevo.js): `backend/utils/brevo.js`

### External Integrations

- **Device GPS**
- **Map Tiles**
- **Brevo Email API**

### Other components

- **Customer**
- **Shopkeeper**
- **Customer Inbox**

## Connections

- Customer → App Router: uses
- App Router → Login: routes
- App Router → Customer Dashboard: routes
- App Router → Merchant POS: routes
- App Router → Legacy Emulator: routes
- Login → Shared App Context: signs in via
- Customer Dashboard → Shared App Context: requests rewards
- Customer Dashboard → Shop Catalog: reads catalog
- Customer Dashboard → Device GPS: gets location
- Customer Dashboard → Map Tiles: loads tiles
- Shopkeeper → Merchant POS: uses
- Merchant POS → Shared App Context: approves orders
- Shared App Context → REST API: calls API
- REST API → In-Memory State: reads and writes
- REST API → Email Sender: sends OTP and receipt
- Email Sender → Brevo Email API: dispatches email
- Brevo Email API → Customer Inbox: delivers email
- Shared App Context → Sound Effects: plays sounds
