Skip to content

Commit a3c5459

Browse files
committed
Local dev documentation
Added guidance on developing locally for Nuxt, and updated the package.json (again) for local dev (still works intermittently).
1 parent 3f1fe39 commit a3c5459

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

README.md

+31
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,37 @@ The input variables, with their default values (some auto generated) are:
124124
- `docker_image_celeryworker`: Docker image for the celery worker. By default, based on your Docker image prefix.
125125
- `docker_image_frontend`: Docker image for the frontend. By default, based on your Docker image prefix.
126126

127+
### Local development
128+
129+
Once the Cookiecutter script has completed, you will have a folder populated with the base project and all input variables customised.
130+
131+
Change into the project folder and run the `docker-compose` script to build the project containers:
132+
133+
```bash
134+
docker-compose build --no-cache
135+
```
136+
137+
And start them:
138+
139+
```bash
140+
docker-compose up -d
141+
```
142+
143+
**NOTE:** I find that the **Nuxt** container does not run well in development mode, and does not refresh on changes. In particular, `nuxt/content` is very unpredictable in dev mode running in the container. It is far better to run the `frontend` outside of the container to take advantage of live refresh.
144+
145+
Change into the `/frontend` folder, and:
146+
147+
```bash
148+
yarn install
149+
yarn dev
150+
```
151+
152+
Be careful about the version of `Node.js` you're using. As of today (December 2022), the latest Node version supported by Nuxt is 16.18.1.
153+
154+
You can then view the frontend at `http://localhost:3000` and the backend api endpoints at `http://localhost/redoc`.
155+
156+
FastAPI `backend` updates will refresh automatically, but the `celeryworker` container must be restarted before changes take effect.
157+
127158
## How to deploy
128159

129160
This stack can be adjusted and used with several deployment options that are compatible with Docker Compose, but it is designed to be used in a cluster controlled with pure Docker in Swarm Mode with a Traefik main load balancer proxy handling automatic HTTPS certificates, using the ideas from <a href="https://dockerswarm.rocks" target="_blank">DockerSwarm.rocks</a>.

{{cookiecutter.project_slug}}/frontend/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"private": true,
33
"scripts": {
44
"build": "nuxt build",
5-
"dev": "node_modules/nuxt/bin/nuxt.mjs dev",
5+
"dev": "nuxt dev",
66
"generate": "nuxt generate",
77
"start": "nuxt start",
88
"preview": "nuxt preview"

0 commit comments

Comments
 (0)