2022-07-08 15:30:15 +00:00
|
|
|
# User service
|
|
|
|
|
|
|
|
User service handles everything related to user creation, user login, etc...
|
|
|
|
|
|
|
|
## Installation
|
|
|
|
|
|
|
|
Use cargo to install the project dependencies
|
|
|
|
|
|
|
|
```bash
|
|
|
|
cargo build
|
|
|
|
```
|
|
|
|
|
|
|
|
## Setup
|
|
|
|
|
|
|
|
Env variables:
|
|
|
|
Create a .env file and include the following variables
|
|
|
|
1. HOST_ADDRESS
|
|
|
|
2. HOST_PORT
|
|
|
|
3. DB_HOST
|
|
|
|
4. DB_USER
|
|
|
|
5. DB_PASS
|
|
|
|
6. DB_DATABASE_NAME
|
|
|
|
7. DATABASE_URL
|
|
|
|
|
|
|
|
To run this project correctly, you must first apply the migrations to the database. You can do this by installing sqlx-cli.
|
|
|
|
|
|
|
|
```bash
|
|
|
|
cargo install sqlx-cli
|
|
|
|
```
|
|
|
|
|
|
|
|
Then execute and apply the migrations to the database.
|
|
|
|
|
|
|
|
```bash
|
|
|
|
sqlx migrate run
|
|
|
|
```
|
|
|
|
|
|
|
|
# Tests
|
|
|
|
Tests are WIP. Not done yet.
|
|
|
|
|
2022-07-08 16:51:34 +00:00
|
|
|
# Release
|
2022-07-11 15:08:29 +00:00
|
|
|
To build for release on current platform
|
2022-07-08 16:51:34 +00:00
|
|
|
|
|
|
|
```bash
|
|
|
|
cargo build --release
|
|
|
|
```
|
|
|
|
|
2022-07-11 15:08:29 +00:00
|
|
|
To build for release on x86-64 linux
|
|
|
|
|
|
|
|
```bash
|
|
|
|
cargo build --release --target x86_64-unknown-linux-gnu
|
|
|
|
```
|
|
|
|
Or follow this guide (Export these vars): [cross-compilation-from-m1](https://github.com/messense/homebrew-macos-cross-toolchains)
|
2022-07-08 16:51:34 +00:00
|
|
|
You can find the executable inside target/release/{name of proj}
|
|
|
|
|
2022-07-08 15:30:15 +00:00
|
|
|
## License & Attribution
|
|
|
|
By Franklin E. Blanco
|
|
|
|
[Creative Commons](https://creativecommons.org/licenses/by-nc-nd/3.0/legalcode)
|