2025-03-07 09:21:37 +01:00
|
|
|
|
# Servala Portal
|
2025-03-03 15:26:47 +00:00
|
|
|
|
|
2025-03-05 10:31:38 +01:00
|
|
|
|
The Servala Self-Service Portal
|
|
|
|
|
|
|
|
|
|
## Development setup
|
|
|
|
|
|
2025-03-05 17:28:57 +01:00
|
|
|
|
First, copy the ``.env.example`` file to ``.env`` and adjust the settings to your needs.
|
|
|
|
|
Make sure to source the file before running any commands.
|
|
|
|
|
|
|
|
|
|
Then use ``uv`` to install the project and run its commands while you’re developing:
|
2025-03-05 10:31:38 +01:00
|
|
|
|
|
|
|
|
|
```bash
|
2025-03-05 10:50:31 +01:00
|
|
|
|
uv sync --dev
|
2025-03-05 10:31:38 +01:00
|
|
|
|
uv run src/manage.py migrate
|
|
|
|
|
uv run src/manage.py runserver
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
This will start the development server on http://localhost:8000.
|
2025-03-05 10:50:31 +01:00
|
|
|
|
|
|
|
|
|
### Configuration
|
|
|
|
|
|
|
|
|
|
TODO
|
|
|
|
|
|
|
|
|
|
### Code style and linting
|
|
|
|
|
|
|
|
|
|
Servala uses several linters / formatters to keep the project style consistent for you.
|
|
|
|
|
Run them like this:
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
uv run black src/ # Code formatting; -c to just check
|
|
|
|
|
uv run isort src/ # Import ordering; -c to just check
|
|
|
|
|
uv run djlint src/ --reformat --format-js --format-css # Format templates, JS and CSS, --check to just check
|
|
|
|
|
uv run flake8 src/ # Python linter
|
|
|
|
|
```
|
|
|
|
|
|
2025-03-07 16:58:54 +01:00
|
|
|
|
### Docker
|
|
|
|
|
|
|
|
|
|
The project provides a Dockerfile which builds a production-ready container image.
|
|
|
|
|
It uses [Caddy](https://caddyserver.com/) to serve static files and connect to [Gunicorn](https://gunicorn.org/), the Python WSGI application server.
|
|
|
|
|
|
|
|
|
|
Building:
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
docker build -t local/servala-portal .
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Running:
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
docker run --rm -ti -p 8080:8080 --name=servala-portal --rm --env-file .env local/servala-portal
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
TODO: Persistence
|
2025-03-05 10:50:31 +01:00
|
|
|
|
|
|
|
|
|
### Testing
|
|
|
|
|
|
|
|
|
|
TODO
|