stemmlerjs / dddforumv2

42 stars 10 forks source link

DDDForum V2: Phases of Craftship

What is this?

This is the v2 of [dddforum]() which we're using to demonstrate moving through the Phases of Craftship in The Software Essentialist.

Phases

  1. Code-First
  2. Best Practice-First
  3. Pattern-First
  4. Responsibility-First
  5. Value-First

The Best Practice-First Phase

At this level, the focus is on implementing the most valuable techniques from BDD, Continuous Delivery, Object-Oriented Design, TDD & so on.

The work we have to do here is broken into 4 key parts:

  1. | Automated Backend E2E tests
  2. | Test a Walking Skeleton (E2e UI to Backend Test Infrastructure)
  3. | Deploying the Skeleton to a Minimal Deployment Pipeline (w/ GitHub Actions, Render & Netlify)
  4. | Development Environment Refinements (for greater Discoverability & Understanding)

What's most important here?

Assuming we want to test everything from this folder, you can test/explore the following.

Pre-requisites

Docker

Ensure you've installed Docker on your machine and have it started.

This will allow us to run the local services we need (such as Postgres) without messy setup.

This keeps our development environments simple and reproducible.

Packages

npm ci

1. Automated Backend E2E tests

Automated tests are superior. Here's how we can do it on the backend.

Run the E2E tests

With the services built, you can now run the E2E tests.

npm run test:e2e

Note: This will start a PostgreSQL docker container, generate the Prisma client, run migrations, and start the backend server.

2. Test a Walking Skeleton (E2e UI to Backend Test Infrastructure)

A walking skeleton is a minimal slice of functionality through all of your major architectural components from the user's perspective.

Here's how you can test it out locally.

Step 1: Run the backend in a separate console.

npm run start:dev:backend

Note: This will start a PostgreSQL docker container, generate the Prisma client, run migrations, and start the backend server.

Step 2: Run the frontend server in a separate console.

npm run start:dev:frontend

3. Deploying the Skeleton to a Minimal Deployment Pipeline (w/ GitHub Actions, Render & Netlify)

Image incoming

... description incoming

4. Development Environment Refinements (for greater Discoverability & Understanding)

Image incoming

... description incoming

Other

Run the Backend Integration Tests

We run a few tests on the backend as well to prove that we can:

You can test these with:

npm run test:infra