# ctoic/campushive-frontend architecture

> Architecture diagram of the GitHub repository ctoic/campushive-frontend, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-31). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ctoic/campushive-frontend
- Repository: https://github.com/ctoic/campushive-frontend

## Overview

##### Project type and purpose
- From the file tree and the minimal README title (“Campus Hive”), we see:
- A Vite-powered React application (presence of `vite.config.js`, `src/main.jsx`).
- A purely front-end codebase—no backend or server directories.
- UI components for sections like Hero, About, Features, Team, Login/Signup, and a Chatbot.
- Purpose: A single-page campus community site (“Campus Hive”) that likely offers static content pages plus a chatbot feature.

##### File structure
- Top-level files:
- `index.html` – host page template.
- `package.json` / `package-lock.json` – dependency management.
- `.bolt/config.json`, `eslint.config.js` – linting / developer tooling.
- `public/` – static assets served as-is.
- `src/` – core source code:
- `src/main.jsx` – React entry point.
- `src/App.jsx` / `App.css` – root component and styling.
- `src/components/` – individual UI components (Navbar, Footer, Hero, About, Features, Team, Login, Signup, Chatbot).
- `src/utils/ScrollObserver.jsx` – utility for scroll-based behavior.
- `src/assets/` – media files (video, images).

##### Key insights from the README
- Very brief; implies we must infer architecture from structure.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Build & Deployment
    Vite["Vite Build & Dev Server"]:::component
    Vite -->|"bundle with vite.config.js"| StaticHost

    %% Hosting Layer
    StaticHost["Static Host / CDN"]:::external
    StaticHost -->|"serve index.html"| HTML
    StaticHost -->|"serve public assets"| Public

    %% Assets Layer
    Assets["Static Asset Store"]:::asset
    HTML -->|"template for app"| App
    Public -->|"assets accessible"| App
    Assets -->|"import media"| App

    %% Client Layer
    subgraph "User's Browser"
        direction TB
        subgraph "React App (SPA)"
            direction TB
            App["App.jsx"]:::component
            Navbar["Navbar.jsx"]:::component
            Hero["Hero.jsx"]:::component
            About["About.jsx"]:::component
            Features["Features.jsx"]:::component
            Team["Team.jsx"]:::component
            subgraph "Authentication"
                direction TB
                Login["Login.jsx"]:::component
                Signup["Signup.jsx"]:::component
            end
            Chatbot["Chatbot.jsx"]:::component
            Footer["Footer.jsx"]:::component
            ScrollObserver["ScrollObserver.jsx"]:::util
        end
    end

    %% Event & Data Flows
    ScrollObserver -.->|"dispatch scroll events"| Navbar
    ScrollObserver -.-> Hero
    ScrollObserver -.-> About
    ScrollObserver -.-> Features
    ScrollObserver -.-> Team
    ScrollObserver -.-> Login
    ScrollObserver -.-> Signup
    ScrollObserver -.-> Chatbot
    ScrollObserver -.-> Footer

    Chatbot -->|"API call"| ChatAPI["Chatbot API Service"]:::external

    %% Click Events
    click Vite "https://github.com/ctoic/campushive-frontend/blob/master/vite.config.js"
    click HTML "https://github.com/ctoic/campushive-frontend/blob/master/index.html"
    click Public "https://github.com/ctoic/campushive-frontend/tree/master/public/"
    click App "https://github.com/ctoic/campushive-frontend/blob/master/src/App.jsx"
    click App "https://github.com/ctoic/campushive-frontend/blob/master/src/App.css"
    click Navbar "https://github.com/ctoic/campushive-frontend/blob/master/src/components/Navbar.jsx"
    click Navbar "https://github.com/ctoic/campushive-frontend/blob/master/src/components/Navbar.css"
    click Hero "https://github.com/ctoic/campushive-frontend/blob/master/src/components/Hero.jsx"
    click Hero "https://github.com/ctoic/campushive-frontend/blob/master/src/components/Hero.css"
    click About "https://github.com/ctoic/campushive-frontend/blob/master/src/components/About.jsx"
    click About "https://github.com/ctoic/campushive-frontend/blob/master/src/components/About.css"
    click Features "https://github.com/ctoic/campushive-frontend/blob/master/src/components/Features.jsx"
    click Features "https://github.com/ctoic/campushive-frontend/blob/master/src/components/Features.css"
    click Team "https://github.com/ctoic/campushive-frontend/blob/master/src/components/Team.jsx"
    click Team "https://github.com/ctoic/campushive-frontend/blob/master/src/components/Team.css"
    click Login "https://github.com/ctoic/campushive-frontend/blob/master/src/components/Login.jsx"
    click Login "https://github.com/ctoic/campushive-frontend/blob/master/src/components/Login.css"
    click Signup "https://github.com/ctoic/campushive-frontend/blob/master/src/components/Signup.jsx"
    click Signup "https://github.com/ctoic/campushive-frontend/blob/master/src/components/Signup.css"
    click Chatbot "https://github.com/ctoic/campushive-frontend/blob/master/src/components/Chatbot.jsx"
    click Chatbot "https://github.com/ctoic/campushive-frontend/blob/master/src/components/Chatbot.css"
    click Footer "https://github.com/ctoic/campushive-frontend/blob/master/src/components/Footer.jsx"
    click Footer "https://github.com/ctoic/campushive-frontend/blob/master/src/components/Footer.css"
    click ScrollObserver "https://github.com/ctoic/campushive-frontend/blob/master/src/utils/ScrollObserver.jsx"
    click Assets "https://github.com/ctoic/campushive-frontend/blob/master/src/assets/hive.mp4"
    click Assets "https://github.com/ctoic/campushive-frontend/tree/master/src/assets/profile/"

    %% Styles
    classDef frontend fill:#D5E8D4,stroke:#82B366
    classDef component fill:#FFF2CC,stroke:#D6B656
    classDef util fill:#E1D5E7,stroke:#9673A6,stroke-dasharray: 5 5
    classDef asset fill:#F8CECC,stroke:#B85450
    classDef external fill:#DAE8FC,stroke:#6C8EBF,stroke-dasharray: 2 2
```
