# altaseb-chernet/30-days-of-typescript architecture

> Architecture diagram of the GitHub repository altaseb-chernet/30-days-of-typescript, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-03-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/altaseb-chernet/30-days-of-typescript
- Repository: https://github.com/altaseb-chernet/30-days-of-typescript

## Overview

This repository is not a single application with runtime components; it is a course-style monorepo of independent TypeScript lesson units.

#### Top-level structure

The repo has three main top-level concerns:

1. **Course landing content**
   - `README.md` explains the challenge, audience, and workflow.
   - `assets/TypeScript.png` is the visual hero asset used by the root README.

2. **Daily lesson folders**
   - `day-01-...` through `day-28-...`
   - Each day is a self-contained learning module focused on one TypeScript topic.
   - The folders are intentionally isolated; there is no central application runtime connecting them.

3. **Generated artifacts**
   - Many day folders include `dist/` output alongside `src/`.
   - These are TypeScript build outputs: compiled JavaScript plus declaration files and source maps.
   - The repo appears to commit build artifacts for instructional convenience.

#### Main architectural pattern

The dominant pattern is:

- **Source of truth:** `src/index.ts`
- **Build step:** TypeScript compiler via `tsconfig.json`
- **Outputs:** `dist/index.js`, `dist/index.d.ts`, and `.map` files

This repeated structure is the core architectural boundary across most days. In the diagram, each day can be represented as an independent package/module with:
- lesson source,
- compiler configuration,
- compiled outputs.

#### Per-day module boundaries

Each day folder is a standalone teaching slice. The names show the progression of concern areas:

- Days 1–4: TypeScript fundamentals, type system, arrays/tuples, objects/type aliases
- Days 5–17: functions, unions, assertions, literal types, interfaces, classes, generics, utility types, type guards, OOP, interface merging
- Days 18–21: modules/imports, DOM manipulation, events/forms, event propagation
- Days 22–24: async TypeScript, fetch/API typing, error handling
- Days 25–28: advanced patterns, performance, design patterns

From an architecture standpoint, these are not interconnected services; they are **incremental educational units**. A learner can open any day independently.

#### Notable structural differences

A few folders deviate from the common `src` + `dist` layout:

- **Day 5** has only `src/` and `tsconfig.json` in the tree shown, with no committed `dist/`.
- **Day 10** places compiled outputs under `src/` instead of a separate `dist/`.
- **Day 18** includes a nested Node project setup:
  - `src/package.json`
  - `src/package-lock.json`
  - `src/node_modules/`
  - this suggests the lesson demonstrates module/import/project structure using a local npm environment.
- **Day 28** is shown with only `src/index.ts`, suggesting either incomplete build artifacts or a newer/leaner lesson layout.

These inconsistencies matter for a diagram because they show that the repo is **not standardized as a production package monorepo**; it is a collection of lesson examples with slightly different setup per topic.

#### Execution/runtime boundaries

The repo mixes several execution contexts depending on the lesson:

- **TypeScript-only conceptual lessons** in early days
- **Browser-oriented lessons** in the DOM/event/fetch days
- **Async/runtime lessons** in later days
- **Module/package lessons** in day 18 with an actual npm project inside a lesson folder

There is no evidence of a central backend, database, message bus, or shared API layer. Any external interaction is lesson-specific and isolated to that day’s example code.

#### How to diagram it accurately

A good architecture diagram for this repo should show:

- A **root course container**
  - README and assets
- A **series of independent daily lesson modules**
  - each with `src/index.ts`
  - most with `tsconfig.json`
  - many with build outputs in `dist/`
- A **TypeScript compilation boundary**
  - source to generated JS and typings
- A **special nested npm lesson module** for day 18
- No shared runtime dependencies between days

In short: this is an instructional TypeScript curriculum repo, organized as loosely coupled, per-day mini-projects rather than a single integrated software system.

