From 191aa70ba13021e7be61e781b52dfdf251c5af9c Mon Sep 17 00:00:00 2001 From: James Arthur <thruflo@gmail.com> Date: Tue, 26 Nov 2024 15:15:31 +0100 Subject: [PATCH] docs: update todo-app example instructions. --- examples/todo-app/README.md | 44 ++++++++++++++++++++++++++++--------- 1 file changed, 34 insertions(+), 10 deletions(-) diff --git a/examples/todo-app/README.md b/examples/todo-app/README.md index 4948e9769b..ce69e3e8ed 100644 --- a/examples/todo-app/README.md +++ b/examples/todo-app/README.md @@ -1,22 +1,46 @@ # Todo example +This is a classic TodoMVC example app, developed using ElectricSQL. + ## Setup -1. Make sure you've installed all dependencies for the monorepo and built packages +This example is part of the [ElectricSQL monorepo](../..) and is designed to be built and run as part of the [pnpm workspace](https://pnpm.io/workspaces) defined in [`../../pnpm-workspace.yaml`](../../pnpm-workspace.yaml). + +Navigate to the root directory of the monorepo, e.g.: + +```shell +cd ../../ +``` + +Install and build all of the workspace packages and examples: + +```shell +pnpm install +pnpm run -r build +``` + +Navigate back to this directory: -From the root directory: +```shell +cd examples/todo-app +``` -- `pnpm i` -- `pnpm run -r build` +Start the example backend services using [Docker Compose](https://docs.docker.com/compose/): -2. Start the docker containers +```shell +pnpm backend:up +``` -`pnpm run backend:up` +> Note that this always stops and deletes the volumes mounted by any other example backend containers that are running or have been run before. This ensures that the example always starts with a clean database and clean disk. -3. Start the dev server +Now start the dev server: -`pnpm run dev` +```shell +pnpm dev +``` -4. When done, tear down the backend containers so you can run other examples +When you're done, stop the backend services using: -`pnpm run backend:down` +```shell +pnpm backend:down +``` \ No newline at end of file