# microsoft/frontend-bootcamp architecture

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

- Interactive diagram: https://gitdiagram.com/microsoft/frontend-bootcamp
- Repository: https://github.com/microsoft/frontend-bootcamp

## Overview

##### Project type and purpose
- This is a “monorepo” front-end workshop project: a collection of standalone React/TypeScript demos and exercises for a two-day bootcamp.
- It is *not* a single full-stack application but a multi-page, educational codebase. Each “stepX-YY” and “bonus-…” folder contains a mini-app (demo / exercise / final).

##### Top-level file-structure analysis
- package.json, tsconfig.json, webpack.config.js – define the build, bundling and TypeScript setup across all sub-folders.
- jest.config.js, jest.setup.js – unit-test configuration for “bonus-jest” and other testable modules.
- server/index.js + server/now.json – optional Node/Express (or Now/Vercel) server for production/static hosting.
- assets/ – shared CSS/JS used by the root index.html and step landing pages.
- azure-pipelines.yml & azure-pipelines.pr.yml – CI/CD in Azure Pipelines for build/test/deploy.
- step1-01 … step2-06 – sequential workshop modules. Each module has three variants (demo, lesson, exercise), typically containing HTML, a small React/TSX app, and CSS.
- bonus-servicecalls – a sample Redux + service-call demo.
- bonus-jest – a sample Jest testing exercise.

##### Key README insights
- “npm start” runs the inner-loop dev server (webpack-dev-server).
- “Demos” and “Exercises” are navigated via index.html at root; webpack watches all “step*/**/*.tsx/ts” and reloads on change.
- CI will lint, build, test (jest), and (via now.json) deploy to Vercel or static host.

