# iiits/alumni-portal architecture

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

- Interactive diagram: https://gitdiagram.com/iiits/alumni-portal
- Repository: https://github.com/iiits/alumni-portal

## Overview

##### Main Components
- Next.js Frontend: Represented by everything in the “app” directory along with dedicated pages like:
– Interaction pages (e.g., events, jobs, referrals)
– Profile pages (for individual profiles and “me”)
– Static miscellaneous pages (contact us, FAQs, alumni details)
– Authentication pages (login, signup, verify email, logout)
- API Layer: Found under “app/api”, which is subdivided into multiple endpoints for:
– Authentication (login, logout, signup, verify email)
– Domain-specific endpoints (alumnidetails, events, jobs, referrals, referralsubmissions, user)
– Health check endpoint (for monitoring service status)
- UI Components: In the “components” directory, these include reusable elements such as Navbar, Footer, and specialized page components (LandingPage, EventsPage, JobsPage, etc.).
- Utility & State Management: The “lib” directory contains API utilities (axios, types) and a store (state management for user and possibly other global states).
- Configuration & Assets:
– Next.js configuration files (next.config.ts, tsconfig.json, tailwind.config.ts, etc.)
– Public assets (gifs, svgs)
– Style sheets (globals.css) and other tooling files (e.g., ESLint and Husky hooks)

##### Relationships and Interactions
- The Next.js “app” directory uses folder‑based routing to render client and server components.
- The API routes are integrated with the Next.js framework to handle serverless function calls. They serve as the back-end logic for processing requests from the frontend.
- The UI components built under “components” are used by the pages in the “app” directory to render visual elements.
- The “lib” module provides common functionalities (like API calls with axios and state management) accessed by both pages (for client‑side interactions) and potentially API routes.

##### Architectural Patterns & Key Technologies
- Next.js App Router: Enables file‑based routing and renders server/client components.
- API Endpoints as Serverless Functions: Each endpoint (e.g., /api/auth, /api/jobs, etc.) represents a micro‑service‑like structure inside the same repository.
- Separation of Concerns:
– The “app” directory for UI and routing.
– The “api” sub‑folders for business logic and backend processing.
– The “components” directory for reusable UI elements ensuring modularity.
– “lib” for shared utilities and state management.
- Tools and Frameworks:
– Next.js as the framework.
– Tailwind CSS (via tailwind.config.ts) for styling.
– Optional integrations with external services (deployment on Vercel is encouraged).
– GitHub Actions (workflows under .github/workflows) and Husky hooks for CI/CD and pre‑commit checks.

