# akkilesh-a/swc_website architecture

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

- Interactive diagram: https://gitdiagram.com/akkilesh-a/swc_website
- Repository: https://github.com/akkilesh-a/swc_website

## Overview

##### Project Type and Purpose
- Type: Jamstack / Full-stack website
- Purpose: Client-facing site for SWC, powered by Next.js and fetching content from Sanity.io

##### File Structure
- Top-level “frontend” directory: a Next.js 13+ app
– components, pages (in `src/app/`), global styles, Tailwind config
– `sanity/client.ts` client to fetch data via GROQ
- Top-level “swcbackend” directory: Sanity schema and config
– schema definitions (`schemaTypes/*.ts`) define content models (blogs, events, etc.)
– `sanity.config.ts` for CMS project setup
- No traditional monolithic server—data is served by Sanity’s API

##### Key README Insights
- Minimal README, but directory names and config files (Next.js, Sanity CLI) reveal tech stack:
– React/Next.js, TypeScript, Tailwind CSS on front
– Sanity.io as headless CMS on back

##### Main Components & Their Relationships
a. Frontend
– Next.js server-side and client-side components
– UI library components (buttons, cards, sliders) in `components/ui/`
– Data-fetching layer with Sanity client
b. Backend
– Sanity Studio (local dev for content editors)
– Sanity Content Lake (hosted content store / Graph-oriented API)
c. Static Assets
– Images, video in `frontend/public/`
– Served via Next.js static file hosting or CDN
d. External Services
– Vercel (or Netlify) for CI/CD, build & hosting
– Sanity’s hosted API and auth

Flow:
User’s browser ←→ Next.js (SSR/SSG) ←→ Sanity Content API
Build pipeline: Git → Vercel CI → Next.js build → Deploy

##### Architectural Patterns & Design Principles
- Jamstack: pre-render pages (SSG) or server-side render (SSR) using data from a headless CMS
- Component-driven UI with shared design primitives
- Clear separation of concerns: presentation & data layer

##### Technologies & Frameworks
- Frontend: Next.js, React, TypeScript, Tailwind CSS, PostCSS
- Backend: Sanity.io (CLI, schema, types), GROQ client
- Tooling: ESLint, Prettier, Git, Vercel deploy

## Diagram (Mermaid)

