Single part at the root, COMPOSE_FILE in .env

This commit is contained in:
hh
2026-09-08 20:38:27 +02:00
parent cb30b8c5d8
commit 40103e9bef
4 changed files with 142 additions and 85 deletions
+8 -9
View File
@@ -1,21 +1,20 @@
# newproject
One command that composes a project from the templates in this organization: `infra` at the root, then `backend-python`, `frontend-svelte` and `caddy` on top, each with its own answers file.
Composes a project from the templates in this organization: `infra` at the root, then `backend-python`, `frontend-svelte` and `caddy` on top, each with its own answers file in `.copier/`.
```sh
source ~/projects/templates/newproject/shell.sh
newproject ~/projects/my-thing
updateproject # every part
updateproject backend # one part
```
Templates are cloned from `https://git.kotikot.com/templates` by default; set `TEMPLATES_DIR` to a directory with local checkouts to work on the templates themselves. Every part updates independently:
`newproject` asks for the parts, the backend language, the frontend framework and how the frontend is served, then hands over to each template's own questions. Every prompt has a flag for non-interactive use:
```sh
copier update -a .copier/backend.yml
newproject ~/projects/my-thing --parts backend,frontend,caddy --backend python --frontend svelte --serve bun --defaults
```
Shapes it produces:
One part alone is rendered at the root of the project; two parts live in `backend/` and `frontend/`. Templates are cloned from `https://git.kotikot.com/templates` unless `TEMPLATES_DIR` points at a directory with local checkouts.
- infrastructure only: root `docker-compose.yml`, `Makefile`, `.env`, optional `caddy/`
- backend with one or many services, each `python -m <module>` from one image
- backend and frontend as separate containers behind Caddy
- backend serving the frontend's static build from the api
- frontend only
Requires `uv`; `bun`, `docker` and `pre-commit` are used by the generated projects.