# kmsumanth23/nitrr-clubs-and-committee1 architecture

> Architecture diagram of the GitHub repository kmsumanth23/nitrr-clubs-and-committee1, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-07-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kmsumanth23/nitrr-clubs-and-committee1
- Repository: https://github.com/kmsumanth23/nitrr-clubs-and-committee1

## Overview

##### Project type and purpose
- Full-stack Single-Page Application (SPA) for NIT Raipur clubs/committees.
- Users: students (public + authenticated), club officials (authorized CRUD).
- Tech stack: React + Redux front-end, Node.js + Express.js back-end, MongoDB, JWT auth.

##### File structure
- client/ – React app (src, components, Redux setup, public assets, build output).
- server/ – Express REST API (routes, middleware, models, server.js), MongoDB via Mongoose.
- Auth flow split between client/src/components/Auth and server/middleware/auth.js.
- CRUD routes under server/routes (auth.js, users.js, protectedRoutes.js).

##### README for insights
- Confirms SPA with login/register, JWT for stateless sessions.
- Club pages managed via CRUD endpoints.
- No external third-party services beyond MongoDB.

- Browser / Client (React SPA)
– React Components (Auth, Navbar, Club pages)
– Redux Store (auth state, user data)
- API Layer (Node.js/Express)
– Routes (auth.js, users.js, protectedRoutes.js)
– Middleware (JWT verification, error handlers)
– Controllers/Models (User model via Mongoose)
- Database (MongoDB)
- (Optional) Hosting/Deployment (where client build and server run)
- Browser → HTTP(S) → Express API (login, register, fetch clubs, CRUD).
- Express → MongoDB (via Mongoose queries) for persistence.
- Express → Browser (JWT tokens in response headers/body).
- Browser (Redux) stores JWT and attaches to future API calls.
c. Architectural patterns/design principles:
- Client-server separation (SPA + RESTful API).
- Stateless authentication using JWT.
- Unidirectional data flow in React + Redux.
- MVC-style structure on the server (Routes → Controllers → Models).
d. Key technologies/frameworks:
- Front-end: React.js, Redux, Create React App build artifacts.
- Back-end: Node.js, Express.js, Mongoose, JSON Web Tokens.
- Database: MongoDB.

##### Detail without overthinking
- Essential modules:
– React components that handle Auth and club data
– Redux store/actions/reducers
– Express middleware (auth.js)
– Route handlers (auth.js, users.js, protectedRoutes.js)
– Mongoose models (User.js)
– MongoDB instance
- Related files into logical subsystems to avoid clutter.
- Every data flow (form submission, token storage, API call) is represented.

Putting it all together:

This structured layout will give any stakeholder—from developers to operations—a clear, accurate view of how NITRR-CLUBS-AND-COMMITTEE1 is built and how its pieces interact.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Browser / Client
    subgraph "Browser / Client (React SPA)"
        direction TB
        ClientApp["App.js"]:::client
        subgraph "React Components"
            direction TB
            Login["Login.js"]:::client
            Register["Register.js"]:::client
            AuthLogin["AuthorizedLogin.js"]:::client
            Navbar["Navbar.js"]:::client
        end
        subgraph "Redux Store"
            direction TB
            Store["store.js"]:::client
            AuthActions["authActions.js"]:::client
            AuthReducer["authReducer.js"]:::client
            RootReducer["index.js"]:::client
        end
        subgraph "Public / Static Club Pages"
            direction TB
            PubDev["public/clubpages/*"]:::client
            PubBuild["build/clubpages/*"]:::client
        end
    end

    %% API Layer
    subgraph "API Layer (Node.js / Express)"
        direction TB
        Server["server.js"]:::server
        subgraph "Routes"
            direction TB
            AuthRoute["auth.js"]:::server
            UserRoute["users.js"]:::server
            ProtectedRoute["protectedRoutes.js"]:::server
        end
        subgraph "Middleware"
            direction TB
            JWTMiddleware["auth.js"]:::server
        end
        subgraph "Controllers/Models"
            direction TB
            UserModel["User.js"]:::server
        end
    end

    %% Database
    DB["MongoDB"]:::db

    %% Connections
    ClientApp -->|"uses" | Login
    ClientApp -->|"uses" | Register
    ClientApp -->|"uses" | AuthLogin
    ClientApp -->|"uses" | Navbar
    ClientApp -->|"dispatches actions"| Store
    Store -->|"uses"| AuthActions
    Store -->|"handled by"| AuthReducer
    Store -->|"combined in"| RootReducer

    ClientApp -->|"HTTP requests (login, register, CRUD clubs)"| Server
    Server -->|"queries"| DB
    Server -->|"sends JWT"| ClientApp

    %% Click Events
    click ClientApp "https://github.com/kmsumanth23/nitrr-clubs-and-committee1/blob/main/client/src/App.js"
    click Login "https://github.com/kmsumanth23/nitrr-clubs-and-committee1/blob/main/client/src/components/Auth/Login.js"
    click Register "https://github.com/kmsumanth23/nitrr-clubs-and-committee1/blob/main/client/src/components/Auth/Register.js"
    click AuthLogin "https://github.com/kmsumanth23/nitrr-clubs-and-committee1/blob/main/client/src/components/Auth/AuthorizedLogin.js"
    click Navbar "https://github.com/kmsumanth23/nitrr-clubs-and-committee1/blob/main/client/src/components/Navbar/Navbar.js"
    click Store "https://github.com/kmsumanth23/nitrr-clubs-and-committee1/blob/main/client/src/redux/store.js"
    click AuthActions "https://github.com/kmsumanth23/nitrr-clubs-and-committee1/blob/main/client/src/redux/actions/authActions.js"
    click AuthReducer "https://github.com/kmsumanth23/nitrr-clubs-and-committee1/blob/main/client/src/redux/reducers/authReducer.js"
    click RootReducer "https://github.com/kmsumanth23/nitrr-clubs-and-committee1/blob/main/client/src/redux/reducers/index.js"
    click PubDev "https://github.com/kmsumanth23/nitrr-clubs-and-committee1/tree/main/client/public/clubpages"
    click PubBuild "https://github.com/kmsumanth23/nitrr-clubs-and-committee1/tree/main/client/build/clubpages"
    click Server "https://github.com/kmsumanth23/nitrr-clubs-and-committee1/blob/main/server/server.js"
    click AuthRoute "https://github.com/kmsumanth23/nitrr-clubs-and-committee1/blob/main/server/routes/auth.js"
    click UserRoute "https://github.com/kmsumanth23/nitrr-clubs-and-committee1/blob/main/server/routes/users.js"
    click ProtectedRoute "https://github.com/kmsumanth23/nitrr-clubs-and-committee1/blob/main/server/routes/protectedRoutes.js"
    click JWTMiddleware "https://github.com/kmsumanth23/nitrr-clubs-and-committee1/blob/main/server/middleware/auth.js"
    click UserModel "https://github.com/kmsumanth23/nitrr-clubs-and-committee1/blob/main/server/models/User.js"
    click DB "https://github.com/kmsumanth23/nitrr-clubs-and-committee1/blob/main/server/playground-2.mongodb.js"

    %% Styles
    classDef client fill:#B3DDF2,stroke:#0366d6,stroke-width:1px
    classDef server fill:#C6E8B1,stroke:#22863a,stroke-width:1px
    classDef db fill:#FAD69A,stroke:#d73a49,stroke-width:1px
```
