An open API service indexing awesome lists of open source software.

https://github.com/ilkka/rust-backend-starter

A backend API starter with Rust & postgres
https://github.com/ilkka/rust-backend-starter

api openapi postgres rest rust swagger

Last synced: 12 days ago
JSON representation

A backend API starter with Rust & postgres

Awesome Lists containing this project

README

          

# Rust backend starter

Rust backend starter with

- OpenAPI spec & swagger with rocket_okapi
- Postgres with diesel
- dotenv for config (for development)

Why? Because I happened to work through this and all the bits weren't immediately obvious.

## How to start developing

1. Install diesel CLI with

```shell
cargo install diesel_cli --no-default-features --features postgres
```

2. Run the dev database with

```shell
docker-compose up -d
```

3. Run migrations with

```shell
diesel migration run
```

4. Install watchexec with

```shell
cargo install watchexec-cli
```

5. Start in dev mode with

```shell
watchexec --restart cargo run
```

6. Open up Swagger UI at http://localhost:8000/swagger