add: README

This commit is contained in:
Franek 2024-04-29 16:58:16 +00:00
commit 9ea8fa8167

55
README.md Normal file
View File

@ -0,0 +1,55 @@
# zine API
API server for all **zine** services.
## Installation
1. [Install Rust](https://www.rust-lang.org/tools/install)
2. Clone this repository
3. Create `.env` file and edit your environment variables
4. Fetch required dependencies
```sh
cargo fetch
```
5. Run application
```sh
cargo run
```
## Environment variables
To run this project, you will need to add the following environment variables to your .env file
- General
| Variable name | Description | Default | Required |
| -- | -- | -- | -- |
| `HOST` | API host | 127.0.0.1 | false
| `PORT` | Port to listen to | 8080 | false
| `LOG_LEVEL` | Logging level (e.g. `INFO`, `WARN`, `ERROR`) | `INFO` | false
- Database
| Variable name | Description | Default | Required |
| -- | -- | -- | -- |
| `DATABASE_URI` | PostgreSQL database URI | | true
alternative solution:
| Variable name | Description | Default | Required |
| -- | -- | -- | -- |
| `DATABASE_HOST` | PostgreSQL database host | 127.0.0.1 | false
| `DATABASE_PORT` | PostgreSQL database port | 5432 | false
| `DATABASE_USER` | PostgreSQL database user | postgres | false
| `DATABASE_PASSWORD` | PostgreSQL database password | "" | false
> **Note**
>
> If provided, `DATABASE_URI` will **always** take precedence over `DATABASE_{HOST, PORT, USER, PASSWORD}`.
## Documentation
If you want to get some informations about our API, just see our [wiki](https://git.sador.me/zine/api/wiki)!
## Feedback
If you have any feedback, issue with our app, or anything related to our app, please reach out to us at **zine@sador.me**.
## License
[MIT](https://choosealicense.com/licenses/mit/)
## Authors & contributors
- [@sadorowo](https://git.sador.me/sadorowo)