vbytes-lan-attendence/README.md

38 lines
1.2 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# VBytes Attendance
## Requirements
- Docker Engine (with Compose v2)
## Setup
1. Copy the provided `.env` file (already checked in). Adjust if needed:
```env
POSTGRES_PASSWORD=postgrespass123
JWT_SECRET=supersecretjwtkey
ADMIN_USERNAME=admin
ADMIN_PASSWORD=AdminPass!234
JWT_COOKIE_SECURE=false
ENABLE_HTTPS_REDIRECT=false
WEB_PORT=3000
CSRF_ALLOWED_ORIGINS=http://192.168.68.61:3000
```
- Change `JWT_SECRET` and `ADMIN_PASSWORD` before production use.
- Keep `JWT_COOKIE_SECURE=false` and `ENABLE_HTTPS_REDIRECT=false` unless you run behind HTTPS.
- Update `CSRF_ALLOWED_ORIGINS` local network ip/port you will use to host the application on.
2. Start the stack:
```bash
docker compose up -d --build
```
3. Open the web app at `http://<this-machine-ip>:3000` using the admin credentials (`ADMIN_USERNAME`, `ADMIN_PASSWORD`).
4. Stop the stack:
```bash
docker compose down
```
To wipe Postgres data (e.g., after upgrading versions), also remove the volume:
```bash
docker volume rm vbytes_postgres-data
```
Thats it—the Compose file starts Postgres, the Rust API, and the SvelteKit frontend using the values from `.env`.