stregsystem-rs is the rust edition of the stregsystem, with additional improvements. Some parts are still WIP.
Build the project with
cargo buildMake sure that rust is installed on your system.
You will need to install sqlx-cli.
cargo install sqlx-cliAfter this step create a file in the root of the project named .env.
This file should contain the following:
DATABASE_URL=postgres://stregsystemet:password@localhost/stregsystemetThe before you can build the project you need to run a postgres instance. Included in the project are scripts that starts an emphemeral postgres instance using docker (or podman). To start postgres run the following script:
./scripts/start_postgres.shOn Windows this is
scripts\start_postgres.batAfterwards the database schema must be initialized by running:
./scripts/init_db.shOn Windows:
scripts\init_db.batOptionally you can insert test data into the database:
./scripts/populate_sample_data.shOn Windows:
scripts\populate_sample_data.batYou can now build and run the project with:
cargo runBefore you commit your changes you must format the code and satisfy the linter:
cargo fmt
cargo clippyLastly, you have to update the sqlx files if you have updated any files with sql:
cargo sqlx prepare