goalaim

Crates.iogoalaim
lib.rsgoalaim
version0.2.8
sourcesrc
created_at2024-06-19 09:13:59.183658
updated_at2024-07-08 09:34:27.442667
descriptionThis package is the backend of the goalaim project.
homepage
repositoryhttps://github.com/Les-Parpaings/GoalAim
max_upload_size
id1276680
size138,207
Victor (VidsSkids)

documentation

README

GoalAim Backend

Linux Rust

Table of Contents

Presentation

Here the repo of the Rust server.
The application will make call to the server to get the information.

Installation

Local db

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;

Launch server

To launch the server run :

cargo build

# or directly
cargo run

Unit Tests

To run the unit tests :

cargo test

Documentations

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.

Swagger

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.

Contributors

You can contact us at:

Noeme Suisse
Noeme Suisse

vic
Victor Massonnat

Commit count: 0

cargo fmt