Fullstack CourseLearn by building
Back to week 4

Topic

Notes API — Ship slice milestone

Definition

Milestone P4 proves a shippable Notes slice: Docker Compose for Postgres, list indexes via migration, attachment metadata upload, and a swappable NotesEventsPublisher with an in-memory adapter.

In simpler words

Finish Notes with Compose, indexes, attachments, and an event seam — then run the Week 4 grader.

Replaces the old all-in-one hands-on topic. Capstone coding, not a PLATFORM.md essay.

After this you can

  • Provide docker-compose.yml with Postgres
  • Add index migration for list filters/sorts
  • Upload attachment metadata + disk blob; publish note.created

How to work this milestone

Definition

A milestone is an auto-checked Notes API stage in apps/notes-practice: read the official Nest chapter, inspect the monorepo reference, implement the stage, then run the grader.

In simpler words

Literacy quiz (≥80%) still matters. The milestone command proves you can ship the week’s code.

Official tutorial order: docs/academy/fe-to-api/README.md (Week 4 — Capstone).

Official docs: Nest file upload + testing + deployment chapters — https://docs.nestjs.com/techniques/file-upload

Repo reference (read-only teaching slice): apps/notes-practice/docker-compose.yml, notes-events.publisher.ts, attachments route

Supplemental Nest/SQL links live under /resources.

Implement in apps/notes-practice, then run: pnpm course:validate-milestone be-notes-p4

On green, the CLI posts POST /course/milestones/:id/complete (cookie session) so progress saves with passedVia=milestone.

Acceptance checklist

- [ ] docker-compose.yml with postgres
- [ ] Index migration for list filters
- [ ] Attachment metadata + FileInterceptor
- [ ] Publisher interface + in-memory adapter on create
- [ ] pnpm course:validate-milestone be-notes-p4 is green

The grader encodes these checks; unchecked boxes mean the milestone is not done.

Deliverables

Definition

Deliverables are the concrete Nest files and behaviors this stage must produce.

In simpler words

Ship the smallest vertical slice that makes the grader green — not a redesign of the monorepo.

Compose Postgres; index migration; attachment upload endpoint

NotesEventsPublisher interface + InMemoryNotesEventsPublisher fired on create

README / lesson awareness of RabbitMQ swap + idempotency (judgment note)

Keep in mind

  • Judgment without Compose/indexes/code is incomplete.
  • You do not need a real Redis/Rabbit cluster for P4 — you need the seams.

Test

Check your understanding

At least 10 questions — mix of concept, syntax, practical, and logic. Score ≥ 80% (enforced by the API) to save progress.

Checking your session…

10 questions · concept 3 · syntax 3 · practical 2 · logic 2

Concept1. Hands-on: which statement is correct about Notes P4 ship slice?
Syntax2. Hands-on: which implementation matches proving P4?
Practical3. Hands-on scenario for Notes P4 ship slice — what should you do?
Logic4. Hands-on: which reasoning about proving P4 holds up in production?
Concept5. Hands-on: which statement is correct about Notes P4 ship slice?
Syntax6. Hands-on: which implementation matches proving P4?
Practical7. Hands-on scenario for Notes P4 ship slice — what should you do?
Logic8. Hands-on: which reasoning about proving P4 holds up in production?
Concept9. Hands-on: which statement is correct about Notes P4 ship slice?
Syntax10. Hands-on: which implementation matches proving P4?