# mwahidcodes/shareforgood-fyp architecture

> Architecture diagram of the GitHub repository mwahidcodes/shareforgood-fyp, 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/mwahidcodes/shareforgood-fyp
- Repository: https://github.com/mwahidcodes/shareforgood-fyp

## Overview

Share For Good is a donation platform for cash and goods, with account verification, product bidding, and administrator review. Its principal workflow is that donors or people requesting help use the marketplace forms; administrators review verification and requests, while donors can also participate in auctions. Cash donations can use Stripe checkout, and product images are screened by the backend through Sightengine. The README only describes Create React App setup; page-level wiring beyond the sampled routes and source is not fully verified.

Main entry points: [`src/App.jsx`](https://github.com/mwahidcodes/shareforgood-fyp/blob/main/src/App.jsx) (React app and routes), [`server.js`](https://github.com/mwahidcodes/shareforgood-fyp/blob/main/server.js) (Express backend), [`src/supabaseClient.js`](https://github.com/mwahidcodes/shareforgood-fyp/blob/main/src/supabaseClient.js) (Supabase client), [`src/pages/BiddingGallery.jsx`](https://github.com/mwahidcodes/shareforgood-fyp/blob/main/src/pages/BiddingGallery.jsx) (Bidding gallery)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application"]
  node_appentry["React app and routes<br/>[App.jsx]"]
  node_layout["Shared layout<br/>[Layout.jsx]"]
  node_auth["Route protection<br/>[ProtectedRoute.jsx]"]
  node_account["Account and profile"]
  node_home["Public marketplace<br/>[HomePage.jsx]"]
end

subgraph group_giving["Donations and Requests"]
  node_cashrequest["Cash requests"]
  node_productrequest["Product requests"]
  node_productdonation["Product donations"]
  node_cashdonation["Cash donations"]
  node_productbrowse["Browse products<br/>[ProductBrowse.jsx]"]
end

subgraph group_trust["Review and Auctions"]
  node_verification["Document verification"]
  node_bidding["Bidding gallery<br/>[BiddingGallery.jsx]"]
  node_admin["Admin review<br/>[AdminPanel.jsx]"]
end

subgraph group_services["Backend and Services"]
  node_supabaseclient["Supabase client<br/>[supabaseClient.js]"]
  node_supabase[("Supabase")]
  node_notifications["Notification utilities<br/>[notifications.js]"]
  node_backend["Express backend<br/>[server.js]"]
  node_stripeapi["Stripe session handler"]
  node_stripe["Stripe"]
  node_sightengine["Sightengine moderation"]
end

node_visitor(("Visitor"))
node_donor(("Donor"))
node_recipient(("Recipient"))
node_administrator(("Administrator"))

node_visitor -->|"opens"| node_appentry
node_donor -->|"opens"| node_appentry
node_recipient -->|"opens"| node_appentry
node_administrator -->|"opens"| node_appentry
node_appentry -->|"renders routes"| node_layout
node_appentry -->|"routes to"| node_home
node_appentry -->|"guards routes"| node_auth
node_appentry -->|"routes to"| node_cashrequest
node_appentry -->|"routes to"| node_productrequest
node_appentry -->|"routes to"| node_productdonation
node_appentry -->|"routes to"| node_productbrowse
node_appentry -->|"routes to"| node_admin
node_appentry -->|"routes to"| node_bidding
node_appentry -->|"routes to"| node_account
node_verification -->|"uploads and queries"| node_supabaseclient
node_supabaseclient -->|"accesses"| node_supabase
node_bidding -->|"reads and updates"| node_supabaseclient
node_bidding -->|"creates alerts"| node_notifications
node_admin -->|"reviews records"| node_supabaseclient
node_admin -->|"notifies users"| node_notifications
node_cashdonation -->|"requests checkout"| node_backend
node_backend -->|"dispatches"| node_stripeapi
node_stripeapi -->|"creates session"| node_stripe
node_productdonation -->|"requests screening"| node_backend
node_backend -->|"screens image"| node_sightengine

click node_appentry "https://github.com/mwahidcodes/shareforgood-fyp/blob/main/src/App.jsx"
click node_layout "https://github.com/mwahidcodes/shareforgood-fyp/blob/main/src/components/Layout.jsx"
click node_auth "https://github.com/mwahidcodes/shareforgood-fyp/blob/main/src/components/ProtectedRoute.jsx"
click node_account "https://github.com/mwahidcodes/shareforgood-fyp/tree/main/src/pages"
click node_home "https://github.com/mwahidcodes/shareforgood-fyp/blob/main/src/pages/HomePage.jsx"
click node_cashrequest "https://github.com/mwahidcodes/shareforgood-fyp/blob/main/src/pages/CashRequestForm.jsx"
click node_productrequest "https://github.com/mwahidcodes/shareforgood-fyp/blob/main/src/pages/ProductRequestForm.jsx"
click node_productdonation "https://github.com/mwahidcodes/shareforgood-fyp/blob/main/src/pages/ProductDonationForm.jsx"
click node_cashdonation "https://github.com/mwahidcodes/shareforgood-fyp/blob/main/src/pages/CashDonationForm.jsx"
click node_productbrowse "https://github.com/mwahidcodes/shareforgood-fyp/blob/main/src/pages/ProductBrowse.jsx"
click node_verification "https://github.com/mwahidcodes/shareforgood-fyp/blob/main/src/components/VerificationFormModal.jsx"
click node_bidding "https://github.com/mwahidcodes/shareforgood-fyp/blob/main/src/pages/BiddingGallery.jsx"
click node_admin "https://github.com/mwahidcodes/shareforgood-fyp/blob/main/src/pages/AdminPanel.jsx"
click node_supabaseclient "https://github.com/mwahidcodes/shareforgood-fyp/blob/main/src/supabaseClient.js"
click node_notifications "https://github.com/mwahidcodes/shareforgood-fyp/blob/main/src/utils/notifications.js"
click node_backend "https://github.com/mwahidcodes/shareforgood-fyp/blob/main/server.js"
click node_stripeapi "https://github.com/mwahidcodes/shareforgood-fyp/blob/main/api/create-stripe-session.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_appentry,node_layout,node_auth,node_account,node_home toneBlue
class node_cashrequest,node_productrequest,node_productdonation,node_cashdonation,node_productbrowse toneAmber
class node_verification,node_bidding,node_admin toneMint
class node_supabaseclient,node_supabase,node_notifications,node_backend,node_stripeapi,node_stripe,node_sightengine toneRose
class node_visitor,node_donor,node_recipient,node_administrator toneIndigo
```

## Components

### Application

- [React app and routes](https://github.com/mwahidcodes/shareforgood-fyp/blob/main/src/App.jsx): `src/App.jsx`
- [Shared layout](https://github.com/mwahidcodes/shareforgood-fyp/blob/main/src/components/Layout.jsx): `src/components/Layout.jsx`
- [Route protection](https://github.com/mwahidcodes/shareforgood-fyp/blob/main/src/components/ProtectedRoute.jsx): `src/components/ProtectedRoute.jsx`
- [Account and profile](https://github.com/mwahidcodes/shareforgood-fyp/tree/main/src/pages): `src/pages`
- [Public marketplace](https://github.com/mwahidcodes/shareforgood-fyp/blob/main/src/pages/HomePage.jsx): `src/pages/HomePage.jsx`

### Donations and Requests

- [Cash requests](https://github.com/mwahidcodes/shareforgood-fyp/blob/main/src/pages/CashRequestForm.jsx): `src/pages/CashRequestForm.jsx`
- [Product requests](https://github.com/mwahidcodes/shareforgood-fyp/blob/main/src/pages/ProductRequestForm.jsx): `src/pages/ProductRequestForm.jsx`
- [Product donations](https://github.com/mwahidcodes/shareforgood-fyp/blob/main/src/pages/ProductDonationForm.jsx): `src/pages/ProductDonationForm.jsx`
- [Cash donations](https://github.com/mwahidcodes/shareforgood-fyp/blob/main/src/pages/CashDonationForm.jsx): `src/pages/CashDonationForm.jsx`
- [Browse products](https://github.com/mwahidcodes/shareforgood-fyp/blob/main/src/pages/ProductBrowse.jsx): `src/pages/ProductBrowse.jsx`

### Review and Auctions

- [Document verification](https://github.com/mwahidcodes/shareforgood-fyp/blob/main/src/components/VerificationFormModal.jsx): `src/components/VerificationFormModal.jsx`
- [Bidding gallery](https://github.com/mwahidcodes/shareforgood-fyp/blob/main/src/pages/BiddingGallery.jsx): `src/pages/BiddingGallery.jsx`
- [Admin review](https://github.com/mwahidcodes/shareforgood-fyp/blob/main/src/pages/AdminPanel.jsx): `src/pages/AdminPanel.jsx`

### Backend and Services

- [Supabase client](https://github.com/mwahidcodes/shareforgood-fyp/blob/main/src/supabaseClient.js): `src/supabaseClient.js`
- **Supabase**
- [Notification utilities](https://github.com/mwahidcodes/shareforgood-fyp/blob/main/src/utils/notifications.js): `src/utils/notifications.js`
- [Express backend](https://github.com/mwahidcodes/shareforgood-fyp/blob/main/server.js): `server.js`
- [Stripe session handler](https://github.com/mwahidcodes/shareforgood-fyp/blob/main/api/create-stripe-session.js): `api/create-stripe-session.js`
- **Stripe**
- **Sightengine moderation**

### Other components

- **Visitor**
- **Donor**
- **Recipient**
- **Administrator**

## Connections

- Visitor → React app and routes: opens
- Donor → React app and routes: opens
- Recipient → React app and routes: opens
- Administrator → React app and routes: opens
- React app and routes → Shared layout: renders routes
- React app and routes → Public marketplace: routes to
- React app and routes → Route protection: guards routes
- React app and routes → Cash requests: routes to
- React app and routes → Product requests: routes to
- React app and routes → Product donations: routes to
- React app and routes → Browse products: routes to
- React app and routes → Admin review: routes to
- React app and routes → Bidding gallery: routes to
- React app and routes → Account and profile: routes to
- Document verification → Supabase client: uploads and queries
- Supabase client → Supabase: accesses
- Bidding gallery → Supabase client: reads and updates
- Bidding gallery → Notification utilities: creates alerts
- Admin review → Supabase client: reviews records
- Admin review → Notification utilities: notifies users
- Cash donations → Express backend: requests checkout
- Express backend → Stripe session handler: dispatches
- Stripe session handler → Stripe: creates session
- Product donations → Express backend: requests screening
- Express backend → Sightengine moderation: screens image
