# bejistojoseph/minifacts architecture

> Architecture diagram of the GitHub repository bejistojoseph/minifacts, 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/bejistojoseph/minifacts
- Repository: https://github.com/bejistojoseph/minifacts

## Overview

##### Project type and purpose
- This is a single-page, front-end React + TypeScript website (“Minifacts”) delivered as static assets.
- Purpose: deliver mini facts, life-hacks, tech tips in a beautifully styled UI, built with Vite, Tailwind CSS, and shadcn/ui.

##### File structure
- Top-level: package.json, vite.config.ts, tsconfig*, postcss.config.js, tailwind.config.ts – build/config files for a static front-end.
- src/
- pages/ – route-mapped React pages (Index, Article, AboutUs, TechTips, etc.).
- components/ – reusable UI pieces, organized by feature (CategorySection, DiceRoller, TechTipCard) and a large ui/ subfolder for shadcn/ui primitives.
- data/ – techTipsData.ts (static content).
- hooks/ – custom React hooks (use-mobile, use-toast).
- lib/ – utility functions.
- main.tsx & index.html – Vite entrypoints.
- public/ – static assets (uploads, robots.txt).

##### README
- Confirms: Vite dev server, React+TS, Tailwind CSS, shadcn/ui, optional AI tooling for prototyping.
- No backend or external API integrations – all data is local.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Layers
    DevEnv["Developer Environment<br/>Node.js, NPM/Yarn, Git, Vite CLI"]:::build
    BuildPipeline["Build Pipeline<br/>Vite Bundler, PostCSS, Tailwind Processor"]:::build
    Hosting["Hosting/CDN<br/>Vercel/Netlify/CDN"]:::hosting
    Browser["Browser Runtime<br/>React App Execution"]:::runtime

    DevEnv -->|"runs build"| BuildPipeline
    BuildPipeline -->|"outputs /dist assets"| Hosting
    Hosting -->|"serves index.html + JS/CSS"| Browser

    subgraph "Browser Runtime" 
        direction TB
        subgraph "Entrypoints" 
            direction TB
            HTML["index.html"]:::code
            MainTS["src/main.tsx"]:::code
            IndexCSS["src/index.css"]:::code
            AppTSX["src/App.tsx"]:::code
            AppCSS["src/App.css"]:::code
            ViteEnv["src/vite-env.d.ts"]:::code
        end

        subgraph "Pages Layer" 
            direction TB
            Index["Index.tsx"]:::code
            Article["Article.tsx"]:::code
            AboutUs["AboutUs.tsx"]:::code
            TechTipsPage["TechTips.tsx"]:::code
            LifeHacks["LifeHacks.tsx"]:::code
            Minifacts["Minifacts.tsx"]:::code
            ContactUs["ContactUs.tsx"]:::code
            PrivacyPolicy["PrivacyPolicy.tsx"]:::code
            TermsOfService["TermsOfService.tsx"]:::code
            NotFound["NotFound.tsx"]:::code
        end

        subgraph "Feature Components" 
            direction TB
            CategorySection["CategorySection.tsx"]:::code
            Dice3D["Dice3D.tsx"]:::code
            DiceRoller["DiceRoller.tsx"]:::code
            FactCard["FactCard.tsx"]:::code
            FactOfDay["FactOfDay.tsx"]:::code
            FeaturedContent["FeaturedContent.tsx"]:::code
            Footer["Footer.tsx"]:::code
            Header["Header.tsx"]:::code
            Hero["Hero.tsx"]:::code
            Loader["Loader.tsx"]:::code
            NewsletterSection["NewsletterSection.tsx"]:::code
            RandomHackButton["RandomHackButton.tsx"]:::code
            ScrollToTop["ScrollToTop.tsx"]:::code
            TechProcessor["TechProcessor.tsx"]:::code

            subgraph "Tech-Tips Components" 
                direction TB
                CatNav["CategoryNavigation.tsx"]:::code
                TT_Hero["HeroSection.tsx"]:::code
                TT_Card["TechTipCard.tsx"]:::code
                TT_Grid["TechTipsGrid.tsx"]:::code
                TipDialog["TipProcessingDialog.tsx"]:::code
            end
        end

        subgraph "UI Primitives (shadcn/ui)" 
            direction TB
            UIPrims["src/components/ui (all .tsx)"]:::code
            UIUseToast["src/components/ui/use-toast.ts"]:::code
        end

        subgraph "Data & Hooks" 
            direction TB
            TechTipsData["techTipsData.ts"]:::code
            Utils["utils.ts"]:::code
            UseMobile["use-mobile.tsx"]:::code
            UseToast["use-toast.ts"]:::code
        end

        %% Internal relationships
        HTML --> MainTS
        MainTS --> AppTSX
        AppTSX --> PagesLayer
        AppTSX -->|"uses"| FeatureComponents
        AppTSX -->|"imports"| UIPrimitives
        AppTSX -->|"imports"| DataAndHooks

        PagesLayer -->|"renders"| FeatureComponents
        FeatureComponents -->|"use data/hooks"| DataAndHooks
        FeatureComponents -->|"use UI primitives"| UIPrimitives
    end

    %% Click events for Entrypoints
    click HTML "https://github.com/bejistojoseph/minifacts/blob/main/index.html"
    click MainTS "https://github.com/bejistojoseph/minifacts/blob/main/src/main.tsx"
    click IndexCSS "https://github.com/bejistojoseph/minifacts/blob/main/src/index.css"
    click AppTSX "https://github.com/bejistojoseph/minifacts/blob/main/src/App.tsx"
    click AppCSS "https://github.com/bejistojoseph/minifacts/blob/main/src/App.css"
    click ViteEnv "https://github.com/bejistojoseph/minifacts/blob/main/src/vite-env.d.ts"

    %% Click events for Pages
    click Index "https://github.com/bejistojoseph/minifacts/blob/main/src/pages/Index.tsx"
    click Article "https://github.com/bejistojoseph/minifacts/blob/main/src/pages/Article.tsx"
    click AboutUs "https://github.com/bejistojoseph/minifacts/blob/main/src/pages/AboutUs.tsx"
    click TechTipsPage "https://github.com/bejistojoseph/minifacts/blob/main/src/pages/TechTips.tsx"
    click LifeHacks "https://github.com/bejistojoseph/minifacts/blob/main/src/pages/LifeHacks.tsx"
    click Minifacts "https://github.com/bejistojoseph/minifacts/blob/main/src/pages/Minifacts.tsx"
    click ContactUs "https://github.com/bejistojoseph/minifacts/blob/main/src/pages/ContactUs.tsx"
    click PrivacyPolicy "https://github.com/bejistojoseph/minifacts/blob/main/src/pages/PrivacyPolicy.tsx"
    click TermsOfService "https://github.com/bejistojoseph/minifacts/blob/main/src/pages/TermsOfService.tsx"
    click NotFound "https://github.com/bejistojoseph/minifacts/blob/main/src/pages/NotFound.tsx"

    %% Click events for Feature Components
    click CategorySection "https://github.com/bejistojoseph/minifacts/blob/main/src/components/CategorySection.tsx"
    click Dice3D "https://github.com/bejistojoseph/minifacts/blob/main/src/components/Dice3D.tsx"
    click DiceRoller "https://github.com/bejistojoseph/minifacts/blob/main/src/components/DiceRoller.tsx"
    click FactCard "https://github.com/bejistojoseph/minifacts/blob/main/src/components/FactCard.tsx"
    click FactOfDay "https://github.com/bejistojoseph/minifacts/blob/main/src/components/FactOfDay.tsx"
    click FeaturedContent "https://github.com/bejistojoseph/minifacts/blob/main/src/components/FeaturedContent.tsx"
    click Footer "https://github.com/bejistojoseph/minifacts/blob/main/src/components/Footer.tsx"
    click Header "https://github.com/bejistojoseph/minifacts/blob/main/src/components/Header.tsx"
    click Hero "https://github.com/bejistojoseph/minifacts/blob/main/src/components/Hero.tsx"
    click Loader "https://github.com/bejistojoseph/minifacts/blob/main/src/components/Loader.tsx"
    click NewsletterSection "https://github.com/bejistojoseph/minifacts/blob/main/src/components/NewsletterSection.tsx"
    click RandomHackButton "https://github.com/bejistojoseph/minifacts/blob/main/src/components/RandomHackButton.tsx"
    click ScrollToTop "https://github.com/bejistojoseph/minifacts/blob/main/src/components/ScrollToTop.tsx"
    click TechProcessor "https://github.com/bejistojoseph/minifacts/blob/main/src/components/TechProcessor.tsx"
    click CatNav "https://github.com/bejistojoseph/minifacts/blob/main/src/components/tech-tips/CategoryNavigation.tsx"
    click TT_Hero "https://github.com/bejistojoseph/minifacts/blob/main/src/components/tech-tips/HeroSection.tsx"
    click TT_Card "https://github.com/bejistojoseph/minifacts/blob/main/src/components/tech-tips/TechTipCard.tsx"
    click TT_Grid "https://github.com/bejistojoseph/minifacts/blob/main/src/components/tech-tips/TechTipsGrid.tsx"
    click TipDialog "https://github.com/bejistojoseph/minifacts/blob/main/src/components/tech-tips/TipProcessingDialog.tsx"

    %% Click events for UI Primitives & Hooks & Data
    click UIPrims "https://github.com/bejistojoseph/minifacts/tree/main/src/components/ui"
    click UIUseToast "https://github.com/bejistojoseph/minifacts/blob/main/src/components/ui/use-toast.ts"
    click TechTipsData "https://github.com/bejistojoseph/minifacts/blob/main/src/data/techTipsData.ts"
    click Utils "https://github.com/bejistojoseph/minifacts/blob/main/src/lib/utils.ts"
    click UseMobile "https://github.com/bejistojoseph/minifacts/blob/main/src/hooks/use-mobile.tsx"
    click UseToast "https://github.com/bejistojoseph/minifacts/blob/main/src/hooks/use-toast.ts"

    %% Styles
    classDef code fill:#D0E8FF,stroke:#0366d6,color:#0366d6
    classDef build fill:#DFFFE0,stroke:#28A745,color:#28A745
    classDef hosting fill:#FFF0C2,stroke:#FF8C00,color:#FF8C00
    classDef runtime fill:#F3E8FF,stroke:#6F42C1,color:#6F42C1
```
