# {{name}}

A pyvelm-based application.

## Quick start (Docker, production mode)

```bash
cp .env.example .env
docker compose up --build
# → http://localhost:8000/login   (admin / admin)
```

Uses gunicorn with ``PYVELM_ENV=production`` (no ``/docs``, Secure cookies).

## Quick start (Docker, development + reload)

```bash
cp .env.example .env
docker compose -f docker-compose.yml -f docker-compose.dev.yml up --build
```

Runs ``python -m app.serve --reload`` with ``PYVELM_ENV=development``.

## Quick start (bare metal)

```bash
cp .env.example .env
python3 -m venv venv
source venv/bin/activate
pip install -e .
python -m app.serve --reload
# → http://localhost:8000/login
# → http://localhost:8000/docs   (development only)
```

## Adding a module

```bash
pyvelm new my_module
```

That drops a runnable stub under **`app/modules/my_module/`** (not
directly under `app/`). Each module is a folder with a
`__pyvelm__.py` manifest at its root.

**Docker:** the bundled `docker-compose.yml` bind-mounts
`./app/modules` into the container, so you do **not** need
`docker compose build` after every `pyvelm new` — only a restart:

```bash
pyvelm new my_module
docker compose restart app
```

Then open **Apps** (`/web/apps`), find your module, and click
**Install**. Sidebar menus appear after install (see
`app/modules/my_module/views/menu.py`).

If you removed the volume mount for a production image, rebuild
instead: `docker compose up --build -d`.

## Production deployment

The `deploy/` directory ships templates for both flavours:

- **Docker** — the bundled `docker-compose.yml` runs Postgres + the
  app + a dedicated cron worker. Suitable for a small VPS or your
  own Kubernetes deployment.
- **systemd + nginx** — `deploy/systemd/*.service` and
  `deploy/nginx.conf` template a bare-metal deploy where Postgres
  is its own service and gunicorn runs under systemd. See the
  pyvelm docs for the step-by-step walkthrough.

## Documentation

See the [pyvelm docs](https://pypi.org/project/pyvelm/) for the
framework reference: models, views, security, the Apps catalog,
deployment, and more.
