# kvj-harsha/prcouncil architecture

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

- Interactive diagram: https://gitdiagram.com/kvj-harsha/prcouncil
- Repository: https://github.com/kvj-harsha/prcouncil

## Overview

##### Project Type and Purpose
- This is a full-stack, content-driven web application built with Next.js (React) on the frontend and Firebase services (Authentication, Firestore/Realtime Database, Hosting) on the backend.
- Purpose: public-facing site for IIIT Raichur’s PR Council events, feedback, photo galleries, and admin interfaces.

##### File Structure
- Top-level “app” directory uses Next.js App Router; subdivided into:
– **app/page.tsx** (public home page)
– **app/events**, **app/feedback**, **app/members**, etc. (public routes)
– **app/admin/** (protected admin console pages for events, feedback, deletion)
– **app/components/** (shared UI pieces and PrivateRoute guard)
- **lib/firebase.js** holds Firebase config and SDK initialization.
- Config files: **next.config.ts**, **tailwind.config.ts**, **postcss.config.mjs**, **tsconfig.json**.
- Deployment likely on Vercel (via Next.js) and Firebase hosting services.

##### README for Insights
- Confirms tech stack: Next.js + Tailwind CSS; Firebase for auth, database, hosting.
- Features: event galleries, deletion requests, feedback forms, team members page.

##### Main Components & Their Relationships (to include)
a. Client Browser (Mobile/Desktop)
b. CDN / Vercel Hosting (Next.js Static + Server-side Rendering)
c. Next.js Frontend
- Public Pages (home, events, feedback, members)
- Admin Pages (add-event, deletion, events list, feedback list)
- Shared UI Components (Navbar, Footer, Hero, PrivateRoute)
d. Firebase Services
- Authentication (Sign-in/Sign-up, PrivateRoute guard)
- Firestore / Realtime Database (events data, feedback entries, deletion requests, team members)
- Storage (public/photos galleries)
- Hosting (optional if used in addition to Vercel or for static assets)
e. External Integrations
- Social Media Links (YouTube, LinkedIn, Twitter, Facebook, Email)

##### Architectural Patterns & Principles
- Component-Based Design: reusable React components under **app/components**.
- App Router (Next.js): file-based routing for public vs. admin areas.
- Protected Routes: PrivateRoute ensures only authenticated admins can access admin subpages.
- Server-Side Rendering (SSR) / Static-Site Generation (SSG): ensure SEO and performance.
- Utility-First CSS (Tailwind) for styling.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% End User
    User["End User (Browser)"]:::external

    %% CDN / Vercel
    CDN["CDN / Vercel Hosting"]:::infra
    click CDN "https://github.com/kvj-harsha/prcouncil/blob/master/next.config.ts"

    %% Next.js Frontend
    subgraph "Next.js Frontend" 
        direction TB

        %% Global Layout & Styles
        GlobalLayout["Global Layout & Styles"]:::frontend
        click GlobalLayout "https://github.com/kvj-harsha/prcouncil/blob/master/app/layout.tsx"
        click GlobalLayout "https://github.com/kvj-harsha/prcouncil/blob/master/app/globals.css"

        %% Shared UI Components
        subgraph "Shared UI Components"
            direction TB
            Navbar["Navbar (public)"]:::frontend
            click Navbar "https://github.com/kvj-harsha/prcouncil/blob/master/app/components/Navbar.tsx"
            NavbarAdmin["Navbar (admin)"]:::frontend
            click NavbarAdmin "https://github.com/kvj-harsha/prcouncil/blob/master/app/components/NavbarAdmin.tsx"
            Footer["Footer"]:::frontend
            click Footer "https://github.com/kvj-harsha/prcouncil/blob/master/app/components/Footer.tsx"
            Hero["Hero Section"]:::frontend
            click Hero "https://github.com/kvj-harsha/prcouncil/blob/master/app/components/Hero.tsx"
            PrivateRoute["PrivateRoute Guard"]:::frontend
            click PrivateRoute "https://github.com/kvj-harsha/prcouncil/blob/master/app/components/PrivateRoute.tsx"
            Squares["Decorative Squares"]:::frontend
            click Squares "https://github.com/kvj-harsha/prcouncil/blob/master/app/components/Squares.tsx"
            Terminal["Terminal Widget"]:::frontend
            click Terminal "https://github.com/kvj-harsha/prcouncil/blob/master/app/components/Terminal.tsx"
        end

        %% Public Pages
        subgraph "Public Pages" 
            direction TB
            Home["Home Page"]:::frontend
            click Home "https://github.com/kvj-harsha/prcouncil/blob/master/app/page.tsx"
            Events["Events Page"]:::frontend
            click Events "https://github.com/kvj-harsha/prcouncil/blob/master/app/events/page.tsx"
            Feedback["Feedback Page"]:::frontend
            click Feedback "https://github.com/kvj-harsha/prcouncil/blob/master/app/feedback/page.tsx"
            Members["Members Page"]:::frontend
            click Members "https://github.com/kvj-harsha/prcouncil/blob/master/app/members/page.tsx"
            SocialMedia["Social Media Links Page"]:::frontend
            click SocialMedia "https://github.com/kvj-harsha/prcouncil/blob/master/app/social-media/page.tsx"
            RequestDeletion["Deletion Request Page"]:::frontend
            click RequestDeletion "https://github.com/kvj-harsha/prcouncil/blob/master/app/request-deletion/page.tsx"
            SignIn["Sign In Page"]:::frontend
            click SignIn "https://github.com/kvj-harsha/prcouncil/blob/master/app/sign-in/page.tsx"
            SignUp["Sign Up Page"]:::frontend
            click SignUp "https://github.com/kvj-harsha/prcouncil/blob/master/app/sign-up/page.tsx"
            Dev["Dev/Test Page (Dev)"]:::frontend
            click Dev "https://github.com/kvj-harsha/prcouncil/blob/master/app/dev/page.tsx"
            Test["Dev/Test Page (Test)"]:::frontend
            click Test "https://github.com/kvj-harsha/prcouncil/blob/master/app/test/page.tsx"
        end

        %% Admin Console
        subgraph "Admin Console (Protected)" 
            direction TB
            AdminLayout["Admin Layout"]:::frontend
            click AdminLayout "https://github.com/kvj-harsha/prcouncil/blob/master/app/admin/layout.tsx"
            click AdminLayout "https://github.com/kvj-harsha/prcouncil/blob/master/app/admin/page.tsx"
            AddEvent["Add Event Page"]:::frontend
            click AddEvent "https://github.com/kvj-harsha/prcouncil/blob/master/app/admin/add-event/page.tsx"
            DeletionReq["Deletion Requests Management"]:::frontend
            click DeletionReq "https://github.com/kvj-harsha/prcouncil/blob/master/app/admin/deletion/page.tsx"
            EventsList["Events List Management"]:::frontend
            click EventsList "https://github.com/kvj-harsha/prcouncil/blob/master/app/admin/events/page.tsx"
            FeedbackList["Feedback List Management"]:::frontend
            click FeedbackList "https://github.com/kvj-harsha/prcouncil/blob/master/app/admin/feedback/page.tsx"
        end
    end

    %% Firebase Services
    subgraph "Firebase Services"
        direction TB
        Auth["Authentication"]:::backend
        click Auth "https://github.com/kvj-harsha/prcouncil/blob/master/lib/firebase.js"
        Firestore["Firestore / Realtime Database"]:::backend
        click Firestore "https://github.com/kvj-harsha/prcouncil/blob/master/lib/firebase.js"
        Storage["Storage (Photo Galleries)"]:::backend
        click Storage "https://github.com/kvj-harsha/prcouncil/blob/master/lib/firebase.js"
        FHHosting["Firebase Hosting (Static Assets)"]:::backend
    end

    %% External Social Media
    subgraph "External Services"
        direction TB
        SocialExt["Social Media Platforms"]:::external
    end

    %% Config & Tooling
    subgraph "Config & Tooling"
        direction TB
        TailwindConfig["Tailwind Config"]:::infra
        click TailwindConfig "https://github.com/kvj-harsha/prcouncil/blob/master/tailwind.config.ts"
        click TailwindConfig "https://github.com/kvj-harsha/prcouncil/blob/master/postcss.config.mjs"
        TSConfig["TypeScript Config"]:::infra
        click TSConfig "https://github.com/kvj-harsha/prcouncil/blob/master/tsconfig.json"
        Sitemap["Sitemap Generation"]:::infra
        click Sitemap "https://github.com/kvj-harsha/prcouncil/blob/master/next-sitemap.js"
        Package["Package Definitions"]:::infra
        click Package "https://github.com/kvj-harsha/prcouncil/blob/master/package.json"
        click Package "https://github.com/kvj-harsha/prcouncil/blob/master/package-lock.json"
    end

    %% Connections
    User --> CDN
    CDN --> GlobalLayout
    GlobalLayout --> Navbar
    GlobalLayout --> Footer
    Navbar --> Home
    Home --> Firestore
    Events --> Firestore
    Feedback --> Firestore
    Members --> Firestore
    RequestDeletion --> Firestore
    SignIn --> Auth
    SignUp --> Auth
    Dev --> Firestore
    Test --> Firestore
    SocialMedia --> SocialExt

    AdminLayout --> PrivateRoute
    PrivateRoute --> Auth
    AddEvent --> Auth
    DeletionReq --> Auth
    EventsList --> Auth
    FeedbackList --> Auth

    GlobalLayout --> Public_Pages(("Public Pages"))
    GlobalLayout --> Admin_Console(("Admin Console"))

    %% Firebase connections
    GlobalLayout --> Auth
    GlobalLayout --> Firestore
    GlobalLayout --> Storage

    %% Styling connections
    GlobalLayout --> TailwindConfig
    GlobalLayout --> TSConfig
    GlobalLayout --> Sitemap
    GlobalLayout --> Package

    %% Legend (optional)
    classDef frontend fill:#bbdefb,stroke:#1e88e5,color:#0d47a1;
    classDef backend fill:#ffcc80,stroke:#fb8c00,color:#e65100;
    classDef infra fill:#c8e6c9,stroke:#43a047,color:#1b5e20;
    classDef external fill:#e0e0e0,stroke:#9e9e9e,color:#424242;
```
