Crates.io | goalaim |
lib.rs | goalaim |
version | 0.2.8 |
source | src |
created_at | 2024-06-19 09:13:59.183658 |
updated_at | 2024-07-08 09:34:27.442667 |
description | This package is the backend of the goalaim project. |
homepage | |
repository | https://github.com/Les-Parpaings/GoalAim |
max_upload_size | |
id | 1276680 |
size | 138,207 |
Here the repo of the Rust server.
The application will make call to the server to get the information.
You have to setup a local postgres db with docker :
# Install diesel
cargo install diesel_cli --no-default-features --features postgres
# creation du docker:
sudo docker run --name goalaim_db -d -p 5432:5432 -e POSTGRES_PASSWORD=admin postgres
# CMD for the end
# Connect yourself to the docker :
psql --host=0.0.0.0 -U postgres
# Always restart the docker :
sudo docker update --restart always goalaim_db
# In the docker :
CREATE DATABASE goalaim_db;
CREATE DATABASE test_db;
# In the .env at the root of the project
DATABASE_TEST_URL=postgres://postgres:admin@0.0.0.0/test_db
DATABASE_URL=postgres://postgres:admin@0.0.0.0/goalaim_db
PORT=8080
JWT_SECRET="celui qui lit ça est gay"
For Diesel set this in your .bashrc or .zshrc and then, restart your terminal
# relace user by the real name
export PATH="$PATH:/home/user/.cargo/bin"
To create the Table in the docker psql :
diesel migration run
To check if the table is created :
# Connection
psql --host=0.0.0.0 -U postgres
# Connect yourself to the db
\connect goalaim_db
# Check if table exist
SELECT * FROM users;
To launch the server run :
cargo build
# or directly
cargo run
To run the unit tests :
cargo test
To have the Documentation of the code :
cargo doc
Now you have to go to ${ACTUAL_PATH}/target/doc/goalaim/ and open the index.html in the browser.
You can have the swagger of our API routes in Swagger
You can have a preview of our swagger with the Swagger Preview extension in vscode.
You can contact us at:
Noeme Suisse |
Victor Massonnat |