A. Developer environment
– Node.js/NPM on local machine
– VS Code for editing
– Webpack Dev Server (localhost:3xxx)
B. Code Repository & CI/CD
– GitHub (origin)
– Azure Pipelines (build → test → deploy)
– Vercel/Now (static hosting via server/now.json)
C. Build & Bundling
– webpack.config.js + tsconfig.json
– Input: all “step*”, “bonus-*”, “markdownReadme”, “playground” sources
– Output: bundled JS/CSS per mini-app, served under distinct URLs or index.html routing
D. Front-end micro-apps
– Multi-page React+TSX apps under each step folder
– Shared assets (assets/*.css, *.js)
– Demo vs exercise vs final code variants
E. Testing
– Jest + ts-jest for unit tests (bonus-jest)
– jest.config.js roots tests in “bonus-jest” and possibly any .spec.ts(x) under step folders
F. Optional backend
– server/index.js – Express or Now server to serve static bundles or API mocks
– server/now.json – Vercel deployment configuration

##### Relationships & data-flow
1. Developer edits source → Webpack watches and rebuilds → Dev server serves updated bundles → Browser hot-reload
2. git push → Azure Pipelines triggers → Lint/Build/Unit-Tests → Artifact → Deploy to Vercel → Public URL serving static pages
3. In bonus-servicecalls, React components dispatch Redux actions → Service layer makes HTTP calls to an API endpoint (could be a mock or real backend) → Reducers update store → App UI re-renders

##### Architectural patterns & principles
- Monorepo with per-step micro-frontends: each lesson is self-contained.
- Component-based (React): each UI piece lives in its own folder under components/.
- State management examples escalate: plain React state → Context API → Redux store → Redux+service calls.
- TypeScript for type safety; tsconfig enables compile-time checking per folder.
- Centralized bundler (webpack) for all modules; shared config.
- CI-as-Code via azure-pipelines.yml and serverless deployment via now.json.

##### Technologies & frameworks
– Front-end: React, TypeScript, TSX, Redux (bonus), React Context
– Build tools: Webpack, Babel (via ts-loader or babel-loader), CSS loaders
– Testing: Jest + ts-jest
– CI/CD: Azure Pipelines
– Deployment: Now/Vercel (server/now.json)
– Editor: VS Code with recommended settings (.vscode folder)

##### Critical detail reminders
– Label every component clearly (e.g., “Webpack Dev Server”, “Azure Pipelines”)
– Include names of key config files (webpack.config.js, jest.config.js, now.json) near their respective tools

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Developer Environment
    subgraph "Developer Workstation"
        DEV_NODE["Node.js / NPM"]:::developer
        DEV_VSCODE["VS Code"]:::developer
        DEV_NPMSTART["npm start"]:::developer
        DEV_NODE --> DEV_NPMSTART
        DEV_VSCODE --> DEV_NPMSTART
    end

    %% Source Repository
    subgraph "Source Monorepo" 
        MONO["Monorepo Root"]:::frontend
        GITIGNORE[".gitignore"]:::frontend
        README["README.md"]:::frontend
        LICENSE["LICENSE & LICENSE-CODE"]:::frontend
        PRETTIER["prettier.config.js"]:::frontend
        MONO --> GITIGNORE
        MONO --> README
        MONO --> LICENSE
        MONO --> PRETTIER
    end

    %% CI/CD Pipeline
    subgraph "CI/CD Pipeline" 
        GITHUB["GitHub"]:::cicd
        AZP["Azure Pipelines"]:::cicd
        AZPR["azure-pipelines.pr.yml"]:::cicd
        AZP --> AZPR
        GITHUB --> AZP
    end

    %% Build & Bundling
    subgraph "Build Tools"
        WP["webpack.config.js"]:::build
        TSC["tsconfig.json"]:::build
        PKG["package.json"]:::build
        LOCK["package-lock.json"]:::build
        WP --- TSC
        WP --- PKG
        PKG --- LOCK
    end

    %% Dev Server & Bundler Flow
    DEV_NPMSTART --> WP
    WP --> DEV_SERVER["Webpack Dev Server"]:::build
    DEV_SERVER --> BROWSER["Browser (Chrome)"]:::developer

    %% Front-end Micro-apps
    subgraph "Front-end Micro-apps" 
        SHARED["Shared Assets"]:::frontend
        SHARED_SCRIPTS["assets/scripts.js"]:::frontend
        SHARED_CSS1["assets/shared.css"]:::frontend
        SHARED_CSS2["assets/step.css"]:::frontend
        INDEXHTML["index.html (root)"]:::frontend
        SHARED --> SHARED_SCRIPTS
        SHARED --> SHARED_CSS1
        SHARED --> SHARED_CSS2
        SHARED --> INDEXHTML

        subgraph "Steps 1"
            S101["step1-01/ … step1-07/"]:::frontend
        end
        subgraph "Steps 2"
            S201["step2-01/ … step2-06/"]:::frontend
        end
        subgraph "Bonus Modules"
            BSC["bonus-servicecalls/demo/"]:::frontend
            BJEST["bonus-jest/"]:::frontend
        end
        subgraph "Extras"
            MD["markdownReadme/src/index.ts"]:::frontend
            PLAY["playground/index.html"]:::frontend
        end
        SHARED --> S101
        SHARED --> S201
        SHARED --> BSC
        SHARED --> BJEST
        SHARED --> MD
        SHARED --> PLAY
    end

    %% Testing
    subgraph "Testing"
        JESTCFG["jest.config.js"]:::build
        JESTSETUP["jest.setup.js"]:::build
        BJEST --> JESTCFG
        BJEST --> JESTSETUP
    end

    %% Optional Backend & Deployment
    subgraph "Hosting / Serverless"
        SERVER["server/index.js"]:::hosting
        NOWCFG["server/now.json"]:::hosting
        VERCEL["Now/Vercel"]:::hosting
        AZP --> VERCEL
        VERCEL --> SERVER
        SERVER --> NOWCFG
    end

    %% Connections
    DEV_NPMSTART -->|"serves bundles"| DEV_SERVER
    DEV_SERVER -->|hot-reload| BROWSER
    GITHUB -->|git push triggers| AZP
    AZP -->|"build/test"| WP
    AZP -->|"deploy artifact"| VERCEL
    BSC --> UI["React UI"]:::frontend
    UI --> ACTION["Redux Action"]:::frontend
    ACTION --> SERVICE["Service Layer (HTTP)"]:::frontend
    SERVICE --> API["API Endpoint (mock/external)"]:::frontend
    API --> REDUCER["Reducer / Store"]:::frontend
    REDUCER --> UI

    %% Click Events
    click DEV_VSCODE "https://github.com/microsoft/frontend-bootcamp/tree/master/.vscode/"
    click GITIGNORE "https://github.com/microsoft/frontend-bootcamp/blob/master/.gitignore"
    click README "https://github.com/microsoft/frontend-bootcamp/blob/master/README.md"
    click LICENSE "https://github.com/microsoft/frontend-bootcamp/tree/master/LICENSE"
    click PRETTIER "https://github.com/microsoft/frontend-bootcamp/blob/master/prettier.config.js"
    click AZP "https://github.com/microsoft/frontend-bootcamp/blob/master/azure-pipelines.yml"
    click AZPR "https://github.com/microsoft/frontend-bootcamp/blob/master/azure-pipelines.pr.yml"
    click WP "https://github.com/microsoft/frontend-bootcamp/blob/master/webpack.config.js"
    click TSC "https://github.com/microsoft/frontend-bootcamp/blob/master/tsconfig.json"
    click PKG "https://github.com/microsoft/frontend-bootcamp/blob/master/package.json"
    click LOCK "https://github.com/microsoft/frontend-bootcamp/blob/master/package-lock.json"
    click SHARED_SCRIPTS "https://github.com/microsoft/frontend-bootcamp/blob/master/assets/scripts.js"
    click SHARED_CSS1 "https://github.com/microsoft/frontend-bootcamp/blob/master/assets/shared.css"
    click SHARED_CSS2 "https://github.com/microsoft/frontend-bootcamp/blob/master/assets/step.css"
    click INDEXHTML "https://github.com/microsoft/frontend-bootcamp/blob/master/index.html"
    click S101 "https://github.com/microsoft/frontend-bootcamp/tree/master/step1-01/"
    click S201 "https://github.com/microsoft/frontend-bootcamp/tree/master/step2-06/"
    click BSC "https://github.com/microsoft/frontend-bootcamp/tree/master/bonus-servicecalls/demo/"
    click BJEST "https://github.com/microsoft/frontend-bootcamp/tree/master/bonus-jest/"
    click JESTCFG "https://github.com/microsoft/frontend-bootcamp/blob/master/jest.config.js"
    click JESTSETUP "https://github.com/microsoft/frontend-bootcamp/blob/master/jest.setup.js"
    click MD "https://github.com/microsoft/frontend-bootcamp/blob/master/markdownReadme/src/index.ts"
    click PLAY "https://github.com/microsoft/frontend-bootcamp/blob/master/playground/index.html"
    click SERVER "https://github.com/microsoft/frontend-bootcamp/blob/master/server/index.js"
    click NOWCFG "https://github.com/microsoft/frontend-bootcamp/blob/master/server/now.json"

    %% Styles
    classDef developer fill:#d4f4dd,stroke:#2c7a2a,color:#2c7a2a;
    classDef cicd fill:#d0e7ff,stroke:#1e57a0,color:#1e57a0;
    classDef build fill:#ffe6b3,stroke:#cc7a00,color:#cc7a00;
    classDef frontend fill:#f2e6ff,stroke:#7a3399,color:#7a3399;
    classDef hosting fill:#e0e0e0,stroke:#666666,color:#666666;
```
