# ayush17281/campus-verse-rest-api architecture

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

- Interactive diagram: https://gitdiagram.com/ayush17281/campus-verse-rest-api
- Repository: https://github.com/ayush17281/campus-verse-rest-api

## Overview

Campus Verse is a college discussion platform with a React client and an Express server backed by MySQL. Students browse categorized posts, sign up or log in, and—when authenticated—publish, edit, or delete their own posts; the client also searches tech articles through a server-side API integration. The server additionally exposes a legacy EJS-rendered posts interface. The excerpts show the main client/server calls and database operations; unsampled schema and templates are represented only where the README or shown routes establish their role.

Main entry points: [`index.js`](https://github.com/ayush17281/campus-verse-rest-api/blob/main/index.js) (REST API), [`client/src/main.jsx`](https://github.com/ayush17281/campus-verse-rest-api/blob/main/client/src/main.jsx) (Client entry), [`client/src/App.jsx`](https://github.com/ayush17281/campus-verse-rest-api/blob/main/client/src/App.jsx) (Campus UI), [`schema.sql`](https://github.com/ayush17281/campus-verse-rest-api/blob/main/schema.sql) (MySQL database)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["React client"]
  node_client_entry["Client entry<br/>[main.jsx]"]
  node_campus_ui["Campus UI<br/>[App.jsx]"]
end

subgraph group_server["Express server"]
  node_api_server["REST API<br/>[index.js]"]
  node_auth["Sessions and auth<br/>[index.js]"]
  node_post_api["Post operations<br/>[index.js]"]
  node_ejs_posts["EJS posts<br/>[index.ejs]"]
end

subgraph group_integrations["Data and integrations"]
  node_mysql[("MySQL database<br/>[schema.sql]")]
  node_news_api["Tech news API"]
end

node_students(("Students"))

node_students -->|"use"| node_client_entry
node_client_entry -->|"renders"| node_campus_ui
node_campus_ui -->|"requests"| node_api_server
node_api_server -->|"routes auth"| node_auth
node_api_server -->|"routes posts"| node_post_api
node_auth -->|"queries users"| node_mysql
node_post_api -->|"queries posts"| node_mysql
node_api_server -->|"renders"| node_ejs_posts
node_api_server -->|"fetches articles"| node_news_api

click node_client_entry "https://github.com/ayush17281/campus-verse-rest-api/blob/main/client/src/main.jsx"
click node_campus_ui "https://github.com/ayush17281/campus-verse-rest-api/blob/main/client/src/App.jsx"
click node_api_server "https://github.com/ayush17281/campus-verse-rest-api/blob/main/index.js"
click node_auth "https://github.com/ayush17281/campus-verse-rest-api/blob/main/index.js"
click node_post_api "https://github.com/ayush17281/campus-verse-rest-api/blob/main/index.js"
click node_ejs_posts "https://github.com/ayush17281/campus-verse-rest-api/blob/main/views/index.ejs"
click node_mysql "https://github.com/ayush17281/campus-verse-rest-api/blob/main/schema.sql"

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_client_entry,node_campus_ui toneBlue
class node_api_server,node_auth,node_post_api,node_ejs_posts toneAmber
class node_mysql,node_news_api toneMint
class node_students toneIndigo
```

## Components

### React client

- [Client entry](https://github.com/ayush17281/campus-verse-rest-api/blob/main/client/src/main.jsx): `client/src/main.jsx`
- [Campus UI](https://github.com/ayush17281/campus-verse-rest-api/blob/main/client/src/App.jsx): `client/src/App.jsx`

### Express server

- [REST API](https://github.com/ayush17281/campus-verse-rest-api/blob/main/index.js): `index.js`
- [Sessions and auth](https://github.com/ayush17281/campus-verse-rest-api/blob/main/index.js): `index.js`
- [Post operations](https://github.com/ayush17281/campus-verse-rest-api/blob/main/index.js): `index.js`
- [EJS posts](https://github.com/ayush17281/campus-verse-rest-api/blob/main/views/index.ejs): `views/index.ejs`

### Data and integrations

- [MySQL database](https://github.com/ayush17281/campus-verse-rest-api/blob/main/schema.sql): `schema.sql`
- **Tech news API**

### Other components

- **Students**

## Connections

- Students → Client entry: use (evidence: `README.md`)
- Client entry → Campus UI: renders (evidence: `client/src/main.jsx`)
- Campus UI → REST API: requests (evidence: `client/src/App.jsx`)
- REST API → Sessions and auth: routes auth (evidence: `index.js`)
- REST API → Post operations: routes posts (evidence: `index.js`)
- Sessions and auth → MySQL database: queries users (evidence: `index.js`)
- Post operations → MySQL database: queries posts (evidence: `index.js`)
- REST API → EJS posts: renders (evidence: `index.js`)
- REST API → Tech news API: fetches articles (evidence: `index.js`)
