# aronlama10/studentresourcehub architecture

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

- Interactive diagram: https://gitdiagram.com/aronlama10/studentresourcehub
- Repository: https://github.com/aronlama10/studentresourcehub

## Overview

This repository is a student resource-sharing hub, with a newer frontend-v2 client, an Express API, and an older frontend client also present in the tree. The main workflow is that students browse or upload resources, uploads enter moderation, and approved resources can be saved or reported; moderators review resource and report queues, while admins manage users. The graph emphasizes frontend-v2 and the backend. Edges are limited to relationships visible in excerpts or the SOURCE INDEX; unsampled feature modules are included where their paths and product responsibilities are clear, without guessing their calls.

Main entry points: [`frontend-v2/src/App.jsx`](https://github.com/aronlama10/studentresourcehub/blob/main/frontend-v2/src/App.jsx) (Routes and app), [`frontend-v2/src/services/api.js`](https://github.com/aronlama10/studentresourcehub/blob/main/frontend-v2/src/services/api.js) (HTTP API client), [`backend/index.js`](https://github.com/aronlama10/studentresourcehub/blob/main/backend/index.js) (Express server), [`frontend-v2/src/pages/dashboard/Resources.jsx`](https://github.com/aronlama10/studentresourcehub/blob/main/frontend-v2/src/pages/dashboard/Resources.jsx) (Resource browsing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Student client"]
  node_app["Routes and app<br/>[App.jsx]"]
  node_authpages["Login and signup<br/>[Signup.jsx]"]
  node_authservice["Authentication client<br/>[authService.js]"]
  node_browse["Resource browsing<br/>[Resources.jsx]"]
  node_upload["Resource uploads<br/>[Upload.jsx]"]
  node_myresources["My resources<br/>[MyResources.jsx]"]
  node_saved["Saved resources<br/>[SavedResources.jsx]"]
  node_profile["Profile and streak<br/>[Profile.jsx]"]
  node_adminui["Moderation and admin"]
  node_useradmin["Admin user management<br/>[AdminUsers.jsx]"]
  node_api["HTTP API client<br/>[api.js]"]
  node_resourceclient["Resource service<br/>[resourceService.js]"]
  node_adminclient["Admin service<br/>[adminService.js]"]
  node_savedclient["Saved service<br/>[savedService.js]"]
  node_reportclient["Report service<br/>[reportService.js]"]
end

subgraph group_api["API and access"]
  node_backend["Express server<br/>[index.js]"]
  node_authroutes["Authentication routes<br/>[AuthRouter.js]"]
  node_resourceroutes["Resource routes<br/>[ResourceRouter.js]"]
  node_userroutes["User routes<br/>[UserRouter.js]"]
  node_reportroutes["Report routes<br/>[ReportRouter.js]"]
  node_authguard["JWT and roles<br/>[Auth.js]"]
end

subgraph group_resources["Resource lifecycle"]
  node_resourcecontroller["Resource operations"]
  node_resourcefile["Upload validation<br/>[Upload.js]"]
  node_resource[("Resource records<br/>[Resource.js]")]
  node_cloudinary["Cloudinary files<br/>[cloudinary.js]"]
end

subgraph group_accounts["Accounts and reports"]
  node_usercontroller["Profile and saved actions<br/>[UserController.js]"]
  node_admincontroller["User administration"]
  node_authcontroller["Signup and login<br/>[AuthController.js]"]
  node_user[("User records<br/>[User.js]")]
  node_reportcontroller["Report workflow"]
  node_report[("Report records<br/>[Report.js]")]
end

node_student(("Student"))
node_moderator(("Moderator"))
node_administrator(("Administrator"))

node_student -->|"uses"| node_app
node_moderator -->|"uses"| node_app
node_administrator -->|"uses"| node_app
node_app -->|"routes to"| node_authpages
node_app -->|"routes to"| node_browse
node_app -->|"routes to"| node_upload
node_app -->|"routes to"| node_myresources
node_app -->|"routes to"| node_saved
node_app -->|"routes to"| node_profile
node_app -->|"routes to"| node_adminui
node_app -->|"routes to"| node_useradmin
node_authpages -->|"authenticates via"| node_authservice
node_authservice -->|"posts auth requests"| node_api
node_browse -->|"uses"| node_resourceclient
node_browse -->|"uses"| node_savedclient
node_browse -->|"uses"| node_reportclient
node_upload -.->|"submits"| node_resourceclient
node_myresources -.->|"manages"| node_resourceclient
node_saved -.->|"uses"| node_savedclient
node_profile -.->|"uses"| node_api
node_adminui -.->|"uses"| node_adminclient
node_useradmin -->|"uses"| node_adminclient
node_resourceclient -.->|"uses"| node_api
node_adminclient -->|"uses"| node_api
node_savedclient -.->|"uses"| node_api
node_reportclient -.->|"uses"| node_api
node_backend -->|"mounts"| node_authroutes
node_backend -->|"mounts"| node_resourceroutes
node_backend -->|"mounts"| node_userroutes
node_backend -->|"mounts"| node_reportroutes
node_authroutes -->|"dispatches"| node_authcontroller
node_resourceroutes -->|"dispatches"| node_resourcecontroller
node_resourceroutes -->|"validates uploads"| node_resourcefile
node_resourceroutes -->|"guards routes"| node_authguard
node_userroutes -->|"guards routes"| node_authguard
node_userroutes -->|"dispatches"| node_usercontroller
node_userroutes -->|"dispatches"| node_admincontroller
node_reportroutes -->|"dispatches"| node_reportcontroller
node_reportroutes -->|"guards routes"| node_authguard
node_resourcecontroller -->|"reads and writes"| node_resource
node_resourcecontroller -->|"uploads files"| node_cloudinary
node_resourcecontroller -.->|"uses user identity"| node_user
node_usercontroller -->|"reads and writes"| node_user
node_admincontroller -->|"reads and writes"| node_user
node_authcontroller -->|"authenticates users"| node_user
node_reportcontroller -->|"reads and writes"| node_report
node_reportcontroller -->|"checks resource"| node_resource

click node_app "https://github.com/aronlama10/studentresourcehub/blob/main/frontend-v2/src/App.jsx"
click node_authpages "https://github.com/aronlama10/studentresourcehub/blob/main/frontend-v2/src/pages/Signup.jsx"
click node_authservice "https://github.com/aronlama10/studentresourcehub/blob/main/frontend-v2/src/services/authService.js"
click node_browse "https://github.com/aronlama10/studentresourcehub/blob/main/frontend-v2/src/pages/dashboard/Resources.jsx"
click node_upload "https://github.com/aronlama10/studentresourcehub/blob/main/frontend-v2/src/pages/dashboard/Upload.jsx"
click node_myresources "https://github.com/aronlama10/studentresourcehub/blob/main/frontend-v2/src/pages/dashboard/MyResources.jsx"
click node_saved "https://github.com/aronlama10/studentresourcehub/blob/main/frontend-v2/src/pages/dashboard/SavedResources.jsx"
click node_profile "https://github.com/aronlama10/studentresourcehub/blob/main/frontend-v2/src/pages/dashboard/Profile.jsx"
click node_adminui "https://github.com/aronlama10/studentresourcehub/blob/main/frontend-v2/src/pages/admin/PendingResources.jsx"
click node_useradmin "https://github.com/aronlama10/studentresourcehub/blob/main/frontend-v2/src/pages/admin/AdminUsers.jsx"
click node_api "https://github.com/aronlama10/studentresourcehub/blob/main/frontend-v2/src/services/api.js"
click node_resourceclient "https://github.com/aronlama10/studentresourcehub/blob/main/frontend-v2/src/services/resourceService.js"
click node_adminclient "https://github.com/aronlama10/studentresourcehub/blob/main/frontend-v2/src/services/adminService.js"
click node_savedclient "https://github.com/aronlama10/studentresourcehub/blob/main/frontend-v2/src/services/savedService.js"
click node_reportclient "https://github.com/aronlama10/studentresourcehub/blob/main/frontend-v2/src/services/reportService.js"
click node_backend "https://github.com/aronlama10/studentresourcehub/blob/main/backend/index.js"
click node_authroutes "https://github.com/aronlama10/studentresourcehub/blob/main/backend/routes/AuthRouter.js"
click node_resourceroutes "https://github.com/aronlama10/studentresourcehub/blob/main/backend/routes/ResourceRouter.js"
click node_userroutes "https://github.com/aronlama10/studentresourcehub/blob/main/backend/routes/UserRouter.js"
click node_reportroutes "https://github.com/aronlama10/studentresourcehub/blob/main/backend/routes/ReportRouter.js"
click node_authguard "https://github.com/aronlama10/studentresourcehub/blob/main/backend/middlewares/Auth.js"
click node_resourcecontroller "https://github.com/aronlama10/studentresourcehub/blob/main/backend/controllers/ResourceController.js"
click node_resourcefile "https://github.com/aronlama10/studentresourcehub/blob/main/backend/middlewares/Upload.js"
click node_resource "https://github.com/aronlama10/studentresourcehub/blob/main/backend/models/Resource.js"
click node_cloudinary "https://github.com/aronlama10/studentresourcehub/blob/main/backend/config/cloudinary.js"
click node_usercontroller "https://github.com/aronlama10/studentresourcehub/blob/main/backend/controllers/UserController.js"
click node_admincontroller "https://github.com/aronlama10/studentresourcehub/blob/main/backend/controllers/AdminUserController.js"
click node_authcontroller "https://github.com/aronlama10/studentresourcehub/blob/main/backend/controllers/AuthController.js"
click node_user "https://github.com/aronlama10/studentresourcehub/blob/main/backend/models/User.js"
click node_reportcontroller "https://github.com/aronlama10/studentresourcehub/blob/main/backend/controllers/ReportController.js"
click node_report "https://github.com/aronlama10/studentresourcehub/blob/main/backend/models/Report.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_authpages,node_authservice,node_browse,node_upload,node_myresources,node_saved,node_profile,node_adminui,node_useradmin,node_api,node_resourceclient,node_adminclient,node_savedclient,node_reportclient toneBlue
class node_backend,node_authroutes,node_resourceroutes,node_userroutes,node_reportroutes,node_authguard toneAmber
class node_resourcecontroller,node_resourcefile,node_resource,node_cloudinary toneMint
class node_usercontroller,node_admincontroller,node_authcontroller,node_user,node_reportcontroller,node_report toneRose
class node_student,node_moderator,node_administrator toneIndigo
```

## Components

### Student client

- [Routes and app](https://github.com/aronlama10/studentresourcehub/blob/main/frontend-v2/src/App.jsx): `frontend-v2/src/App.jsx`
- [Login and signup](https://github.com/aronlama10/studentresourcehub/blob/main/frontend-v2/src/pages/Signup.jsx): `frontend-v2/src/pages/Signup.jsx`
- [Authentication client](https://github.com/aronlama10/studentresourcehub/blob/main/frontend-v2/src/services/authService.js): `frontend-v2/src/services/authService.js`
- [Resource browsing](https://github.com/aronlama10/studentresourcehub/blob/main/frontend-v2/src/pages/dashboard/Resources.jsx): `frontend-v2/src/pages/dashboard/Resources.jsx`
- [Resource uploads](https://github.com/aronlama10/studentresourcehub/blob/main/frontend-v2/src/pages/dashboard/Upload.jsx): `frontend-v2/src/pages/dashboard/Upload.jsx`
- [My resources](https://github.com/aronlama10/studentresourcehub/blob/main/frontend-v2/src/pages/dashboard/MyResources.jsx): `frontend-v2/src/pages/dashboard/MyResources.jsx`
- [Saved resources](https://github.com/aronlama10/studentresourcehub/blob/main/frontend-v2/src/pages/dashboard/SavedResources.jsx): `frontend-v2/src/pages/dashboard/SavedResources.jsx`
- [Profile and streak](https://github.com/aronlama10/studentresourcehub/blob/main/frontend-v2/src/pages/dashboard/Profile.jsx): `frontend-v2/src/pages/dashboard/Profile.jsx`
- [Moderation and admin](https://github.com/aronlama10/studentresourcehub/blob/main/frontend-v2/src/pages/admin/PendingResources.jsx): `frontend-v2/src/pages/admin/PendingResources.jsx`
- [Admin user management](https://github.com/aronlama10/studentresourcehub/blob/main/frontend-v2/src/pages/admin/AdminUsers.jsx): `frontend-v2/src/pages/admin/AdminUsers.jsx`
- [HTTP API client](https://github.com/aronlama10/studentresourcehub/blob/main/frontend-v2/src/services/api.js): `frontend-v2/src/services/api.js`
- [Resource service](https://github.com/aronlama10/studentresourcehub/blob/main/frontend-v2/src/services/resourceService.js): `frontend-v2/src/services/resourceService.js`
- [Admin service](https://github.com/aronlama10/studentresourcehub/blob/main/frontend-v2/src/services/adminService.js): `frontend-v2/src/services/adminService.js`
- [Saved service](https://github.com/aronlama10/studentresourcehub/blob/main/frontend-v2/src/services/savedService.js): `frontend-v2/src/services/savedService.js`
- [Report service](https://github.com/aronlama10/studentresourcehub/blob/main/frontend-v2/src/services/reportService.js): `frontend-v2/src/services/reportService.js`

### API and access

- [Express server](https://github.com/aronlama10/studentresourcehub/blob/main/backend/index.js): `backend/index.js`
- [Authentication routes](https://github.com/aronlama10/studentresourcehub/blob/main/backend/routes/AuthRouter.js): `backend/routes/AuthRouter.js`
- [Resource routes](https://github.com/aronlama10/studentresourcehub/blob/main/backend/routes/ResourceRouter.js): `backend/routes/ResourceRouter.js`
- [User routes](https://github.com/aronlama10/studentresourcehub/blob/main/backend/routes/UserRouter.js): `backend/routes/UserRouter.js`
- [Report routes](https://github.com/aronlama10/studentresourcehub/blob/main/backend/routes/ReportRouter.js): `backend/routes/ReportRouter.js`
- [JWT and roles](https://github.com/aronlama10/studentresourcehub/blob/main/backend/middlewares/Auth.js): `backend/middlewares/Auth.js`

### Resource lifecycle

- [Resource operations](https://github.com/aronlama10/studentresourcehub/blob/main/backend/controllers/ResourceController.js): `backend/controllers/ResourceController.js`
- [Upload validation](https://github.com/aronlama10/studentresourcehub/blob/main/backend/middlewares/Upload.js): `backend/middlewares/Upload.js`
- [Resource records](https://github.com/aronlama10/studentresourcehub/blob/main/backend/models/Resource.js): `backend/models/Resource.js`
- [Cloudinary files](https://github.com/aronlama10/studentresourcehub/blob/main/backend/config/cloudinary.js): `backend/config/cloudinary.js`

### Accounts and reports

- [Profile and saved actions](https://github.com/aronlama10/studentresourcehub/blob/main/backend/controllers/UserController.js): `backend/controllers/UserController.js`
- [User administration](https://github.com/aronlama10/studentresourcehub/blob/main/backend/controllers/AdminUserController.js): `backend/controllers/AdminUserController.js`
- [Signup and login](https://github.com/aronlama10/studentresourcehub/blob/main/backend/controllers/AuthController.js): `backend/controllers/AuthController.js`
- [User records](https://github.com/aronlama10/studentresourcehub/blob/main/backend/models/User.js): `backend/models/User.js`
- [Report workflow](https://github.com/aronlama10/studentresourcehub/blob/main/backend/controllers/ReportController.js): `backend/controllers/ReportController.js`
- [Report records](https://github.com/aronlama10/studentresourcehub/blob/main/backend/models/Report.js): `backend/models/Report.js`

### Other components

- **Student**
- **Moderator**
- **Administrator**

## Connections

- Student → Routes and app: uses (evidence: `frontend-v2/src/App.jsx`)
- Moderator → Routes and app: uses (evidence: `frontend-v2/src/App.jsx`)
- Administrator → Routes and app: uses (evidence: `frontend-v2/src/App.jsx`)
- Routes and app → Login and signup: routes to (evidence: `frontend-v2/src/App.jsx`)
- Routes and app → Resource browsing: routes to (evidence: `frontend-v2/src/App.jsx`)
- Routes and app → Resource uploads: routes to (evidence: `frontend-v2/src/App.jsx`)
- Routes and app → My resources: routes to (evidence: `frontend-v2/src/App.jsx`)
- Routes and app → Saved resources: routes to (evidence: `frontend-v2/src/App.jsx`)
- Routes and app → Profile and streak: routes to (evidence: `frontend-v2/src/App.jsx`)
- Routes and app → Moderation and admin: routes to (evidence: `frontend-v2/src/App.jsx`)
- Routes and app → Admin user management: routes to (evidence: `frontend-v2/src/App.jsx`)
- Login and signup → Authentication client: authenticates via (evidence: `frontend-v2/src/pages/Signup.jsx`)
- Authentication client → HTTP API client: posts auth requests (evidence: `frontend-v2/src/services/authService.js`)
- Resource browsing → Resource service: uses (evidence: `frontend-v2/src/pages/dashboard/Resources.jsx`)
- Resource browsing → Saved service: uses (evidence: `frontend-v2/src/pages/dashboard/Resources.jsx`)
- Resource browsing → Report service: uses (evidence: `frontend-v2/src/pages/dashboard/Resources.jsx`)
- Resource uploads → Resource service: submits
- My resources → Resource service: manages
- Saved resources → Saved service: uses
- Profile and streak → HTTP API client: uses
- Moderation and admin → Admin service: uses
- Admin user management → Admin service: uses (evidence: `frontend-v2/src/pages/admin/AdminUsers.jsx`)
- Resource service → HTTP API client: uses
- Admin service → HTTP API client: uses (evidence: `frontend-v2/src/services/adminService.js`)
- Saved service → HTTP API client: uses
- Report service → HTTP API client: uses
- Express server → Authentication routes: mounts (evidence: `backend/index.js`)
- Express server → Resource routes: mounts (evidence: `backend/index.js`)
- Express server → User routes: mounts (evidence: `backend/index.js`)
- Express server → Report routes: mounts (evidence: `backend/index.js`)
- Authentication routes → Signup and login: dispatches (evidence: `backend/routes/AuthRouter.js`)
- Resource routes → Resource operations: dispatches (evidence: `backend/routes/ResourceRouter.js`)
- Resource routes → Upload validation: validates uploads (evidence: `backend/routes/ResourceRouter.js`)
- Resource routes → JWT and roles: guards routes (evidence: `backend/routes/ResourceRouter.js`)
- User routes → JWT and roles: guards routes (evidence: `backend/routes/UserRouter.js`)
- User routes → Profile and saved actions: dispatches (evidence: `backend/routes/UserRouter.js`)
- User routes → User administration: dispatches (evidence: `backend/routes/UserRouter.js`)
- Report routes → Report workflow: dispatches (evidence: `backend/routes/ReportRouter.js`)
- Report routes → JWT and roles: guards routes (evidence: `backend/routes/ReportRouter.js`)
- Resource operations → Resource records: reads and writes (evidence: `backend/controllers/ResourceController.js`)
- Resource operations → Cloudinary files: uploads files (evidence: `backend/controllers/ResourceController.js`)
- Resource operations → User records: uses user identity
- Profile and saved actions → User records: reads and writes (evidence: `backend/controllers/UserController.js`)
- User administration → User records: reads and writes (evidence: `backend/controllers/AdminUserController.js`)
- Signup and login → User records: authenticates users (evidence: `backend/controllers/AuthController.js`)
- Report workflow → Report records: reads and writes (evidence: `backend/controllers/ReportController.js`)
- Report workflow → Resource records: checks resource (evidence: `backend/controllers/ReportController.js`)