Main entry points: [`README.md`](https://github.com/altaseb-chernet/30-days-of-typescript/blob/HEAD/README.md) (README), [`day-18–Modules, Imports(Exports & Project Structure)/src/package.json`](https://github.com/altaseb-chernet/30-days-of-typescript/blob/HEAD/day-18%E2%80%93Modules%2C%20Imports(Exports%20%26%20Project%20Structure)/src/package.json) (Day 18 package), [`day-18–Modules, Imports(Exports & Project Structure)/src/package-lock.json`](https://github.com/altaseb-chernet/30-days-of-typescript/blob/HEAD/day-18%E2%80%93Modules%2C%20Imports(Exports%20%26%20Project%20Structure)/src/package-lock.json) (Package lock), [`day-18–Modules, Imports(Exports & Project Structure)/src/node_modules`](https://github.com/altaseb-chernet/30-days-of-typescript/tree/HEAD/day-18%E2%80%93Modules%2C%20Imports(Exports%20%26%20Project%20Structure)/src/node_modules) (Installed deps)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph "Root content"
  readme["README<br/>course docs<br/>[README.md]"]
  hero_asset["TypeScript art<br/>asset"]
end

subgraph "Lesson phases"
  lesson_collection["Daily lessons<br/>curriculum monorepo"]
  phase_fundamentals["Days 1-4<br/>foundations"]
  phase_core_types["Days 5-17<br/>core language"]
  phase_modules_ui["Days 18-21<br/>modules and DOM"]
  phase_async_api["Days 22-24<br/>async and API"]
  phase_advanced["Days 25-28<br/>advanced patterns"]
end

subgraph "Build boundary"
  ts_source["Source lesson<br/>src/index.ts pattern"]
  tsconfig["Compiler config<br/>tsconfig"]
  dist_output["Compiled output<br/>generated JS+types"]
  lesson_readme["Lesson notes<br/>per-day README"]
end

subgraph "Runtime contexts"
  browser_runtime(("Browser lessons<br/>DOM runtime"))
  node_runtime(("Node/npm lesson<br/>nested package runtime"))
end

subgraph "Special setup"
  day18_pkg[("Day 18 package<br/>nested npm project<br/>[package.json]")]
  day18_lock["Package lock<br/>npm lockfile<br/>[package-lock.json]"]
  day18_modules["Installed deps<br/>node_modules"]
end

readme -->|"describes"| lesson_collection
hero_asset -->|"illustrates"| readme
lesson_collection -->|"contains"| phase_fundamentals
lesson_collection -->|"contains"| phase_core_types
lesson_collection -->|"contains"| phase_modules_ui
lesson_collection -->|"contains"| phase_async_api
lesson_collection -->|"contains"| phase_advanced
lesson_collection -->|"uses"| lesson_readme
lesson_collection -->|"standardizes on"| ts_source
lesson_collection -->|"builds with"| tsconfig
ts_source -->|"compiled by"| tsconfig
tsconfig -->|"emits"| dist_output
phase_fundamentals -->|"implements"| ts_source
phase_core_types -->|"implements"| ts_source
phase_modules_ui -->|"runs in"| browser_runtime
phase_async_api -->|"often runs in"| browser_runtime
phase_advanced -->|"implements"| ts_source
phase_modules_ui -->|"includes"| node_runtime
node_runtime -->|"defines"| day18_pkg
node_runtime -->|"pins"| day18_lock
node_runtime -->|"installs"| day18_modules
day18_pkg -->|"hosts"| ts_source
dist_output -->|"appears in"| phase_fundamentals
dist_output -->|"appears in"| phase_core_types
dist_output -->|"appears in"| phase_modules_ui
dist_output -->|"appears in"| phase_async_api
dist_output -->|"appears in"| phase_advanced

click readme "https://github.com/altaseb-chernet/30-days-of-typescript/blob/main/README.md"
click day18_pkg "https://github.com/altaseb-chernet/30-days-of-typescript/blob/main/day-18–Modules, Imports(Exports & Project Structure)/src/package.json"
click day18_lock "https://github.com/altaseb-chernet/30-days-of-typescript/blob/main/day-18–Modules, Imports(Exports & Project Structure)/src/package-lock.json"
click day18_modules "https://github.com/altaseb-chernet/30-days-of-typescript/tree/main/day-18–Modules, Imports(Exports & Project Structure)/src/node_modules"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class readme,hero_asset toneBlue
class lesson_collection,phase_fundamentals,phase_core_types,phase_modules_ui,phase_async_api,phase_advanced toneAmber
class ts_source,tsconfig,dist_output,lesson_readme toneMint
class browser_runtime,node_runtime toneRose
class day18_pkg,day18_lock,day18_modules toneIndigo
```

## Components

### Root content

Course landing content and repository metadata

- [README](https://github.com/altaseb-chernet/30-days-of-typescript/blob/HEAD/README.md): course docs · Root landing page describing the challenge and workflow · `README.md`
- **TypeScript art**: asset · Hero illustration referenced by the landing README

### Lesson phases

Independent TypeScript lesson units grouped by topic progression

- **Daily lessons**: curriculum monorepo · Independent day folders; each lesson is self-contained
- **Days 1-4**: foundations · Intro, type system basics, arrays/tuples, objects and aliases
- **Days 5-17**: core language · Functions, unions, assertions, literals, interfaces, classes, generics, guards, OOP
- **Days 18-21**: modules and DOM · Imports, project structure, DOM, events, forms, propagation
- **Days 22-24**: async and API · Async TypeScript, fetch typing, and advanced error handling
- **Days 25-28**: advanced patterns · Advanced type patterns, utility types, performance, design patterns

### Build boundary

Repeated source-to-output compilation pattern across lessons

- **Source lesson**: src/index.ts pattern · Representative lesson source file pattern used across days
- **Compiler config**: tsconfig · Per-lesson TypeScript compiler boundary
- **Compiled output**: generated JS+types · Generated JavaScript, declaration files, and source maps
- **Lesson notes**: per-day README · README files inside lesson folders provide topic guidance

### Runtime contexts

Browser-oriented and Node/npm-specific lesson environments

- **Browser lessons**: DOM runtime · Lessons that rely on browser APIs and event-driven interaction
- **Node/npm lesson**: nested package runtime · Lesson 18 includes a local npm project inside the lesson folder

### Special setup

Outlier lesson with nested npm project structure

- [Day 18 package](https://github.com/altaseb-chernet/30-days-of-typescript/blob/HEAD/day-18%E2%80%93Modules%2C%20Imports(Exports%20%26%20Project%20Structure)/src/package.json): nested npm project · Local package.json and package-lock.json embedded in the lesson · `day-18–Modules, Imports(Exports & Project Structure)/src/package.json`
- [Package lock](https://github.com/altaseb-chernet/30-days-of-typescript/blob/HEAD/day-18%E2%80%93Modules%2C%20Imports(Exports%20%26%20Project%20Structure)/src/package-lock.json): npm lockfile · Lockfile for the nested lesson package · `day-18–Modules, Imports(Exports & Project Structure)/src/package-lock.json`
- [Installed deps](https://github.com/altaseb-chernet/30-days-of-typescript/tree/HEAD/day-18%E2%80%93Modules%2C%20Imports(Exports%20%26%20Project%20Structure)/src/node_modules): node_modules · Nested dependency directory for the module/import lesson · `day-18–Modules, Imports(Exports & Project Structure)/src/node_modules`

## Connections

- README → Daily lessons: describes · The landing README introduces the curriculum structure
- TypeScript art → README: illustrates · Hero image supports the root documentation
- Daily lessons → Days 1-4: contains · Top-level lesson progression starts with fundamentals
- Daily lessons → Days 5-17: contains · Middle lessons expand the type system and OOP concepts
- Daily lessons → Days 18-21: contains · Later lessons shift into modules and browser interaction
- Daily lessons → Days 22-24: contains · Async, fetch, and error-handling lessons form another phase
- Daily lessons → Days 25-28: contains · Final lessons focus on advanced patterns and best practices
- Daily lessons → Lesson notes: uses · Each daily folder includes a lesson README
- Daily lessons → Source lesson: standardizes on · Most lessons center on a single source entrypoint pattern
- Daily lessons → Compiler config: builds with · Each lesson uses its own TypeScript compiler configuration
- Source lesson → Compiler config: compiled by · Source files are processed through the lesson compiler config
- Compiler config → Compiled output: emits · Compiler output produces JS, types, and maps in most days
- Days 1-4 → Source lesson: implements · Early days use the standard source pattern
- Days 5-17 → Source lesson: implements · Core language lessons follow the same source/build shape
- Days 18-21 → Browser lessons: runs in · DOM and event lessons depend on browser APIs
- Days 22-24 → Browser lessons: often runs in · Fetch and async examples may execute in browser-like contexts
- Days 25-28 → Source lesson: implements · Advanced lessons still use the same lesson entrypoint pattern
- Days 18-21 → Node/npm lesson: includes · Day 18 adds an actual npm package environment inside the lesson
- Node/npm lesson → Day 18 package: defines · Nested package.json marks the special lesson boundary
- Node/npm lesson → Package lock: pins · Lockfile captures the local package state
- Node/npm lesson → Installed deps: installs · Nested dependencies are committed for the lesson environment
- Day 18 package → Source lesson: hosts · The module lesson still centers on TypeScript source
- Compiled output → Days 1-4: appears in · Most early lessons commit compiled artifacts
- Compiled output → Days 5-17: appears in · Compiled outputs are common across the middle lessons
- Compiled output → Days 18-21: appears in · Browser/module lessons also commit generated files
- Compiled output → Days 22-24: appears in · Async and API lessons include built outputs
- Compiled output → Days 25-28: appears in · Later lessons continue the same output pattern