```mermaid
graph TD
    %% User Layer
    Browser["User Browser"]:::external

    %% Frontend Layer
    subgraph "Frontend Layer"
        NextApp["Next.js App"]:::frontend
        NextConfig["next.config.ts"]:::frontend
        TailwindConfig["tailwind.config.ts"]:::frontend
        PostCSS["postcss.config.mjs"]:::frontend
        GlobalsCSS["globals.css"]:::frontend
        UILib["UI Components (components/ui)"]:::frontend
        SharedUI["Shared UI Components"]:::frontend
        Pages["Page-Level Routes"]:::frontend
        SanityClient["Sanity Client (client.ts)"]:::frontend
        SanityTypesFE["Sanity Types (types.ts)"]:::frontend
        Utils["Utility Functions"]:::frontend
        Constants["Design Constants"]:::frontend
        StaticAssets["Static Assets"]:::frontend
        Fonts["Fonts"]:::frontend
    end

    %% Backend Layer
    subgraph "Backend Layer"
        SanityStudio["Sanity Studio (Dev)"]:::backend
        SanityConfig["sanity.config.ts"]:::backend
        SanityCLI["sanity.cli.ts"]:::backend
        SanityGen["Sanity Generated Types"]:::backend
        SchemaManifest["schema.json"]:::backend
        SchemaDefs["Schema Definitions"]:::backend
        BackendStatic["backend static/.gitkeep"]:::backend
        ContentLake[(Sanity Content Lake)]:::database
    end

    %% CI/CD & Deployment
    subgraph "CI/CD & Deployment"
        Git["Git Repo"]:::external
        Vercel["Vercel CI/CD"]:::external
        CDN["CDN / Static Hosting"]:::external
    end

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

    %% Connections
    Browser -->|HTTP/HTTPS| NextApp
    NextApp -->|GROQ Queries| SanityClient
    SanityClient -->|Fetch Content| ContentLake
    NextApp -->|Serves| StaticAssets
    NextApp -->|Loads| Fonts

    %% Dev Local
    SanityConfig --> SanityStudio
    SanityCLI --> SanityStudio
    SanityGen --> SanityStudio
    SchemaManifest --> SanityStudio
    SchemaDefs --> SanityStudio
    BackendStatic --> SanityStudio
    SanityStudio -->|Reads/Writes| ContentLake

    %% CI/CD Flow
    Git --> Vercel
    Vercel --> NextApp
    Vercel --> CDN

    %% Documentation Link
    Readme --> NextApp

    %% Click Events
    click NextApp "https://github.com/akkilesh-a/swc_website/tree/main/frontend/src/app"
    click NextConfig "https://github.com/akkilesh-a/swc_website/blob/main/frontend/next.config.ts"
    click TailwindConfig "https://github.com/akkilesh-a/swc_website/blob/main/frontend/tailwind.config.ts"
    click PostCSS "https://github.com/akkilesh-a/swc_website/blob/main/frontend/postcss.config.mjs"
    click GlobalsCSS "https://github.com/akkilesh-a/swc_website/blob/main/frontend/src/app/globals.css"
    click UILib "https://github.com/akkilesh-a/swc_website/tree/main/frontend/src/components/ui"
    click SharedUI "https://github.com/akkilesh-a/swc_website/tree/main/frontend/src/components"
    click Pages "https://github.com/akkilesh-a/swc_website/blob/main/frontend/src/app/[about|blogs|clubs|events|newsletter]/page.tsx"
    click SanityClient "https://github.com/akkilesh-a/swc_website/blob/main/frontend/src/sanity/client.ts"
    click SanityTypesFE "https://github.com/akkilesh-a/swc_website/blob/main/frontend/src/sanity/types.ts"
    click Utils "https://github.com/akkilesh-a/swc_website/blob/main/frontend/src/lib/utils.ts"
    click Constants "https://github.com/akkilesh-a/swc_website/blob/main/frontend/src/constants/sanity.ts"
    click StaticAssets "https://github.com/akkilesh-a/swc_website/tree/main/frontend/public"
    click Fonts "https://github.com/akkilesh-a/swc_website/tree/main/frontend/src/fonts"
    click SanityConfig "https://github.com/akkilesh-a/swc_website/blob/main/swcbackend/sanity.config.ts"
    click SanityCLI "https://github.com/akkilesh-a/swc_website/blob/main/swcbackend/sanity.cli.ts"
    click SanityGen "https://github.com/akkilesh-a/swc_website/blob/main/swcbackend/sanity-typegen.json"
    click SanityStudio "https://github.com/akkilesh-a/swc_website/blob/main/swcbackend/sanity.types.ts"
    click SchemaManifest "https://github.com/akkilesh-a/swc_website/blob/main/swcbackend/schema.json"
    click SchemaDefs "https://github.com/akkilesh-a/swc_website/tree/main/swcbackend/schemaTypes"
    click BackendStatic "https://github.com/akkilesh-a/swc_website/blob/main/swcbackend/static/.gitkeep"
    click Readme "https://github.com/akkilesh-a/swc_website/blob/main/README.md"

    %% Styles
    classDef frontend fill:#D0E8FF,stroke:#0366D6,color:#0366D6;
    classDef backend fill:#E6FFDD,stroke:#34A853,color:#34A853;
    classDef external fill:#FFE8B3,stroke:#F9AB00,color:#F9AB00;
    classDef database fill:#FFEFD5,stroke:#FFA500,color:#FFA500;
    classDef docs fill:#F0F0F0,stroke:#999999,color:#333333;
```
