# shivborse6/campus-voice architecture

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

- Interactive diagram: https://gitdiagram.com/shivborse6/campus-voice
- Repository: https://github.com/shivborse6/campus-voice

## Overview

CampusVoice is a campus social-feed frontend for composing and browsing anonymous posts, liking or deleting them, and adding comments. The main flow routes a visitor through a login screen to the home feed; the login currently only navigates and does not authenticate. The home page loads and mutates posts in Firestore, while comments are kept in each post component’s local state. The README is empty, so this map reflects the supplied source and tree; unsampled behavior is not inferred.

Main entry points: [`frontend/src/pages/Home.jsx`](https://github.com/shivborse6/campus-voice/blob/main/frontend/src/pages/Home.jsx) (Feed coordinator), [`frontend/src/App.jsx`](https://github.com/shivborse6/campus-voice/blob/main/frontend/src/App.jsx) (Routes and landing), [`frontend/src/pages/Login.jsx`](https://github.com/shivborse6/campus-voice/blob/main/frontend/src/pages/Login.jsx) (Login screen), [`frontend/src/components/CreatePost.jsx`](https://github.com/shivborse6/campus-voice/blob/main/frontend/src/components/CreatePost.jsx) (Post composer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["App entry and routing"]
  node_main["React bootstrap<br/>[main.jsx]"]
  node_app["Routes and landing<br/>[App.jsx]"]
  node_login["Login screen<br/>[Login.jsx]"]
end

subgraph group_feed["Social feed interface"]
  node_home["Feed coordinator<br/>[Home.jsx]"]
  node_navbar["Top navigation<br/>[Navbar.jsx]"]
  node_sidebar["Feed menu<br/>[Sidebar.jsx]"]
  node_create["Post composer<br/>[CreatePost.jsx]"]
  node_post["Post and comments<br/>[Post.jsx]"]
end

subgraph group_storage["Post persistence"]
  node_firebase["Firebase setup<br/>[firebase.js]"]
  node_firestore[("Posts collection")]
end

node_visitor(("Visitor"))

node_visitor -->|"opens app"| node_app
node_main -->|"renders"| node_app
node_app -->|"routes to"| node_login
node_app -->|"routes to"| node_home
node_visitor -->|"enters credentials"| node_login
node_login -->|"navigates home"| node_app
node_visitor -->|"uses feed"| node_home
node_home -->|"renders"| node_navbar
node_home -->|"renders"| node_sidebar
node_home -->|"renders"| node_create
node_home -->|"renders posts"| node_post
node_create -->|"submits post"| node_home
node_post -->|"requests like or delete"| node_home
node_firebase -->|"initializes"| node_firestore
node_home -->|"reads and writes posts"| node_firestore

click node_main "https://github.com/shivborse6/campus-voice/blob/main/frontend/src/main.jsx"
click node_app "https://github.com/shivborse6/campus-voice/blob/main/frontend/src/App.jsx"
click node_login "https://github.com/shivborse6/campus-voice/blob/main/frontend/src/pages/Login.jsx"
click node_home "https://github.com/shivborse6/campus-voice/blob/main/frontend/src/pages/Home.jsx"
click node_navbar "https://github.com/shivborse6/campus-voice/blob/main/frontend/src/components/Navbar.jsx"
click node_sidebar "https://github.com/shivborse6/campus-voice/blob/main/frontend/src/components/Sidebar.jsx"
click node_create "https://github.com/shivborse6/campus-voice/blob/main/frontend/src/components/CreatePost.jsx"
click node_post "https://github.com/shivborse6/campus-voice/blob/main/frontend/src/components/Post.jsx"
click node_firebase "https://github.com/shivborse6/campus-voice/blob/main/frontend/src/firebase.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_main,node_app,node_login toneBlue
class node_home,node_navbar,node_sidebar,node_create,node_post toneAmber
class node_firebase,node_firestore toneMint
class node_visitor toneIndigo
```

## Components

### App entry and routing

- [React bootstrap](https://github.com/shivborse6/campus-voice/blob/main/frontend/src/main.jsx): `frontend/src/main.jsx`
- [Routes and landing](https://github.com/shivborse6/campus-voice/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Login screen](https://github.com/shivborse6/campus-voice/blob/main/frontend/src/pages/Login.jsx): `frontend/src/pages/Login.jsx`

### Social feed interface

- [Feed coordinator](https://github.com/shivborse6/campus-voice/blob/main/frontend/src/pages/Home.jsx): `frontend/src/pages/Home.jsx`
- [Top navigation](https://github.com/shivborse6/campus-voice/blob/main/frontend/src/components/Navbar.jsx): `frontend/src/components/Navbar.jsx`
- [Feed menu](https://github.com/shivborse6/campus-voice/blob/main/frontend/src/components/Sidebar.jsx): `frontend/src/components/Sidebar.jsx`
- [Post composer](https://github.com/shivborse6/campus-voice/blob/main/frontend/src/components/CreatePost.jsx): `frontend/src/components/CreatePost.jsx`
- [Post and comments](https://github.com/shivborse6/campus-voice/blob/main/frontend/src/components/Post.jsx): `frontend/src/components/Post.jsx`

### Post persistence

- [Firebase setup](https://github.com/shivborse6/campus-voice/blob/main/frontend/src/firebase.js): `frontend/src/firebase.js`
- **Posts collection**

### Other components

- **Visitor**

## Connections

- Visitor → Routes and landing: opens app
- React bootstrap → Routes and landing: renders
- Routes and landing → Login screen: routes to
- Routes and landing → Feed coordinator: routes to
- Visitor → Login screen: enters credentials
- Login screen → Routes and landing: navigates home
- Visitor → Feed coordinator: uses feed
- Feed coordinator → Top navigation: renders
- Feed coordinator → Feed menu: renders
- Feed coordinator → Post composer: renders
- Feed coordinator → Post and comments: renders posts
- Post composer → Feed coordinator: submits post
- Post and comments → Feed coordinator: requests like or delete
- Firebase setup → Posts collection: initializes
- Feed coordinator → Posts collection: reads and writes posts
