# clustr997-hash/2no architecture

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

- Interactive diagram: https://gitdiagram.com/clustr997-hash/2no
- Repository: https://github.com/clustr997-hash/2no

## Overview

MicroMall is a Firebase-backed marketplace for SPPU and DBATU study documents. Students browse university, year, branch, and subject catalogs, then open free material or submit UPI payment proof for paid access; approval unlocks downloads. Admins manage subjects and documents and review orders. The React application coordinates the user flows, Firebase stores marketplace data and files, and callable Functions handle approval and protected signed downloads. Some UI and callable invocation details are documented but their source was not included in the excerpts.

Main entry points: [`functions/index.js`](https://github.com/clustr997-hash/2no/blob/main/functions/index.js) (Callable functions), [`web/src/firebase.js`](https://github.com/clustr997-hash/2no/blob/main/web/src/firebase.js) (Firebase client), [`web/src/App.jsx`](https://github.com/clustr997-hash/2no/blob/main/web/src/App.jsx) (Subject details), [`web/src/data/catalog.js`](https://github.com/clustr997-hash/2no/blob/main/web/src/data/catalog.js) (Subject catalog)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_browse["Browse catalog"]
  node_app["React application<br/>[App.jsx]"]
  node_catalog["Subject catalog<br/>[catalog.js]"]
  node_browse_flow["Browse hierarchy<br/>[App.jsx]"]
  node_subject_details["Subject details<br/>[App.jsx]"]
end

subgraph group_access["Orders and access"]
  node_authentication["Google sign-in<br/>[App.jsx]"]
  node_order_submission["Payment submission<br/>[App.jsx]"]
  node_my_access["My Access<br/>[App.jsx]"]
  node_download_authorization["Download authorization<br/>[index.js]"]
end

subgraph group_admin["Admin management"]
  node_admin_dashboard["Admin dashboard<br/>[App.jsx]"]
  node_subject_management["Subject management<br/>[App.jsx]"]
  node_document_management["Document management<br/>[App.jsx]"]
  node_order_review["Order review<br/>[App.jsx]"]
end

subgraph group_platform["Firebase platform"]
  node_firebase_client["Firebase client<br/>[firebase.js]"]
  node_callable_functions["Callable functions<br/>[index.js]"]
  node_firestore[("Firestore")]
  node_storage[("Firebase Storage")]
  node_google_auth["Google Authentication"]
end

node_student(("Student"))
node_administrator(("Administrator"))
node_upi_apps["UPI apps"]

node_student -->|"uses"| node_app
node_administrator -->|"uses"| node_app
node_app -->|"routes to"| node_browse_flow
node_browse_flow -->|"uses catalog"| node_catalog
node_browse_flow -->|"opens subject"| node_subject_details
node_subject_details -->|"reads documents"| node_firestore
node_subject_details -->|"checks access"| node_firestore
node_app -->|"starts sign-in"| node_authentication
node_authentication -->|"authenticates with"| node_google_auth
node_order_submission -.->|"offers payment apps"| node_upi_apps
node_order_submission -->|"uploads proof"| node_storage
node_order_submission -->|"creates order"| node_firestore
node_my_access -->|"reads orders and purchases"| node_firestore
node_admin_dashboard -->|"manages subjects"| node_subject_management
node_admin_dashboard -->|"manages documents"| node_document_management
node_admin_dashboard -->|"reviews orders"| node_order_review
node_subject_management -->|"reads and writes subjects"| node_firestore
node_document_management -->|"writes document records"| node_firestore
node_document_management -->|"uploads and deletes files"| node_storage
node_order_review -->|"requests approval"| node_callable_functions
node_callable_functions -->|"approves or rejects orders"| node_firestore
node_callable_functions -->|"creates purchases"| node_firestore
node_subject_details -->|"requests download URL"| node_callable_functions
node_callable_functions -->|"checks document and access"| node_firestore
node_callable_functions -->|"signs private file URL"| node_storage
node_callable_functions -->|"logs downloads"| node_firestore
node_firebase_client -->|"configures client"| node_google_auth
node_firebase_client -->|"configures client"| node_firestore
node_firebase_client -->|"configures client"| node_storage
node_firebase_client -->|"configures client"| node_callable_functions

click node_app "https://github.com/clustr997-hash/2no/blob/main/web/src/App.jsx"
click node_catalog "https://github.com/clustr997-hash/2no/blob/main/web/src/data/catalog.js"
click node_browse_flow "https://github.com/clustr997-hash/2no/blob/main/web/src/App.jsx"
click node_subject_details "https://github.com/clustr997-hash/2no/blob/main/web/src/App.jsx"
click node_authentication "https://github.com/clustr997-hash/2no/blob/main/web/src/App.jsx"
click node_order_submission "https://github.com/clustr997-hash/2no/blob/main/web/src/App.jsx"
click node_my_access "https://github.com/clustr997-hash/2no/blob/main/web/src/App.jsx"
click node_download_authorization "https://github.com/clustr997-hash/2no/blob/main/functions/index.js"
click node_admin_dashboard "https://github.com/clustr997-hash/2no/blob/main/web/src/App.jsx"
click node_subject_management "https://github.com/clustr997-hash/2no/blob/main/web/src/App.jsx"
click node_document_management "https://github.com/clustr997-hash/2no/blob/main/web/src/App.jsx"
click node_order_review "https://github.com/clustr997-hash/2no/blob/main/web/src/App.jsx"
click node_firebase_client "https://github.com/clustr997-hash/2no/blob/main/web/src/firebase.js"
click node_callable_functions "https://github.com/clustr997-hash/2no/blob/main/functions/index.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_catalog,node_browse_flow,node_subject_details toneBlue
class node_authentication,node_order_submission,node_my_access,node_download_authorization toneAmber
class node_admin_dashboard,node_subject_management,node_document_management,node_order_review toneMint
class node_firebase_client,node_callable_functions,node_firestore,node_storage,node_google_auth toneRose
class node_student,node_administrator,node_upi_apps toneIndigo
```

## Components

### Browse catalog

- [React application](https://github.com/clustr997-hash/2no/blob/main/web/src/App.jsx): `web/src/App.jsx`
- [Subject catalog](https://github.com/clustr997-hash/2no/blob/main/web/src/data/catalog.js): `web/src/data/catalog.js`
- [Browse hierarchy](https://github.com/clustr997-hash/2no/blob/main/web/src/App.jsx): `web/src/App.jsx`
- [Subject details](https://github.com/clustr997-hash/2no/blob/main/web/src/App.jsx): `web/src/App.jsx`

### Orders and access

- [Google sign-in](https://github.com/clustr997-hash/2no/blob/main/web/src/App.jsx): `web/src/App.jsx`
- [Payment submission](https://github.com/clustr997-hash/2no/blob/main/web/src/App.jsx): `web/src/App.jsx`
- [My Access](https://github.com/clustr997-hash/2no/blob/main/web/src/App.jsx): `web/src/App.jsx`
- [Download authorization](https://github.com/clustr997-hash/2no/blob/main/functions/index.js): `functions/index.js`

### Admin management

- [Admin dashboard](https://github.com/clustr997-hash/2no/blob/main/web/src/App.jsx): `web/src/App.jsx`
- [Subject management](https://github.com/clustr997-hash/2no/blob/main/web/src/App.jsx): `web/src/App.jsx`
- [Document management](https://github.com/clustr997-hash/2no/blob/main/web/src/App.jsx): `web/src/App.jsx`
- [Order review](https://github.com/clustr997-hash/2no/blob/main/web/src/App.jsx): `web/src/App.jsx`

### Firebase platform

- [Firebase client](https://github.com/clustr997-hash/2no/blob/main/web/src/firebase.js): `web/src/firebase.js`
- [Callable functions](https://github.com/clustr997-hash/2no/blob/main/functions/index.js): `functions/index.js`
- **Firestore**
- **Firebase Storage**
- **Google Authentication**

### Other components

- **Student**
- **Administrator**
- **UPI apps**

## Connections

- Student → React application: uses
- Administrator → React application: uses
- React application → Browse hierarchy: routes to
- Browse hierarchy → Subject catalog: uses catalog
- Browse hierarchy → Subject details: opens subject
- Subject details → Firestore: reads documents
- Subject details → Firestore: checks access
- React application → Google sign-in: starts sign-in
- Google sign-in → Google Authentication: authenticates with
- Payment submission → UPI apps: offers payment apps
- Payment submission → Firebase Storage: uploads proof
- Payment submission → Firestore: creates order
- My Access → Firestore: reads orders and purchases
- Admin dashboard → Subject management: manages subjects
- Admin dashboard → Document management: manages documents
- Admin dashboard → Order review: reviews orders
- Subject management → Firestore: reads and writes subjects
- Document management → Firestore: writes document records
- Document management → Firebase Storage: uploads and deletes files
- Order review → Callable functions: requests approval
- Callable functions → Firestore: approves or rejects orders
- Callable functions → Firestore: creates purchases
- Subject details → Callable functions: requests download URL
- Callable functions → Firestore: checks document and access
- Callable functions → Firebase Storage: signs private file URL
- Callable functions → Firestore: logs downloads
- Firebase client → Google Authentication: configures client
- Firebase client → Firestore: configures client
- Firebase client → Firebase Storage: configures client
- Firebase client → Callable functions: configures client
