How mike-north/typescript-courses works
High‐Level Overview
• Monorepo Root
– Yarn Workspaces & Plugins (.yarnrc.yml, plugins/*.cjs)
– Common configurations: tsconfig.json, .eslint*, Prettier, MarkdownLint
– GitHub actions (ci-website.yml, nightly-compatibility.yml, CodeQL)
• CI/CD Pipeline
– GitHub Actions → Lint → Type-check → Test → Build & Deploy
Main Components
A. Chat Sample App (packages/chat)
– Frontend
• Parcel build pipeline (.parcelrc)
• React UI (App.jsx + components/)
• Tailwind CSS (tailwind.config.js)
• Static assets & index.html
– Backend API Server
• Node.js + ES modules (api-server.mjs, index.mjs)
• Local JSON DB (db.json)
• HTTP endpoints consumed by UI
– Tests
• Jest + React Testing Library under packages/chat/tests
• Unit tests for data, utils, components
B. Static Website (packages/website)
– Content layer
• Markdown files under content/blog, courses.yml, etc.
• Images and static assets
– Build pipeline
• Gatsby (gatsby-config.js, gatsby-node.js, gatsby-browser.js)
• GraphQL data layer → React templates (src/templates/)
• Custom webpack/jest loaders (jest-preprocess.js)
– Tests & E2E
• Jest component tests (src/components/__tests__)
• Cypress E2E tests (cypress/)
C. Learning Modules (packages/*-ts, notes-*, hello-ts, http-error, welcome-to-ts)
– Individual TypeScript libraries / code examples
– Each with its own tsconfig.json, package.json
– Serve as in‐repo dependencies or standalone npm packages
– No runtime service; authors run tsc or import them in demos
Interactions & Data Flows
– Developer → clones repo → yarn install
– yarn workspace commands (yarn dev-chat, yarn dev-website) invoke package‐specific dev servers
– Chat UI ↔ HTTP calls ↔ Chat API ↔ JSON DB
– Website build: Markdown → GraphQL → React → Static HTML → served locally or deployed
– Learning modules compiled by tsc, imported by demos or website examples
Architectural Patterns & Principles
– Monorepo via Yarn Workspaces for shared dependencies and versioning
– Clear separation of concerns: frontend vs. backend vs. static site vs. library packages
– Standard TS project layout: src/, tests/, tsconfig.json per package
– Build‐time code generation (Gatsby GraphQL) vs. runtime server (Chat API)
– CI pipeline enforcing lint, type safety, tests, and site build