-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: update todo-app example instructions.
- Loading branch information
Showing
1 changed file
with
34 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
``` |