# prajwal0426/project_v architecture

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

- Interactive diagram: https://gitdiagram.com/prajwal0426/project_v
- Repository: https://github.com/prajwal0426/project_v

## Overview

VERTEX is a learning-and-earning platform: users and companies register or sign in, users discover and submit projects, companies review submissions, and users track rankings and wallet activity. Administrators manage accounts and audit actions. The graph includes the React client, Express API, PostgreSQL-backed domain services, and documented PayPal integration. The source excerpts verify key auth, project, wallet, and admin operations; several page, route, and controller implementations were not sampled, so those links are omitted or marked unverified.

Main entry points: [`client/src/services/api.js`](https://github.com/prajwal0426/project_v/blob/master/client/src/services/api.js) (API client), [`server/src/app.js`](https://github.com/prajwal0426/project_v/blob/master/server/src/app.js) (Express API), [`server/src/config/db.js`](https://github.com/prajwal0426/project_v/blob/master/server/src/config/db.js) (PostgreSQL), [`server/src/routes/auth.routes.js`](https://github.com/prajwal0426/project_v/blob/master/server/src/routes/auth.routes.js) (Auth routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["React client"]
  node_webapp["Web application<br/>[App.jsx]"]
  node_authui["Auth state<br/>[AuthContext.jsx]"]
  node_api_client["API client<br/>[api.js]"]
  node_data_context["App data<br/>[AppDataContext.jsx]"]
  node_project_ui["Project pages<br/>[ProjectsPage.jsx]"]
  node_dashboard_ui["Dashboards<br/>[UserDashboard.jsx]"]
  node_ranking_ui["Rankings page<br/>[RankingsPage.jsx]"]
  node_wallet_ui["Wallet page<br/>[WalletPage.jsx]"]
  node_admin_ui["Admin pages"]
end

subgraph group_api["API and access"]
  node_express["Express API<br/>[app.js]"]
  node_auth_routes["Auth routes<br/>[auth.routes.js]"]
  node_admin_routes["Admin routes<br/>[admin.routes.js]"]
  node_auth_middleware["Access control<br/>[auth.middleware.js]"]
  node_uploads["ID uploads"]
end

subgraph group_learning["Learning and rankings"]
  node_project_routes["Project routes<br/>[project.routes.js]"]
  node_project_controller["Project workflow"]
  node_ranking_controller["Ranking API"]
  node_ranking_service["Monthly rankings<br/>[ranking.service.js]"]
  node_dashboard_controller["Dashboard data"]
end

subgraph group_finance["Wallet and payments"]
  node_wallet_controller["Wallet operations"]
  node_wallet_service["Coin conversion<br/>[wallet.service.js]"]
  node_paypal["PayPal adapter<br/>[paypal.service.js]"]
  node_paypal_service["PayPal service<br/>[paypal.service.js]"]
end

subgraph group_operations["Platform operations"]
  node_postgres[("PostgreSQL<br/>[db.js]")]
  node_migrations["Schema setup"]
  node_admin_controller["Account administration"]
  node_legal_service["Legal consent<br/>[legal.service.js]"]
end

node_user(("User"))
node_company(("Company"))
node_admin(("Administrator"))

node_user -->|"uses"| node_webapp
node_company -->|"uses"| node_webapp
node_admin -->|"uses"| node_webapp
node_webapp -.->|"hosts"| node_authui
node_authui -->|"authenticates via"| node_api_client
node_data_context -->|"loads data via"| node_api_client
node_project_ui -.->|"requests projects"| node_api_client
node_dashboard_ui -.->|"requests dashboard"| node_api_client
node_ranking_ui -.->|"requests rankings"| node_api_client
node_wallet_ui -.->|"requests wallet"| node_api_client
node_admin_ui -.->|"requests admin"| node_api_client
node_api_client -.->|"HTTP requests"| node_express
node_express -.->|"connects"| node_postgres
node_express -->|"runs at startup"| node_migrations
node_express -->|"starts schedule"| node_ranking_service
node_express -->|"mounts routes"| node_auth_routes
node_auth_routes -->|"guards routes"| node_auth_middleware
node_auth_routes -->|"handles ID files"| node_uploads
node_auth_routes -.->|"consent handled by"| node_legal_service
node_express -.->|"mounts via router"| node_admin_routes
node_admin_routes -->|"dispatches"| node_admin_controller
node_admin_routes -->|"guards routes"| node_auth_middleware
node_project_routes -->|"dispatches"| node_project_controller
node_project_controller -->|"reads and writes"| node_postgres
node_admin_controller -->|"reads and writes"| node_postgres
node_ranking_service -->|"updates rankings"| node_postgres
node_dashboard_controller -->|"queries data"| node_postgres
node_wallet_controller -->|"reads and writes"| node_postgres
node_wallet_controller -->|"converts coins"| node_wallet_service
node_wallet_controller -->|"requests payments"| node_paypal_service
node_paypal_service -.->|"connects optionally"| node_paypal

click node_webapp "https://github.com/prajwal0426/project_v/blob/master/client/src/App.jsx"
click node_authui "https://github.com/prajwal0426/project_v/blob/master/client/src/context/AuthContext.jsx"
click node_api_client "https://github.com/prajwal0426/project_v/blob/master/client/src/services/api.js"
click node_data_context "https://github.com/prajwal0426/project_v/blob/master/client/src/context/AppDataContext.jsx"
click node_project_ui "https://github.com/prajwal0426/project_v/blob/master/client/src/pages/ProjectsPage.jsx"
click node_dashboard_ui "https://github.com/prajwal0426/project_v/blob/master/client/src/pages/UserDashboard.jsx"
click node_ranking_ui "https://github.com/prajwal0426/project_v/blob/master/client/src/pages/RankingsPage.jsx"
click node_wallet_ui "https://github.com/prajwal0426/project_v/blob/master/client/src/pages/WalletPage.jsx"
click node_admin_ui "https://github.com/prajwal0426/project_v/blob/master/client/src/pages/AdminManagementPage.jsx"
click node_express "https://github.com/prajwal0426/project_v/blob/master/server/src/app.js"
click node_auth_routes "https://github.com/prajwal0426/project_v/blob/master/server/src/routes/auth.routes.js"
click node_admin_routes "https://github.com/prajwal0426/project_v/blob/master/server/src/routes/admin.routes.js"
click node_project_routes "https://github.com/prajwal0426/project_v/blob/master/server/src/routes/project.routes.js"
click node_project_controller "https://github.com/prajwal0426/project_v/blob/master/server/src/controllers/project.controller.js"
click node_ranking_controller "https://github.com/prajwal0426/project_v/blob/master/server/src/controllers/ranking.controller.js"
click node_ranking_service "https://github.com/prajwal0426/project_v/blob/master/server/src/services/ranking.service.js"
click node_dashboard_controller "https://github.com/prajwal0426/project_v/blob/master/server/src/controllers/dashboard.controller.js"
click node_wallet_controller "https://github.com/prajwal0426/project_v/blob/master/server/src/controllers/wallet.controller.js"
click node_wallet_service "https://github.com/prajwal0426/project_v/blob/master/server/src/services/wallet.service.js"
click node_paypal "https://github.com/prajwal0426/project_v/blob/master/server/src/services/paypal.service.js"
click node_postgres "https://github.com/prajwal0426/project_v/blob/master/server/src/config/db.js"
click node_migrations "https://github.com/prajwal0426/project_v/blob/master/server/src/services/migration.service.js"
click node_admin_controller "https://github.com/prajwal0426/project_v/blob/master/server/src/controllers/admin.controller.js"
click node_legal_service "https://github.com/prajwal0426/project_v/blob/master/server/src/services/legal.service.js"
click node_auth_middleware "https://github.com/prajwal0426/project_v/blob/master/server/src/middleware/auth.middleware.js"
click node_uploads "https://github.com/prajwal0426/project_v/blob/master/server/src/middleware/upload.middleware.js"
click node_paypal_service "https://github.com/prajwal0426/project_v/blob/master/server/src/services/paypal.service.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_webapp,node_authui,node_api_client,node_data_context,node_project_ui,node_dashboard_ui,node_ranking_ui,node_wallet_ui,node_admin_ui,node_user toneBlue
class node_express,node_auth_routes,node_admin_routes,node_auth_middleware,node_uploads toneAmber
class node_project_routes,node_project_controller,node_ranking_controller,node_ranking_service,node_dashboard_controller toneMint
class node_wallet_controller,node_wallet_service,node_paypal,node_paypal_service toneRose
class node_postgres,node_migrations,node_admin_controller,node_legal_service,node_company,node_admin toneIndigo
```

## Components

### React client

- [Web application](https://github.com/prajwal0426/project_v/blob/master/client/src/App.jsx): `client/src/App.jsx`
- [Auth state](https://github.com/prajwal0426/project_v/blob/master/client/src/context/AuthContext.jsx): `client/src/context/AuthContext.jsx`
- [API client](https://github.com/prajwal0426/project_v/blob/master/client/src/services/api.js): `client/src/services/api.js`
- [App data](https://github.com/prajwal0426/project_v/blob/master/client/src/context/AppDataContext.jsx): `client/src/context/AppDataContext.jsx`
- [Project pages](https://github.com/prajwal0426/project_v/blob/master/client/src/pages/ProjectsPage.jsx): `client/src/pages/ProjectsPage.jsx`
- [Dashboards](https://github.com/prajwal0426/project_v/blob/master/client/src/pages/UserDashboard.jsx): `client/src/pages/UserDashboard.jsx`
- [Rankings page](https://github.com/prajwal0426/project_v/blob/master/client/src/pages/RankingsPage.jsx): `client/src/pages/RankingsPage.jsx`
- [Wallet page](https://github.com/prajwal0426/project_v/blob/master/client/src/pages/WalletPage.jsx): `client/src/pages/WalletPage.jsx`
- [Admin pages](https://github.com/prajwal0426/project_v/blob/master/client/src/pages/AdminManagementPage.jsx): `client/src/pages/AdminManagementPage.jsx`

### API and access

- [Express API](https://github.com/prajwal0426/project_v/blob/master/server/src/app.js): `server/src/app.js`
- [Auth routes](https://github.com/prajwal0426/project_v/blob/master/server/src/routes/auth.routes.js): `server/src/routes/auth.routes.js`
- [Admin routes](https://github.com/prajwal0426/project_v/blob/master/server/src/routes/admin.routes.js): `server/src/routes/admin.routes.js`
- [Access control](https://github.com/prajwal0426/project_v/blob/master/server/src/middleware/auth.middleware.js): `server/src/middleware/auth.middleware.js`
- [ID uploads](https://github.com/prajwal0426/project_v/blob/master/server/src/middleware/upload.middleware.js): `server/src/middleware/upload.middleware.js`

### Learning and rankings

- [Project routes](https://github.com/prajwal0426/project_v/blob/master/server/src/routes/project.routes.js): `server/src/routes/project.routes.js`
- [Project workflow](https://github.com/prajwal0426/project_v/blob/master/server/src/controllers/project.controller.js): `server/src/controllers/project.controller.js`
- [Ranking API](https://github.com/prajwal0426/project_v/blob/master/server/src/controllers/ranking.controller.js): `server/src/controllers/ranking.controller.js`
- [Monthly rankings](https://github.com/prajwal0426/project_v/blob/master/server/src/services/ranking.service.js): `server/src/services/ranking.service.js`
- [Dashboard data](https://github.com/prajwal0426/project_v/blob/master/server/src/controllers/dashboard.controller.js): `server/src/controllers/dashboard.controller.js`

### Wallet and payments

- [Wallet operations](https://github.com/prajwal0426/project_v/blob/master/server/src/controllers/wallet.controller.js): `server/src/controllers/wallet.controller.js`
- [Coin conversion](https://github.com/prajwal0426/project_v/blob/master/server/src/services/wallet.service.js): `server/src/services/wallet.service.js`
- [PayPal adapter](https://github.com/prajwal0426/project_v/blob/master/server/src/services/paypal.service.js): `server/src/services/paypal.service.js`
- [PayPal service](https://github.com/prajwal0426/project_v/blob/master/server/src/services/paypal.service.js): `server/src/services/paypal.service.js`

### Platform operations

- [PostgreSQL](https://github.com/prajwal0426/project_v/blob/master/server/src/config/db.js): `server/src/config/db.js`
- [Schema setup](https://github.com/prajwal0426/project_v/blob/master/server/src/services/migration.service.js): `server/src/services/migration.service.js`
- [Account administration](https://github.com/prajwal0426/project_v/blob/master/server/src/controllers/admin.controller.js): `server/src/controllers/admin.controller.js`
- [Legal consent](https://github.com/prajwal0426/project_v/blob/master/server/src/services/legal.service.js): `server/src/services/legal.service.js`

### Other components

- **User**
- **Company**
- **Administrator**

## Connections

- User → Web application: uses
- Company → Web application: uses
- Administrator → Web application: uses
- Web application → Auth state: hosts
- Auth state → API client: authenticates via (evidence: `client/src/context/AuthContext.jsx`)
- App data → API client: loads data via (evidence: `client/src/context/AppDataContext.jsx`)
- Project pages → API client: requests projects
- Dashboards → API client: requests dashboard
- Rankings page → API client: requests rankings
- Wallet page → API client: requests wallet
- Admin pages → API client: requests admin
- API client → Express API: HTTP requests
- Express API → PostgreSQL: connects
- Express API → Schema setup: runs at startup (evidence: `server/src/app.js`)
- Express API → Monthly rankings: starts schedule (evidence: `server/src/app.js`)
- Express API → Auth routes: mounts routes (evidence: `server/src/app.js`)
- Auth routes → Access control: guards routes (evidence: `server/src/routes/auth.routes.js`)
- Auth routes → ID uploads: handles ID files (evidence: `server/src/routes/auth.routes.js`)
- Auth routes → Legal consent: consent handled by
- Express API → Admin routes: mounts via router
- Admin routes → Account administration: dispatches (evidence: `server/src/routes/admin.routes.js`)
- Admin routes → Access control: guards routes (evidence: `server/src/routes/admin.routes.js`)
- Project routes → Project workflow: dispatches (evidence: `server/src/routes/project.routes.js`)
- Project workflow → PostgreSQL: reads and writes (evidence: `server/src/controllers/project.controller.js`)
- Account administration → PostgreSQL: reads and writes (evidence: `server/src/controllers/admin.controller.js`)
- Monthly rankings → PostgreSQL: updates rankings (evidence: `server/src/services/ranking.service.js`)
- Dashboard data → PostgreSQL: queries data (evidence: `server/src/controllers/dashboard.controller.js`)
- Wallet operations → PostgreSQL: reads and writes (evidence: `server/src/controllers/wallet.controller.js`)
- Wallet operations → Coin conversion: converts coins (evidence: `server/src/controllers/wallet.controller.js`)
- Wallet operations → PayPal service: requests payments (evidence: `server/src/controllers/wallet.controller.js`)
- PayPal service → PayPal adapter: connects optionally