– Clear labels for each core component (Frontend, API, UI Components, Utilities, Configurations).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend (Next.js App)
    subgraph "Frontend (Next.js App)"
        F1["Interaction Pages"]:::frontend
        F2["Profiles Pages"]:::frontend
        F3["Static/Misc Pages"]:::frontend
        F4["Authentication Pages"]:::frontend
    end

    %% API Layer
    subgraph "API Layer"
        A1["Auth API"]:::api
        A2["Alumni Details API"]:::api
        A3["Events API"]:::api
        A4["Jobs API"]:::api
        A5["Referrals API"]:::api
        A6["Referrals Submissions API"]:::api
        A7["User API"]:::api
        A8["Health Check API"]:::api
    end

    %% UI Components
    subgraph "UI Components"
        U1["Navbar"]:::ui
        U2["Footer"]:::ui
        U3["Page Components"]:::ui
    end

    %% Utilities & State Management
    subgraph "Utilities & State Management"
        L1["API Utilities"]:::utils
        L2["State Management"]:::utils
        L3["Shared Utils"]:::utils
    end

    %% Configuration & Assets
    subgraph "Configuration & Assets"
        C1["Project Configs"]:::config
        C2["Global Styles"]:::config
        C3["Public Assets"]:::config
        C4["CI/CD & Hooks"]:::config
    end

    %% Connections between Frontend and API Layer
    F1 -->|"fetchEvents"| A3
    F1 -->|"fetchJobs"| A4
    F1 -->|"submitReferral"| A5
    F4 -->|"authRequest"| A1
    F2 -->|"profileDetails"| A2
    F2 -->|"userInfo"| A7

    %% Connections between Frontend and UI Components
    F1 -->|"rendersUsing"| U1
    F1 -->|"rendersUsing"| U2
    F1 -->|"composes"| U3
    F2 -->|"rendersUsing"| U1
    F2 -->|"rendersUsing"| U2
    F2 -->|"composes"| U3
    F3 -->|"rendersUsing"| U1
    F3 -->|"rendersUsing"| U2

    %% Connections between Frontend and Utilities & State Management
    F1 -->|"calls"| L1
    F1 -->|"managesState"| L2
    F1 -->|"utilizes"| L3
    F2 -->|"calls"| L1
    F2 -->|"managesState"| L2

    %% Connections between API Layer and Utilities & State Management
    A1 -->|"uses"| L1
    A1 -->|"uses"| L3
    A2 -->|"uses"| L1
    A3 -->|"uses"| L1
    A4 -->|"uses"| L1
    A5 -->|"uses"| L1
    A6 -->|"uses"| L1
    A7 -->|"uses"| L1

    %% Connections to Configuration & Assets
    F1 -->|"styledBy"| C2
    F1 -->|"configuredBy"| C1
    A1 -->|"configuredBy"| C1
    F3 -->|"servedStatic"| C3
    F4 -->|"integratedWith"| C4

    %% Click Events for Frontend Components
    click F1 "https://github.com/iiits/alumni-portal/tree/main/app/(interaction)"
    click F2 "https://github.com/iiits/alumni-portal/tree/main/app/(profiles)"
    click F3 "https://github.com/iiits/alumni-portal/tree/main/app/(static_misc)"
    click F4 "https://github.com/iiits/alumni-portal/tree/main/app/auth"

    %% Click Events for API Endpoints
    click A1 "https://github.com/iiits/alumni-portal/tree/main/app/api/auth"
    click A2 "https://github.com/iiits/alumni-portal/tree/main/app/api/alumnidetails"
    click A3 "https://github.com/iiits/alumni-portal/tree/main/app/api/events"
    click A4 "https://github.com/iiits/alumni-portal/tree/main/app/api/jobs"
    click A5 "https://github.com/iiits/alumni-portal/tree/main/app/api/referrals"
    click A6 "https://github.com/iiits/alumni-portal/tree/main/app/api/referralsubmissions"
    click A7 "https://github.com/iiits/alumni-portal/tree/main/app/api/user"
    click A8 "https://github.com/iiits/alumni-portal/tree/main/app/api/health"

    %% Click Events for UI Components
    click U1 "https://github.com/iiits/alumni-portal/blob/main/components/Navbar.tsx"
    click U2 "https://github.com/iiits/alumni-portal/blob/main/components/Footer.tsx"
    click U3 "https://github.com/iiits/alumni-portal/tree/main/components"

    %% Click Events for Utilities & State Management
    click L1 "https://github.com/iiits/alumni-portal/tree/main/lib/api"
    click L2 "https://github.com/iiits/alumni-portal/tree/main/lib/store"
    click L3 "https://github.com/iiits/alumni-portal/blob/main/lib/utils.ts"

    %% Click Events for Configuration & Assets
    click C1 "https://github.com/iiits/alumni-portal/blob/main/next.config.ts"
    click C2 "https://github.com/iiits/alumni-portal/blob/main/app/globals.css"
    click C3 "https://github.com/iiits/alumni-portal/tree/main/public/"
    click C4 "https://github.com/iiits/alumni-portal/tree/main/.github/"

    %% Styles
    classDef frontend fill:#FFE4B5,stroke:#333,stroke-width:2px;
    classDef api fill:#ADD8E6,stroke:#333,stroke-width:2px;
    classDef ui fill:#98FB98,stroke:#333,stroke-width:2px;
    classDef utils fill:#FFD700,stroke:#333,stroke-width:2px;
    classDef config fill:#E0FFFF,stroke:#333,stroke-width:2px;
```
