# charan512/ace architecture

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

- Interactive diagram: https://gitdiagram.com/charan512/ace
- Repository: https://github.com/charan512/ace

## Overview

ACE Web Portal serves guests, members, event staff, administrators, and treasurers. The primary workflow is event discovery and registration, payment initiation and verification, then attendance and member access; operations and administration provide event setup, check-in, reporting, certificates, and communications. The graph combines documented capabilities with sampled routes, calls, and model references. Some portal and integration details are documented but their implementation was not sampled, so those links cite the README.

Main entry points: [`client/src/App.jsx`](https://github.com/charan512/ace/blob/main/client/src/App.jsx) (Portal router), [`server/src/controllers`](https://github.com/charan512/ace/tree/main/server/src/controllers) (Admin and check-in), [`server/src/routes`](https://github.com/charan512/ace/tree/main/server/src/routes) (API routes), [`server/src/controllers/payment.controller.js`](https://github.com/charan512/ace/blob/main/server/src/controllers/payment.controller.js) (Payment processing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["React portals"]
  node_portals["Portal router<br/>[App.jsx]"]
  node_public["Guest portal"]
  node_member["Member portal<br/>[MemberProfile.jsx]"]
  node_ops["Ops hub<br/>[OpsDashboard.jsx]"]
  node_admin["Admin portal<br/>[AdminEvents.jsx]"]
  node_treasurer["Treasurer portal"]
  node_authstate["Auth state<br/>[useAuthStore.js]"]
end

subgraph group_api["API and access"]
  node_http["API client<br/>[api.js]"]
  node_server["Express API<br/>[index.js]"]
  node_routes["API routes"]
  node_auth["JWT and roles<br/>[auth.middleware.js]"]
end

subgraph group_events["Events and finance"]
  node_events["Event management"]
  node_payments["Payment processing"]
  node_records[("Event and payment records")]
end

subgraph group_operations["Operations and administration"]
  node_adminops["Admin and check-in"]
  node_certificates["Certificate rendering<br/>[certRenderer.js]"]
end

subgraph group_async["Background services"]
  node_redis["Redis queues<br/>[redis.js]"]
  node_workers["Job workers"]
end

node_visitor(("Visitor or member"))
node_phonepe["PhonePe gateway"]
node_email["Email service"]

node_visitor -->|"uses"| node_portals
node_portals -->|"routes to"| node_public
node_portals -->|"routes to"| node_member
node_portals -->|"routes to"| node_ops
node_portals -->|"routes to"| node_admin
node_portals -.->|"routes to"| node_treasurer
node_member -->|"uses"| node_authstate
node_authstate -->|"calls"| node_http
node_portals -.->|"requests"| node_http
node_http -.->|"sends API requests"| node_server
node_server -->|"mounts"| node_routes
node_routes -->|"guards routes"| node_auth
node_routes -->|"dispatches"| node_events
node_routes -->|"dispatches"| node_payments
node_routes -->|"dispatches"| node_adminops
node_public -.->|"discovers events"| node_events
node_public -.->|"checks out"| node_payments
node_member -.->|"registers"| node_payments
node_payments -->|"initiates and verifies"| node_phonepe
node_payments -->|"reads and writes"| node_records
node_events -->|"reads and writes"| node_records
node_adminops -->|"manages"| node_records
node_adminops -->|"enqueues jobs"| node_redis
node_admin -.->|"configures events"| node_adminops
node_ops -.->|"checks in attendees"| node_adminops
node_adminops -.->|"renders certificates"| node_certificates
node_redis -->|"feeds jobs"| node_workers
node_workers -->|"sends messages"| node_email

click node_portals "https://github.com/charan512/ace/blob/main/client/src/App.jsx"
click node_public "https://github.com/charan512/ace/tree/main/client/src/pages"
click node_member "https://github.com/charan512/ace/blob/main/client/src/pages/MemberProfile.jsx"
click node_ops "https://github.com/charan512/ace/blob/main/client/src/pages/OpsDashboard.jsx"
click node_admin "https://github.com/charan512/ace/blob/main/client/src/pages/AdminEvents.jsx"
click node_treasurer "https://github.com/charan512/ace/tree/main/client/src/pages"
click node_authstate "https://github.com/charan512/ace/blob/main/client/src/store/useAuthStore.js"
click node_http "https://github.com/charan512/ace/blob/main/client/src/lib/api.js"
click node_server "https://github.com/charan512/ace/blob/main/server/src/index.js"
click node_routes "https://github.com/charan512/ace/tree/main/server/src/routes"
click node_auth "https://github.com/charan512/ace/blob/main/server/src/middleware/auth.middleware.js"
click node_events "https://github.com/charan512/ace/blob/main/server/src/controllers/event.controller.js"
click node_payments "https://github.com/charan512/ace/blob/main/server/src/controllers/payment.controller.js"
click node_records "https://github.com/charan512/ace/tree/main/server/src/models"
click node_adminops "https://github.com/charan512/ace/tree/main/server/src/controllers"
click node_certificates "https://github.com/charan512/ace/blob/main/server/src/utils/certRenderer.js"
click node_redis "https://github.com/charan512/ace/blob/main/server/src/config/redis.js"
click node_workers "https://github.com/charan512/ace/tree/main/server/src/workers"

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_portals,node_public,node_member,node_ops,node_admin,node_treasurer,node_authstate toneBlue
class node_http,node_server,node_routes,node_auth toneAmber
class node_events,node_payments,node_records toneMint
class node_adminops,node_certificates toneRose
class node_redis,node_workers,node_visitor,node_phonepe,node_email toneIndigo
```

## Components

### React portals

- [Portal router](https://github.com/charan512/ace/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Guest portal](https://github.com/charan512/ace/tree/main/client/src/pages): `client/src/pages`
- [Member portal](https://github.com/charan512/ace/blob/main/client/src/pages/MemberProfile.jsx): `client/src/pages/MemberProfile.jsx`
- [Ops hub](https://github.com/charan512/ace/blob/main/client/src/pages/OpsDashboard.jsx): `client/src/pages/OpsDashboard.jsx`
- [Admin portal](https://github.com/charan512/ace/blob/main/client/src/pages/AdminEvents.jsx): `client/src/pages/AdminEvents.jsx`
- [Treasurer portal](https://github.com/charan512/ace/tree/main/client/src/pages): `client/src/pages`
- [Auth state](https://github.com/charan512/ace/blob/main/client/src/store/useAuthStore.js): `client/src/store/useAuthStore.js`

### API and access

- [API client](https://github.com/charan512/ace/blob/main/client/src/lib/api.js): `client/src/lib/api.js`
- [Express API](https://github.com/charan512/ace/blob/main/server/src/index.js): `server/src/index.js`
- [API routes](https://github.com/charan512/ace/tree/main/server/src/routes): `server/src/routes`
- [JWT and roles](https://github.com/charan512/ace/blob/main/server/src/middleware/auth.middleware.js): `server/src/middleware/auth.middleware.js`

### Events and finance

- [Event management](https://github.com/charan512/ace/blob/main/server/src/controllers/event.controller.js): `server/src/controllers/event.controller.js`
- [Payment processing](https://github.com/charan512/ace/blob/main/server/src/controllers/payment.controller.js): `server/src/controllers/payment.controller.js`
- [Event and payment records](https://github.com/charan512/ace/tree/main/server/src/models): `server/src/models`

### Operations and administration

- [Admin and check-in](https://github.com/charan512/ace/tree/main/server/src/controllers): `server/src/controllers`
- [Certificate rendering](https://github.com/charan512/ace/blob/main/server/src/utils/certRenderer.js): `server/src/utils/certRenderer.js`

### Background services

- [Redis queues](https://github.com/charan512/ace/blob/main/server/src/config/redis.js): `server/src/config/redis.js`
- [Job workers](https://github.com/charan512/ace/tree/main/server/src/workers): `server/src/workers`

### Other components

- **Visitor or member**
- **PhonePe gateway**
- **Email service**

## Connections

- Visitor or member → Portal router: uses
- Portal router → Guest portal: routes to (evidence: `client/src/App.jsx`)
- Portal router → Member portal: routes to (evidence: `client/src/App.jsx`)
- Portal router → Ops hub: routes to (evidence: `client/src/App.jsx`)
- Portal router → Admin portal: routes to (evidence: `client/src/App.jsx`)
- Portal router → Treasurer portal: routes to (evidence: `client/src/App.jsx`)
- Member portal → Auth state: uses
- Auth state → API client: calls (evidence: `client/src/store/useAuthStore.js`)
- Portal router → API client: requests
- API client → Express API: sends API requests
- Express API → API routes: mounts (evidence: `server/src/index.js`)
- API routes → JWT and roles: guards routes (evidence: `server/src/routes/auth.routes.js`)
- API routes → Event management: dispatches (evidence: `server/src/routes/admin.routes.js`)
- API routes → Payment processing: dispatches (evidence: `server/src/routes/payment.routes.js`)
- API routes → Admin and check-in: dispatches (evidence: `server/src/routes/ops.routes.js`)
- Guest portal → Event management: discovers events
- Guest portal → Payment processing: checks out
- Member portal → Payment processing: registers
- Payment processing → PhonePe gateway: initiates and verifies (evidence: `server/src/controllers/payment.controller.js`)
- Payment processing → Event and payment records: reads and writes (evidence: `server/src/controllers/payment.controller.js`)
- Event management → Event and payment records: reads and writes (evidence: `server/src/controllers/event.controller.js`)
- Admin and check-in → Event and payment records: manages (evidence: `server/src/controllers/admin.controller.js`)
- Admin and check-in → Redis queues: enqueues jobs (evidence: `server/src/controllers/admin.controller.js`)
- Admin portal → Admin and check-in: configures events
- Ops hub → Admin and check-in: checks in attendees
- Admin and check-in → Certificate rendering: renders certificates
- Redis queues → Job workers: feeds jobs (evidence: `server/src/workers/certificateWorker.js`)
- Job workers → Email service: sends messages (evidence: `server/src/workers/emailWorker.js`)
