Skip to content

Commit

Permalink
docs: improve README
Browse files Browse the repository at this point in the history
  • Loading branch information
lajp committed Oct 24, 2024
1 parent 1a3653c commit 93e2f50
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 40 deletions.
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

0 comments on commit 93e2f50

Please sign in to comment.