# webdev4001/slc architecture

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

- Interactive diagram: https://gitdiagram.com/webdev4001/slc
- Repository: https://github.com/webdev4001/slc

## Overview

##### Project Type and Purpose
- This is a **static, responsive frontend website** (“SLC Website”) built to serve as a central hub for students at MMMUT.
- It contains only **client-side** code: HTML5 pages, Tailwind CSS styles, and vanilla JavaScript for interactivity (forms, filtering, accordion UI, chatbot stub).
- There is **no backend** yet, but the README calls out future integration points: API server, database storage, real‐world chatbot service.

##### File Structure
- **Public/**
- HTML files (index.html, library.html, engage.html, council.html, path.html) – each page of the site
- css/style.css – compiled Tailwind output
- js/*.js – page-specific and shared scripts (main.js, forms.js, chatbot.js, etc.)
- **src/input.css** – Tailwind directives input file
- **tailwind.config.js / postcss.config.js** – build tooling
- **package.json** – dev dependencies for Tailwind, PostCSS

##### README Insights
- Emphasis on:
- **Responsive design**, utility-first CSS via Tailwind
- **Client-side dynamic filtering** (library, events) and forms (book suggestions, join SLC, feedback)
- Placeholder **PATH chatbot** requiring a backend integration
- Future enhancements:
- Database layer for form data
- API server (Node/Express, Flask, etc.)
- Real AI chatbot service
- User authentication and admin UI

a. Main Components
- **User’s Browser (Client):** Renders HTML + CSS, runs JavaScript
- **Static Asset Host:** CDN or static-site host serving Public/ files
- **External Services:** Google Fonts, potential Chatbot API (Dialogflow/LLM), Analytics (if any)
- **(Future) API Server:** Node.js/Express or equivalent, exposes REST endpoints for form submissions, library/event data, chatbot proxy
- **(Future) Database:** MongoDB/PostgreSQL/Firebase to persist suggestions, applications, feedback, dynamic content
b. Relationships and Interactions
1. Browser → Static Host: HTTP GET for HTML/CSS/JS/images
2. JS in Browser → (Future) API Server: POST/GET for forms and dynamic data
3. API Server ↔ Database: CRUD operations on stored data
4. Browser → External Chatbot Service: JSON requests/responses via chatbot.js
5. Browser → Google Fonts: font files loaded on page render
c. Architectural Patterns & Design Principles
- **Client-Side Rendering** – static pages + JS enhancements
- **Utility-First CSS** – Tailwind for consistent styling and responsive breakpoints
- **Progressive Enhancement** – page always loads HTML/CSS; JS augments features
- **Separation of Concerns** – HTML markup, styling in CSS, behavior in JS, build config in separate files
d. Key Technologies, Frameworks, Libraries
- HTML5, Tailwind CSS, PostCSS, Autoprefixer
- Vanilla JavaScript modules (ES6)
- Node.js toolchain for CSS build (npm, tailwindcss CLI)
- (Planned) Express.js or Flask API, MongoDB/PostgreSQL, Dialogflow/OpenAI API

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Browser with sub-modules
    subgraph "User's Browser" 
        direction TB
        NAV["Navigation & Routing"]:::frontend
        LIB["Library Filter UI"]:::frontend
        EVT["Event Filter & Forms"]:::frontend
        ACC["Accordion (Past Council)"]:::frontend
        CHATW["Chatbot Widget"]:::frontend
        NAV --> LIB
        LIB --> EVT
        EVT --> ACC
        ACC --> CHATW
    end

    %% Static Asset Host
    HOST["Static Asset Host\n(CDN/Netlify/GitHub Pages)"]:::frontend

    %% External Services
    FONTS["Google Fonts"]:::external
    CHATAPI["Chatbot API Service"]:::external

    %% Future Backend
    subgraph "Future Backend (Optional)" 
        direction TB
        API["API Server\n(Node.js/Express)"]:::backend
        DB["Database\n(MongoDB/PostgreSQL)"]:::backend
        API -->|"CRUD data"| DB
    end

    %% Build Pipeline
    subgraph "Build Pipeline" 
        direction TB
        NPM["npm scripts"]:::tooling
        TAIL_INPUT["Tailwind Input (src/input.css)"]:::tooling
        TAIL_OUTPUT["Compiled CSS\n(Public/css/style.css)"]:::frontend
        NPM --> TAIL_INPUT
        TAIL_INPUT --> TAIL_OUTPUT
    end

    %% Documentation
    DOC["README.md"]:::docs

    %% Connections
    NAV -->|"HTTP GET HTML/CSS/JS"| HOST
    HOST -->|"Serves index.html"| NAV
    LIB -->|"GET library data (future)"| API
    EVT -->|"POST /suggest-book"| API
    CHATW -->|"JSON requests/responses"| CHATAPI
    NAV -->|"GET fonts"| FONTS
    HOST -->|"Serves CSS"| TAIL_OUTPUT
    DOC -.-> API
    DOC -.-> DB

    %% Click Events for components
    click NAV "https://github.com/webdev4001/slc/blob/main/Public/js/main.js"
    click LIB "https://github.com/webdev4001/slc/blob/main/Public/js/main.js"
    click EVT "https://github.com/webdev4001/slc/blob/main/Public/js/forms.js"
    click ACC "https://github.com/webdev4001/slc/blob/main/Public/council.html"
    click CHATW "https://github.com/webdev4001/slc/blob/main/Public/js/chatbot.js"
    click HOST "https://github.com/webdev4001/slc/tree/main/Public/"
    click FONTS "https://github.com/webdev4001/slc/tree/main/N/A"
    click CHATAPI "https://github.com/webdev4001/slc/tree/main/N/A"
    click API "https://github.com/webdev4001/slc/tree/main/N/A"
    click DB "https://github.com/webdev4001/slc/tree/main/N/A"
    click NPM "https://github.com/webdev4001/slc/blob/main/package.json"
    click TAIL_INPUT "https://github.com/webdev4001/slc/blob/main/src/input.css"
    click TAIL_OUTPUT "https://github.com/webdev4001/slc/blob/main/Public/css/style.css"
    click DOC "https://github.com/webdev4001/slc/blob/main/README.md"

    %% Styles
    classDef frontend fill:#D0E8FF,stroke:#0277BD,color:#000
    classDef backend fill:#E0F2F1,stroke:#00796B,color:#000
    classDef external fill:#FFF3E0,stroke:#FB8C00,color:#000
    classDef tooling fill:#F3E5F5,stroke:#8E24AA,color:#000
    classDef docs fill:#ECEFF1,stroke:#546E7A,color:#000
```
