# zenaszephaniah/registrationdonationmanagementsystem architecture

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

- Interactive diagram: https://gitdiagram.com/zenaszephaniah/registrationdonationmanagementsystem
- Repository: https://github.com/zenaszephaniah/registrationdonationmanagementsystem

## Overview

This is an NGO registration and donation portal: users register or sign in, then manage donations independently; administrators review registrations, donation records, metrics, and CSV exports. The frontend routes users to role-protected dashboards and calls the Express API, which applies JWT/RBAC checks and persists user and donation records in MongoDB. Donation checkout creates a pending record before Stripe checkout; verification updates its status. The graph includes README-documented capabilities, but some frontend and backend implementation details were not sampled, so uncertain links are omitted.

Main entry points: [`frontend/src/App.jsx`](https://github.com/zenaszephaniah/registrationdonationmanagementsystem/blob/main/frontend/src/App.jsx) (Route application), [`backend/server.js`](https://github.com/zenaszephaniah/registrationdonationmanagementsystem/blob/main/backend/server.js) (Express API server), [`frontend/src/utils/api.js`](https://github.com/zenaszephaniah/registrationdonationmanagementsystem/blob/main/frontend/src/utils/api.js) (HTTP client), [`frontend/src/context/AuthContext.jsx`](https://github.com/zenaszephaniah/registrationdonationmanagementsystem/blob/main/frontend/src/context/AuthContext.jsx) (Session context)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_app["Route application<br/>[App.jsx]"]
  node_api_client["HTTP client<br/>[api.js]"]
  node_api_server["Express API server<br/>[server.js]"]
end

subgraph group_identity["Identity and access"]
  node_auth_provider["Session context<br/>[AuthContext.jsx]"]
  node_protected_route["Role guard<br/>[ProtectedRoute.jsx]"]
  node_login["Login page<br/>[Login.jsx]"]
  node_register["Registration page<br/>[Register.jsx]"]
  node_auth_routes["Authentication endpoints<br/>[auth.routes.js]"]
  node_auth_middleware["JWT and role checks<br/>[auth.js]"]
end

subgraph group_giving["Donation workflow"]
  node_user_dashboard["User dashboard<br/>[UserDashboard.jsx]"]
  node_donation_status["Donation status page<br/>[DonationStatus.jsx]"]
  node_donation_routes["Donation endpoints<br/>[donation.routes.js]"]
end

subgraph group_operations["Administration"]
  node_admin_dashboard["Admin dashboard<br/>[AdminDashboard.jsx]"]
  node_admin_routes["Admin endpoints<br/>[admin.routes.js]"]
end

subgraph group_persistence["Data persistence"]
  node_user_model[("User records<br/>[User.js]")]
  node_donation_model[("Donation records<br/>[Donation.js]")]
  node_db_connection["Database connection<br/>[db.js]"]
end

node_visitor(("Portal visitor"))
node_administrator(("Administrator"))
node_mongo[("MongoDB")]
node_stripe["Stripe Checkout"]

node_visitor -->|"opens portal"| node_app
node_administrator -->|"opens portal"| node_app
node_app -->|"routes to"| node_login
node_app -->|"routes to"| node_register
node_app -->|"guards routes"| node_protected_route
node_protected_route -->|"checks session"| node_auth_provider
node_app -->|"routes to"| node_user_dashboard
node_app -->|"routes to"| node_donation_status
node_app -->|"routes to"| node_admin_dashboard
node_login -->|"submits credentials"| node_auth_provider
node_register -->|"submits registration"| node_auth_provider
node_auth_provider -->|"calls auth API"| node_api_client
node_user_dashboard -->|"reads session"| node_auth_provider
node_user_dashboard -->|"requests donations"| node_api_client
node_donation_status -->|"requests verification"| node_api_client
node_admin_dashboard -->|"requests admin data"| node_api_client
node_api_client -->|"sends API requests"| node_api_server
node_api_server -->|"connects database"| node_db_connection
node_api_server -->|"mounts routes"| node_auth_routes
node_api_server -->|"mounts routes"| node_donation_routes
node_api_server -->|"mounts routes"| node_admin_routes
node_auth_routes -->|"reads and writes"| node_user_model
node_auth_middleware -->|"loads account"| node_user_model
node_donation_routes -->|"protects endpoints"| node_auth_middleware
node_donation_routes -->|"creates and updates"| node_donation_model
node_donation_routes -->|"creates and verifies"| node_stripe
node_admin_routes -->|"checks admin access"| node_auth_middleware
node_admin_routes -->|"queries registrations"| node_user_model
node_admin_routes -->|"queries donation logs"| node_donation_model
node_db_connection -->|"connects to"| node_mongo
node_user_model -->|"persists users"| node_mongo
node_donation_model -->|"persists donations"| node_mongo

click node_app "https://github.com/zenaszephaniah/registrationdonationmanagementsystem/blob/main/frontend/src/App.jsx"
click node_auth_provider "https://github.com/zenaszephaniah/registrationdonationmanagementsystem/blob/main/frontend/src/context/AuthContext.jsx"
click node_api_client "https://github.com/zenaszephaniah/registrationdonationmanagementsystem/blob/main/frontend/src/utils/api.js"
click node_protected_route "https://github.com/zenaszephaniah/registrationdonationmanagementsystem/blob/main/frontend/src/components/ProtectedRoute.jsx"
click node_login "https://github.com/zenaszephaniah/registrationdonationmanagementsystem/blob/main/frontend/src/pages/Login.jsx"
click node_register "https://github.com/zenaszephaniah/registrationdonationmanagementsystem/blob/main/frontend/src/pages/Register.jsx"
click node_user_dashboard "https://github.com/zenaszephaniah/registrationdonationmanagementsystem/blob/main/frontend/src/pages/UserDashboard.jsx"
click node_donation_status "https://github.com/zenaszephaniah/registrationdonationmanagementsystem/blob/main/frontend/src/pages/DonationStatus.jsx"
click node_admin_dashboard "https://github.com/zenaszephaniah/registrationdonationmanagementsystem/blob/main/frontend/src/pages/AdminDashboard.jsx"
click node_api_server "https://github.com/zenaszephaniah/registrationdonationmanagementsystem/blob/main/backend/server.js"
click node_auth_routes "https://github.com/zenaszephaniah/registrationdonationmanagementsystem/blob/main/backend/routes/auth.routes.js"
click node_auth_middleware "https://github.com/zenaszephaniah/registrationdonationmanagementsystem/blob/main/backend/middleware/auth.js"
click node_donation_routes "https://github.com/zenaszephaniah/registrationdonationmanagementsystem/blob/main/backend/routes/donation.routes.js"
click node_admin_routes "https://github.com/zenaszephaniah/registrationdonationmanagementsystem/blob/main/backend/routes/admin.routes.js"
click node_user_model "https://github.com/zenaszephaniah/registrationdonationmanagementsystem/blob/main/backend/models/User.js"
click node_donation_model "https://github.com/zenaszephaniah/registrationdonationmanagementsystem/blob/main/backend/models/Donation.js"
click node_db_connection "https://github.com/zenaszephaniah/registrationdonationmanagementsystem/blob/main/backend/config/db.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_api_client,node_api_server toneBlue
class node_auth_provider,node_protected_route,node_login,node_register,node_auth_routes,node_auth_middleware,node_mongo toneAmber
class node_user_dashboard,node_donation_status,node_donation_routes toneMint
class node_admin_dashboard,node_admin_routes toneRose
class node_user_model,node_donation_model,node_db_connection,node_visitor,node_administrator,node_stripe toneIndigo
```

## Components

### Web application

- [Route application](https://github.com/zenaszephaniah/registrationdonationmanagementsystem/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [HTTP client](https://github.com/zenaszephaniah/registrationdonationmanagementsystem/blob/main/frontend/src/utils/api.js): `frontend/src/utils/api.js`
- [Express API server](https://github.com/zenaszephaniah/registrationdonationmanagementsystem/blob/main/backend/server.js): `backend/server.js`

### Identity and access

- [Session context](https://github.com/zenaszephaniah/registrationdonationmanagementsystem/blob/main/frontend/src/context/AuthContext.jsx): `frontend/src/context/AuthContext.jsx`
- [Role guard](https://github.com/zenaszephaniah/registrationdonationmanagementsystem/blob/main/frontend/src/components/ProtectedRoute.jsx): `frontend/src/components/ProtectedRoute.jsx`
- [Login page](https://github.com/zenaszephaniah/registrationdonationmanagementsystem/blob/main/frontend/src/pages/Login.jsx): `frontend/src/pages/Login.jsx`
- [Registration page](https://github.com/zenaszephaniah/registrationdonationmanagementsystem/blob/main/frontend/src/pages/Register.jsx): `frontend/src/pages/Register.jsx`
- [Authentication endpoints](https://github.com/zenaszephaniah/registrationdonationmanagementsystem/blob/main/backend/routes/auth.routes.js): `backend/routes/auth.routes.js`
- [JWT and role checks](https://github.com/zenaszephaniah/registrationdonationmanagementsystem/blob/main/backend/middleware/auth.js): `backend/middleware/auth.js`

### Donation workflow

- [User dashboard](https://github.com/zenaszephaniah/registrationdonationmanagementsystem/blob/main/frontend/src/pages/UserDashboard.jsx): `frontend/src/pages/UserDashboard.jsx`
- [Donation status page](https://github.com/zenaszephaniah/registrationdonationmanagementsystem/blob/main/frontend/src/pages/DonationStatus.jsx): `frontend/src/pages/DonationStatus.jsx`
- [Donation endpoints](https://github.com/zenaszephaniah/registrationdonationmanagementsystem/blob/main/backend/routes/donation.routes.js): `backend/routes/donation.routes.js`

### Administration

- [Admin dashboard](https://github.com/zenaszephaniah/registrationdonationmanagementsystem/blob/main/frontend/src/pages/AdminDashboard.jsx): `frontend/src/pages/AdminDashboard.jsx`
- [Admin endpoints](https://github.com/zenaszephaniah/registrationdonationmanagementsystem/blob/main/backend/routes/admin.routes.js): `backend/routes/admin.routes.js`

### Data persistence

- [User records](https://github.com/zenaszephaniah/registrationdonationmanagementsystem/blob/main/backend/models/User.js): `backend/models/User.js`
- [Donation records](https://github.com/zenaszephaniah/registrationdonationmanagementsystem/blob/main/backend/models/Donation.js): `backend/models/Donation.js`
- [Database connection](https://github.com/zenaszephaniah/registrationdonationmanagementsystem/blob/main/backend/config/db.js): `backend/config/db.js`

### Other components

- **Portal visitor**
- **Administrator**
- **MongoDB**
- **Stripe Checkout**

## Connections

- Portal visitor → Route application: opens portal (evidence: `frontend/src/App.jsx`)
- Administrator → Route application: opens portal (evidence: `frontend/src/App.jsx`)
- Route application → Login page: routes to (evidence: `frontend/src/App.jsx`)
- Route application → Registration page: routes to (evidence: `frontend/src/App.jsx`)
- Route application → Role guard: guards routes (evidence: `frontend/src/App.jsx`)
- Role guard → Session context: checks session (evidence: `frontend/src/components/ProtectedRoute.jsx`)
- Route application → User dashboard: routes to (evidence: `frontend/src/App.jsx`)
- Route application → Donation status page: routes to (evidence: `frontend/src/App.jsx`)
- Route application → Admin dashboard: routes to (evidence: `frontend/src/App.jsx`)
- Login page → Session context: submits credentials (evidence: `frontend/src/pages/Login.jsx`)
- Registration page → Session context: submits registration (evidence: `frontend/src/pages/Register.jsx`)
- Session context → HTTP client: calls auth API (evidence: `frontend/src/context/AuthContext.jsx`)
- User dashboard → Session context: reads session (evidence: `frontend/src/pages/UserDashboard.jsx`)
- User dashboard → HTTP client: requests donations (evidence: `frontend/src/pages/UserDashboard.jsx`)
- Donation status page → HTTP client: requests verification (evidence: `frontend/src/pages/DonationStatus.jsx`)
- Admin dashboard → HTTP client: requests admin data (evidence: `frontend/src/pages/AdminDashboard.jsx`)
- HTTP client → Express API server: sends API requests (evidence: `README.md`)
- Express API server → Database connection: connects database (evidence: `backend/server.js`)
- Express API server → Authentication endpoints: mounts routes (evidence: `backend/server.js`)
- Express API server → Donation endpoints: mounts routes (evidence: `backend/server.js`)
- Express API server → Admin endpoints: mounts routes (evidence: `backend/server.js`)
- Authentication endpoints → User records: reads and writes (evidence: `backend/routes/auth.routes.js`)
- JWT and role checks → User records: loads account (evidence: `backend/middleware/auth.js`)
- Donation endpoints → JWT and role checks: protects endpoints (evidence: `backend/routes/donation.routes.js`)
- Donation endpoints → Donation records: creates and updates (evidence: `backend/routes/donation.routes.js`)
- Donation endpoints → Stripe Checkout: creates and verifies (evidence: `backend/routes/donation.routes.js`)
- Admin endpoints → JWT and role checks: checks admin access (evidence: `backend/routes/admin.routes.js`)
- Admin endpoints → User records: queries registrations (evidence: `backend/routes/admin.routes.js`)
- Admin endpoints → Donation records: queries donation logs (evidence: `backend/routes/admin.routes.js`)
- Database connection → MongoDB: connects to (evidence: `README.md`)
- User records → MongoDB: persists users (evidence: `README.md`)
- Donation records → MongoDB: persists donations (evidence: `README.md`)
