# sarahabuirmeileh/express-serveandshine architecture

> Architecture diagram of the GitHub repository sarahabuirmeileh/express-serveandshine, 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/sarahabuirmeileh/express-serveandshine
- Repository: https://github.com/sarahabuirmeileh/express-serveandshine

## Overview

Serve & Shine is a volunteer-opportunity platform for volunteers and organizations. Its principal workflow is an authenticated API request to discover or manage opportunities, with volunteer profiles and skills supporting matching and recommendations; participation, feedback, and ratings round out the engagement lifecycle. Organization administration and role-based permissions are a separate control plane. The graph includes the documented recommendation and feedback capabilities, but their detailed implementation and most route-to-controller wiring were not sampled, so those links are omitted. AWS storage and logging are shown where source excerpts support them.

Main entry points: [`app.ts`](https://github.com/sarahabuirmeileh/express-serveandshine/blob/main/app.ts) (Express app), [`src/routes/voluntaryWork.ts`](https://github.com/sarahabuirmeileh/express-serveandshine/blob/main/src/routes/voluntaryWork.ts) (Opportunity routes), [`src/middleware/auth/authenticate.ts`](https://github.com/sarahabuirmeileh/express-serveandshine/blob/main/src/middleware/auth/authenticate.ts) (Authentication), [`src/middleware/auth/authorize.ts`](https://github.com/sarahabuirmeileh/express-serveandshine/blob/main/src/middleware/auth/authorize.ts) (Authorization)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API"]
  node_app["Express app<br/>[app.ts]"]
  node_work_routes["Opportunity routes<br/>[voluntaryWork.ts]"]
  node_volunteer_routes["Volunteer routes<br/>[volunteer.ts]"]
  node_org_profile_routes["Organization routes"]
  node_org_admin_routes["Admin routes"]
  node_role_routes["Role routes<br/>[role.ts]"]
  node_permission_routes["Permission routes<br/>[permission.ts]"]
  node_errors["Error handling<br/>[errorHandler.ts]"]
end

subgraph group_identity["Identity &amp; Access"]
  node_org_admin_controller["Organization admins"]
  node_role_controller["Role management<br/>[role.ts]"]
  node_permission_controller["Permission management<br/>[permission.ts]"]
  node_authenticate["Authentication<br/>[authenticate.ts]"]
  node_authorize["Authorization<br/>[authorize.ts]"]
end

subgraph group_volunteering["Volunteer Platform"]
  node_work_controller["Opportunity services<br/>[voluntaryWork.ts]"]
  node_volunteer_controller["Volunteer services<br/>[volunteer.ts]"]
  node_org_profile_controller["Organization profiles"]
end

subgraph group_data["Persistence"]
  node_data_source["MySQL connection<br/>[dataSource.ts]"]
  node_volunteer_entity["Volunteer records<br/>[Volunteer.ts]"]
  node_work_entity["Opportunity records<br/>[VoluntaryWork.ts]"]
  node_org_entity["Organization records"]
  node_admin_entity["Admin records"]
  node_role_entity["Roles<br/>[Role.ts]"]
  node_permission_entity["Permissions<br/>[Permission.ts]"]
  node_logs_entity["Event logs<br/>[Logs.ts]"]
end

subgraph group_integrations["AWS Integrations"]
  node_db_logger["Database logger<br/>[dataBaseLogger.ts]"]
  node_cloudwatch_controller["CloudWatch logging<br/>[CloudWatchLogs.ts]"]
  node_s3_controller["S3 file services<br/>[S3.ts]"]
end

node_user(("Volunteer / organization"))
node_s3["AWS S3"]
node_cloudwatch["AWS CloudWatch"]

node_user -->|"sends requests"| node_app
node_app -->|"mounts routes"| node_work_routes
node_app -->|"mounts routes"| node_volunteer_routes
node_app -->|"mounts routes"| node_org_profile_routes
node_app -->|"mounts routes"| node_org_admin_routes
node_app -->|"mounts routes"| node_role_routes
node_app -->|"mounts routes"| node_permission_routes
node_app -->|"guards routes"| node_authenticate
node_app -->|"handles errors"| node_errors
node_app -->|"initializes database"| node_data_source
node_authenticate -->|"looks up admin"| node_admin_entity
node_authenticate -->|"looks up volunteer"| node_volunteer_entity
node_authorize -->|"checks ownership"| node_admin_entity
node_authorize -->|"checks work access"| node_work_entity
node_work_routes -->|"calls services"| node_work_controller
node_work_routes -->|"looks up organization"| node_org_profile_controller
node_work_routes -->|"manages files"| node_s3_controller
node_s3_controller -->|"updates images"| node_work_entity
node_s3_controller -->|"uploads / deletes"| node_s3
node_authenticate -->|"records failures"| node_db_logger
node_authorize -->|"records failures"| node_db_logger
node_db_logger -->|"writes log entries"| node_logs_entity
node_cloudwatch_controller -->|"sends logs"| node_cloudwatch

click node_app "https://github.com/sarahabuirmeileh/express-serveandshine/blob/main/app.ts"
click node_work_routes "https://github.com/sarahabuirmeileh/express-serveandshine/blob/main/src/routes/voluntaryWork.ts"
click node_volunteer_routes "https://github.com/sarahabuirmeileh/express-serveandshine/blob/main/src/routes/volunteer.ts"
click node_org_profile_routes "https://github.com/sarahabuirmeileh/express-serveandshine/blob/main/src/routes/organizationProfile.ts"
click node_org_admin_routes "https://github.com/sarahabuirmeileh/express-serveandshine/blob/main/src/routes/organizationAdmin.ts"
click node_role_routes "https://github.com/sarahabuirmeileh/express-serveandshine/blob/main/src/routes/role.ts"
click node_permission_routes "https://github.com/sarahabuirmeileh/express-serveandshine/blob/main/src/routes/permission.ts"
click node_work_controller "https://github.com/sarahabuirmeileh/express-serveandshine/blob/main/src/controllers/voluntaryWork.ts"
click node_volunteer_controller "https://github.com/sarahabuirmeileh/express-serveandshine/blob/main/src/controllers/volunteer.ts"
click node_org_profile_controller "https://github.com/sarahabuirmeileh/express-serveandshine/blob/main/src/controllers/OrganizationProfile%20.ts"
click node_org_admin_controller "https://github.com/sarahabuirmeileh/express-serveandshine/blob/main/src/controllers/organizationAdmin.ts"
click node_role_controller "https://github.com/sarahabuirmeileh/express-serveandshine/blob/main/src/controllers/role.ts"
click node_permission_controller "https://github.com/sarahabuirmeileh/express-serveandshine/blob/main/src/controllers/permission.ts"
click node_authenticate "https://github.com/sarahabuirmeileh/express-serveandshine/blob/main/src/middleware/auth/authenticate.ts"
click node_authorize "https://github.com/sarahabuirmeileh/express-serveandshine/blob/main/src/middleware/auth/authorize.ts"
click node_errors "https://github.com/sarahabuirmeileh/express-serveandshine/blob/main/src/middleware/errorHandler/errorHandler.ts"
click node_data_source "https://github.com/sarahabuirmeileh/express-serveandshine/blob/main/src/db/dataSource.ts"
click node_volunteer_entity "https://github.com/sarahabuirmeileh/express-serveandshine/blob/main/src/db/entities/Volunteer.ts"
click node_work_entity "https://github.com/sarahabuirmeileh/express-serveandshine/blob/main/src/db/entities/VoluntaryWork.ts"
click node_org_entity "https://github.com/sarahabuirmeileh/express-serveandshine/blob/main/src/db/entities/OrganizationProfile.ts"
click node_admin_entity "https://github.com/sarahabuirmeileh/express-serveandshine/blob/main/src/db/entities/OrganizationAdmin.ts"
click node_role_entity "https://github.com/sarahabuirmeileh/express-serveandshine/blob/main/src/db/entities/Role.ts"
click node_permission_entity "https://github.com/sarahabuirmeileh/express-serveandshine/blob/main/src/db/entities/Permission.ts"
click node_logs_entity "https://github.com/sarahabuirmeileh/express-serveandshine/blob/main/src/db/entities/Logs.ts"
click node_db_logger "https://github.com/sarahabuirmeileh/express-serveandshine/blob/main/src/controllers/dataBaseLogger.ts"
click node_cloudwatch_controller "https://github.com/sarahabuirmeileh/express-serveandshine/blob/main/src/controllers/AWSServices/CloudWatchLogs.ts"
click node_s3_controller "https://github.com/sarahabuirmeileh/express-serveandshine/blob/main/src/controllers/AWSServices/S3.ts"

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_work_routes,node_volunteer_routes,node_org_profile_routes,node_org_admin_routes,node_role_routes,node_permission_routes,node_errors toneBlue
class node_org_admin_controller,node_role_controller,node_permission_controller,node_authenticate,node_authorize toneAmber
class node_work_controller,node_volunteer_controller,node_org_profile_controller toneMint
class node_data_source,node_volunteer_entity,node_work_entity,node_org_entity,node_admin_entity,node_role_entity,node_permission_entity,node_logs_entity toneRose
class node_db_logger,node_cloudwatch_controller,node_s3_controller,node_user,node_s3,node_cloudwatch toneIndigo
```

## Components

### API

- [Express app](https://github.com/sarahabuirmeileh/express-serveandshine/blob/main/app.ts): `app.ts`
- [Opportunity routes](https://github.com/sarahabuirmeileh/express-serveandshine/blob/main/src/routes/voluntaryWork.ts): `src/routes/voluntaryWork.ts`
- [Volunteer routes](https://github.com/sarahabuirmeileh/express-serveandshine/blob/main/src/routes/volunteer.ts): `src/routes/volunteer.ts`
- [Organization routes](https://github.com/sarahabuirmeileh/express-serveandshine/blob/main/src/routes/organizationProfile.ts): `src/routes/organizationProfile.ts`
- [Admin routes](https://github.com/sarahabuirmeileh/express-serveandshine/blob/main/src/routes/organizationAdmin.ts): `src/routes/organizationAdmin.ts`
- [Role routes](https://github.com/sarahabuirmeileh/express-serveandshine/blob/main/src/routes/role.ts): `src/routes/role.ts`
- [Permission routes](https://github.com/sarahabuirmeileh/express-serveandshine/blob/main/src/routes/permission.ts): `src/routes/permission.ts`
- [Error handling](https://github.com/sarahabuirmeileh/express-serveandshine/blob/main/src/middleware/errorHandler/errorHandler.ts): `src/middleware/errorHandler/errorHandler.ts`

### Identity & Access

- [Organization admins](https://github.com/sarahabuirmeileh/express-serveandshine/blob/main/src/controllers/organizationAdmin.ts): `src/controllers/organizationAdmin.ts`
- [Role management](https://github.com/sarahabuirmeileh/express-serveandshine/blob/main/src/controllers/role.ts): `src/controllers/role.ts`
- [Permission management](https://github.com/sarahabuirmeileh/express-serveandshine/blob/main/src/controllers/permission.ts): `src/controllers/permission.ts`
- [Authentication](https://github.com/sarahabuirmeileh/express-serveandshine/blob/main/src/middleware/auth/authenticate.ts): `src/middleware/auth/authenticate.ts`
- [Authorization](https://github.com/sarahabuirmeileh/express-serveandshine/blob/main/src/middleware/auth/authorize.ts): `src/middleware/auth/authorize.ts`

### Volunteer Platform

- [Opportunity services](https://github.com/sarahabuirmeileh/express-serveandshine/blob/main/src/controllers/voluntaryWork.ts): `src/controllers/voluntaryWork.ts`
- [Volunteer services](https://github.com/sarahabuirmeileh/express-serveandshine/blob/main/src/controllers/volunteer.ts): `src/controllers/volunteer.ts`
- [Organization profiles](https://github.com/sarahabuirmeileh/express-serveandshine/blob/main/src/controllers/OrganizationProfile%20.ts): `src/controllers/OrganizationProfile .ts`

### Persistence

- [MySQL connection](https://github.com/sarahabuirmeileh/express-serveandshine/blob/main/src/db/dataSource.ts): `src/db/dataSource.ts`
- [Volunteer records](https://github.com/sarahabuirmeileh/express-serveandshine/blob/main/src/db/entities/Volunteer.ts): `src/db/entities/Volunteer.ts`
- [Opportunity records](https://github.com/sarahabuirmeileh/express-serveandshine/blob/main/src/db/entities/VoluntaryWork.ts): `src/db/entities/VoluntaryWork.ts`
- [Organization records](https://github.com/sarahabuirmeileh/express-serveandshine/blob/main/src/db/entities/OrganizationProfile.ts): `src/db/entities/OrganizationProfile.ts`
- [Admin records](https://github.com/sarahabuirmeileh/express-serveandshine/blob/main/src/db/entities/OrganizationAdmin.ts): `src/db/entities/OrganizationAdmin.ts`
- [Roles](https://github.com/sarahabuirmeileh/express-serveandshine/blob/main/src/db/entities/Role.ts): `src/db/entities/Role.ts`
- [Permissions](https://github.com/sarahabuirmeileh/express-serveandshine/blob/main/src/db/entities/Permission.ts): `src/db/entities/Permission.ts`
- [Event logs](https://github.com/sarahabuirmeileh/express-serveandshine/blob/main/src/db/entities/Logs.ts): `src/db/entities/Logs.ts`

### AWS Integrations

- [Database logger](https://github.com/sarahabuirmeileh/express-serveandshine/blob/main/src/controllers/dataBaseLogger.ts): `src/controllers/dataBaseLogger.ts`
- [CloudWatch logging](https://github.com/sarahabuirmeileh/express-serveandshine/blob/main/src/controllers/AWSServices/CloudWatchLogs.ts): `src/controllers/AWSServices/CloudWatchLogs.ts`
- [S3 file services](https://github.com/sarahabuirmeileh/express-serveandshine/blob/main/src/controllers/AWSServices/S3.ts): `src/controllers/AWSServices/S3.ts`

### Other components

- **Volunteer / organization**
- **AWS S3**
- **AWS CloudWatch**

## Connections

- Volunteer / organization → Express app: sends requests
- Express app → Opportunity routes: mounts routes
- Express app → Volunteer routes: mounts routes
- Express app → Organization routes: mounts routes
- Express app → Admin routes: mounts routes
- Express app → Role routes: mounts routes
- Express app → Permission routes: mounts routes
- Express app → Authentication: guards routes
- Express app → Error handling: handles errors
- Express app → MySQL connection: initializes database
- Authentication → Admin records: looks up admin
- Authentication → Volunteer records: looks up volunteer
- Authorization → Admin records: checks ownership
- Authorization → Opportunity records: checks work access
- Opportunity routes → Opportunity services: calls services
- Opportunity routes → Organization profiles: looks up organization
- Opportunity routes → S3 file services: manages files
- S3 file services → Opportunity records: updates images
- S3 file services → AWS S3: uploads / deletes
- Authentication → Database logger: records failures
- Authorization → Database logger: records failures
- Database logger → Event logs: writes log entries
- CloudWatch logging → AWS CloudWatch: sends logs
