Skip to content

Commit 02cd4c4

Browse files
authored
Reorder monorepo workshop content to match video (#1199)
1 parent 10df7d3 commit 02cd4c4

File tree

26 files changed

+297
-224
lines changed

26 files changed

+297
-224
lines changed

.github/workflows/ci-website.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ jobs:
5252
- run: yarn
5353
- name: Build
5454
run: yarn build
55-
# - name: Lint
56-
# run: yarn lint
55+
- name: Lint
56+
run: yarn lint
5757
- name: Test
5858
run: yarn test
5959
- name: Cypress

packages/website/content/blog/domain-modeling-with-ts/02-value-objects-and-entities/index.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -68,18 +68,18 @@ import { PeashootEntity } from './peashoot-entity'
6868

6969
@Entity()
7070
export class Location extends PeashootEntity<'loc'> {
71-
constructor() {
72-
super('loc')
73-
}
71+
constructor() {
72+
super('loc')
73+
}
7474

75-
@Column('text')
76-
name!: string
75+
@Column('text')
76+
name!: string
7777

78-
@Column('text')
79-
region!: string
78+
@Column('text')
79+
region!: string
8080

81-
@Column('text')
82-
country!: string
81+
@Column('text')
82+
country!: string
8383
```
8484
8585
the base class `PeashootEntity<'loc'>` takes care of the id field for us, and prefixes it with `loc_` so that they're easy to identify if we ever see them logged.
@@ -89,7 +89,7 @@ The `@Entity` decorator is really important here. This is what means these are p
8989
## Our task
9090
9191
Our app contains a calculator UI
92-
![](./img/calculator.png)
92+
![Calculator UI](./img/calculator.png)
9393
where a gardener can enter a location and temperature, and they need to be able to get an estimate of the _date_ when the weather will be _no colder_ than that temperature.
9494
9595
Here's how the data flow works

packages/website/content/blog/domain-modeling-with-ts/03-ubiquitous-language/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ A key part of Domain-Driven Design is getting in the same room with Subject-Matt
1414

1515
When your SMEs and the people who write the software that they'll use are speaking in different terms, it's very likely that something will be lost in the conversation. **You want your future user/stakeholder to be able to correct any misconceptions you may have** (or verify that you're on the right track) and they must be able to understand what you're saying in order to do that. **It's actually important that you don't _adapt_ between different languages -- it's the actual application of the shared language that promotes strong alignment.**
1616

17-
#### Tips
17+
### Tips
1818

1919
- Clarify and confirm terminology to ensure shared meanings.
2020
- Use visual tools to make abstract concepts tangible.
@@ -24,7 +24,7 @@ When your SMEs and the people who write the software that they'll use are speaki
2424

2525
Don't immediately jump in to suggest solutions too early, or your user might say "sure, build that" before a shared understanding is discussed.
2626

27-
#### Tips
27+
### Tips <!-- markdownlint-disable-line MD024 -->
2828

2929
- Focus on business problems before proposing solutions.
3030
- Ask open-ended questions to understand motivations, not just surface details.
@@ -36,7 +36,7 @@ Don't immediately jump in to suggest solutions too early, or your user might say
3636

3737
As you build, you're going to run into more questions. You'll demonstrate what you've built and how you ended up organizing things, and it's important that you confirm with your user that you're on the right track. Keep pursuing a distillation of the _core domain_ -- the part of the software that's at the heart of its reason for existence
3838

39-
#### Tips
39+
### Tips <!-- markdownlint-disable-line MD024 -->
4040

4141
- Summarize and reflect concepts back to experts for verification.
4242
- Identify and focus on critical business domain aspects that create core value.

packages/website/content/blog/domain-modeling-with-ts/04-seed-collection-discussion/index.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ If you have access to an LLM, here's a prompt to seed a conversation with
188188
<pre>
189189
You are a "domain expert" (in the Domain Driven Design sense) in planning, caring for and harvesting vegetable gardens planted in raised garden beds, to be used in a domain driven design workshop for software engineers to practice conversing with a "domain expert". You are to engage in a collaborative conversation around common language to be used in this problem space, and the core complexity associated with your gardening challenges. You are looking for the person engaging with you in conversation to help you solve some of your challenges in a piece of gardening software, so err on the side of asking for help rather than offering help.
190190

191-
You have a seed collection of hundreds of packets of vegetable seeds, and your garden has about 600sqft of plantable area. Your garden is irrigated with a 12 zone Rachio irrigation controller, with independent zones for raised bed areas vs. ground-level areas (e.g. for trees, shrubs). Your garden is in Kirkland, WA USA. You don't know a thing about building software, and are familiar with the concept of a database, the concept of custom logic in software (e.g. spreadsheet formulas, simple "if this, then that" rules), etc...
191+
You have a seed collection of hundreds of packets of vegetable seeds, and your garden has about 600sqft of plantable area. Your garden is irrigated with a 12 zone Rachio irrigation controller, with independent zones for raised bed areas vs. ground-level areas (e.g. for trees, shrubs). Your garden is in Kirkland, WA USA. You don't know a thing about building software, and are familiar with the concept of a database, the concept of custom logic in software (e.g. spreadsheet formulas, simple "if this, then that" rules), etc...
192192

193193
To get plants started, you have ~14 cheap hydroponic devices (generic versions of an AeroGarden) on Amazon with an 18-pod capacity, and set them up on folding tables in a spare room in your house. You keep seedlings in the hydroponic setup long enough that they can benefit from the accelerated hydroponic growth, but not so long that it's difficult to extract the planting sponges (which you buy on Temu) from the plastic baskets without damaging the plant's roots. You like the "square foot garden" concept because it simplifies spacing requirements and makes it easy to plan raised beds. Your outdoor raised beds are placed in different locations on your property, some of which get "full sun", and others that are in partially shady spots. The beds vary in shape -- 6 are 14x2 feet, 14 are 8x2, 5 are 3x6, 1 is 4x4, 3 are 4x6, one is 2x3, 3 are 2x2
194194

@@ -212,8 +212,7 @@ You have several fruit trees in your garden
212212
- 4x Ranier Cherry
213213
- 1x Paradise Apple
214214

215-
216-
And a few perennials
215+
And a few perennials
217216
- Anna Hardy Kiwi
218217
- Thornless red raspberry
219218
- Several highbush blueberry plants

packages/website/content/blog/domain-modeling-with-ts/05-seed-collection-implementation/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ description: "Let's attempt our first discussion with a domain expert and an AI
66
course: domain-modeling-with-ts
77
---
88

9-
## Let's implement it!
9+
## Let's implement it
1010

11-
![](./img/seed-collection-ui.png)
11+
![seed collection](./img/seed-collection-ui.png)
1212

1313
Once you've decided on your domain model, implement it in the workshop project!
1414

packages/website/content/blog/domain-modeling-with-ts/06-bounded-contexts/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ We have a need for this in our workshop project! There's a fancy UI for dragging
1414
![Drag and drop raised bed planning UI](./img/dnd-ui.png)
1515

1616
We have an existing domain model that lives in our UI
17-
![](./img/ui-bounded-context.png)
17+
![bounded context diagram](./img/ui-bounded-context.png)
1818

1919
This has nothing to do with gardening! Our UI entirely deals in a world of
2020

packages/website/content/blog/domain-modeling-with-ts/07-raised-beds-domain-discussion/index.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ course: domain-modeling-with-ts
99
Time to dig into our garden bed domain model. Let's start with the following user needs to anchor on to
1010

1111
> I need to be able to plan out where I want things to go in my raised beds, well in advance of the plants actually going into the ground
12-
1312
> I'd like to embrace the square-foot garden concept
14-
1513
> I'd like to ensure I put my plants in the place that's best for them
1614
1715
These are intentionally vague statements. Dometimes your domain experts will use terminology that you don't understand, or that's insufficiently precise to build software around. Part of your job is to ask clarifying questions and help drive a discussion that leads toward deeper understanding and **refinement of knowledge**.

packages/website/content/blog/domain-modeling-with-ts/08-raised-beds-domain-implementation/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ description: "We'll implement our raised bed entities, value objects and relatio
66
course: domain-modeling-with-ts
77
---
88

9-
Now let's implement our domain model! Our goal is to get some sort of diagram showing up on the http://localhost:5173/garden page.
9+
Now let's implement our domain model! Our goal is to get some sort of diagram showing up on the <http://localhost:5173/garden> page.
1010

1111
- The plants must show up as the appropriate size (e.g. tomatoes must be 2x2 tiles)
1212
- The plant tiles (`ItemPlacement` in the UI domain model) should have a working icon (it's ok if a few don't work). Icons are in `packages/client/public/plant-icons/*` and if you just provide an `Item.iconPath` that's set to a filename in that folder, it should show up on the tile

packages/website/content/blog/monorepos-v2/01-intro/index.md

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,23 @@ order: 1
99

1010
![monorepos-v2 logo](./img/monorepos-v2-256.png)
1111

12-
1312
A monorepo is the concept of **many software packages being stored in the same SCM repository**. There are several key benfits
13+
1414
* Monorepo dependencies are _always on latest_.
1515
* Atomic multi-package code changes
1616
* Simpler external dependency
1717
* Upstream changes validated against downstream test suites
1818

1919
In this course, we'll refactor a small client/server app into monorepo. By the end, we'll have
20+
2021
* Monorepo dependencies automatically linked
2122
* Parallized dependency-aware task execution for build, linting and testing
2223
* Commands for CI that run tests on _only the code affected by the change_
23-
* Support for _some_ packages in the monorepo being more coupled with each other than others, by design (e.g. using _private_ functionality)
24+
* Support for _some_ packages in the monorepo being more coupled with each other than others, by design (e.g. using _private_ functionality)
2425
* Automatic code documentation
2526

2627
We're going to be using some of the latest and greatest tooling, including
28+
2729
* `pnpm`
2830
* `lerna` v7
2931
* `nx` for distributed caching
@@ -35,33 +37,41 @@ We're going to be using some of the latest and greatest tooling, including
3537
* `syncpack` (or an equivalent `nx` tool) to rally your monorepo around a single version of each dependency
3638
* ...and more!!!
3739

38-
3940
## Project setup
4041

41-
### 1. Make sure you have [`pnpm`](https://pnpm.io/) installed.
42+
### 1. Make sure you have [`pnpm`](https://pnpm.io/) installed
43+
4244
If you don't using `volta` (get it at [https://volta.sh](https://volta.sh)) is a great way to obtain it.
4345

44-
First, install volta
46+
First, install volta
47+
4548
```sh
4649
curl https://get.volta.sh | bash
4750
```
51+
4852
You may need to close and reopen your terminal before your can verify that your environment has volta installed
53+
4954
```sh
5055
volta --version
5156
> 2.0.2
5257
```
58+
5359
Then you can run
60+
5461
```sh
5562
volta install pnpm
5663
```
64+
5765
And you should be good to go. Alternatively you can follow [`pnpm`'s direct installation instructions](https://pnpm.io/installation)
5866

5967
### 2. Check out the git repo
68+
6069
```sh
6170
git clone git@github.com:mike-north/ts-monorepos-v2
6271
```
6372

6473
### 3. Install dependencies
74+
6575
```sh
6676
cd ts-monorepos-v2 # Enter the project folder
6777
pnpm install # Install dependencies
@@ -80,8 +90,8 @@ pnpm run test # Test the project
8090
```sh
8191
pnpm run dev
8292
```
83-
* You should be able to go to http://localhost:3000/api/seeds in a browser and see some JSON
84-
* You should be able to go to http://localhost:5173/ and see a UI that looks like this
8593

94+
* You should be able to go to <http://localhost:3000/api/seeds> in a browser and see some JSON
95+
* You should be able to go to <http://localhost:5173/> and see a UI that looks like this
8696

87-
![app screenshot](./img/app-ui-screenshot-512.png)
97+
![app screenshot](./img/app-ui-screenshot-512.png)

packages/website/content/blog/monorepos-v2/02-project-tour/index.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,23 @@ order: 2
1010
This project, currently a small monolith, consists of a couple of things. We'll end up turning each of these areas into a dedicated package by the end of the course
1111

1212
### Model(s)
13+
1314
A TypeScript interface describing the file data (search for `seed-packet-model.ts`)
1415

1516
### Server
17+
1618
#### Data
19+
1720
A data file with some info about seed packets (search for `seeds.yml`)
21+
1822
#### API
19-
A server that loads the data file and starts an express server to serve the data as JSON (entry point is `src/server/main.ts`). **This API is on [`http://localhost:3000/api/seeds`](http://localhost:3000/api/seeds)**
2023

24+
A server that loads the data file and starts an express server to serve the data as JSON (entry point is `src/server/main.ts`). **This API is on [`http://localhost:3000/api/seeds`](http://localhost:3000/api/seeds)**
2125

2226
### UI
27+
2328
A Svelte 5 UI for fetching the data from the server and rendering some components in the browser (search for `App.svelte` as the entry point). **This UI is served on [`http://localhost:5173/`](http://localhost:5173/)**
2429

2530
### Utilities
26-
Some utility functions in `src/utils`
2731

32+
Some utility functions in `src/utils`

0 commit comments

Comments
 (0)