Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: improve README #37

Merged
merged 1 commit into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 21 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,35 @@

This is the laskugeneraattoori backend written in Rust.

The application is based on [axum](https://github.com/tokio-rs/axum):
The application is based on [axum](https://github.com/tokio-rs/axum).
PDF generation is based on [typst](https://github.com/typst/typst).

## Development
## Configuration

You need a local Postgres setup or (maybe preferably) use [Docker Compose](https://docs.docker.com/compose/gettingstarted/) or any other container runtime
The following variables can be configured in the environment (or the .env file)

```sh
docker compose up -d
# VARIABLE="default value"

PORT=3000
BIND_ADDR=127.0.0.1
ALLOWED_ORIGINS= # comma separated list of urls
MAILGUN_URL=
MAILGUN_USER=
MAILGUN_PASSWORD=
MAILGUN_TO=
MAILGUN_FROM=
```

You need diesel CLI for running migrations:
## Running laskugeneraattori

### With cargo
```sh
cargo install diesel_cli
cargo run
```

Nith the DB up, run migrations:

```sh
diesel migration run
```

Now the tests should pass:

### With Docker
```sh
cargo test
```

## Features/TODO:

- [x] create invoice + validation
- [ ] create user + authentication
- [x] list invoices
- [ ] edit invoice
- [ ] ratelimits
- [ ] generate pdf
- [ ] write documentation
docker build . -t laskugeneraattori
docker run laskugeneraattori
``
29 changes: 15 additions & 14 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
version: "3"

services:
postgres:
image: postgres:latest
ports:
- "5432:5432"
volumes:
- data:/var/lib/postgresql/data
laskugeneraattori:
build:
context: .
dockerfile: Dockerfile
environment:
- POSTGRES_PASSWORD=postgres
- POSTGRES_USER=postgres
- POSTGRES_DB=laskugeneraattori

volumes:
data:
- PORT=3000
- BIND_ADDR=0.0.0.0
- ALLOWED_ORIGINS=
- MAILGUN_URL=
- MAILGUN_USER=
- MAILGUN_PASSWORD=
- MAILGUN_TO=
- MAILGUN_FROM=
ports:
- "3000:3000"
restart: always