Skip to content

✨ EroticHub — a university project built in 🦀 Rust for the FI MUNI PV281 Programming in Rust course.

Notifications You must be signed in to change notification settings

Ricaps/EroticHub

Repository files navigation

Erotic Hub

PV281 Semestal project at FI MUNI

Prerequisites

Ensure you have docker and docker-compose installed.

For local development and successful build, you must have GStreamer installed.

Run in release mode

If you want to add data from an existing database into the released application, add the resources by copying them into the docker/erotic-hub/data/ folder. Add the database dump into the docker/postgres/db-data folder. Use this command to create such a dump:

docker exec -t erotic-hub-db-1 pg_dump -U postgres -d erotic-hub --column-inserts --create > docker/postgres/db-data/dump2.sql

Before running the application, set up the environmental variables accordingly. You can copy either of these files:

If you set SEED_DATA=true, you have to copy the resources from seed_resources to docker/erotic-hub/data/.

Use the docker compose script to run the application:

With seed data

cp .env.release-with-seed .env
cp -r seed_resources/. docker/erotic-hub/data/
docker compose --profile release up -d

The app should now run at http://localhost:8000/.

Without seed data

cp .env.release-without-seed .env
docker compose --profile release up -d

The app should now run at http://localhost:8000/.

Run in development mode

In development mode, the EroticHub container is not built and created.

  1. Start all docker services
docker compose --profile dev up -d
  1. Set up environmental variables. You can use the example file:
cp .env.dev .env
  1. Create the database
sqlx database create
  1. Run migrations
sqlx migrate run
  1. Prepare seed data
cp -r seed_resources/ resources/
  1. Run the application
cargo run

The app should now run at http://localhost:8000/.

You can access the database through the Adminer running at http://localhost:8080/.

Important!!! After you update repositories, add migration, or add other SQLx commands, you must run following command to generate offline SQLx files. Otherwise, it's not possible to release the EroticHub! Following command creates files in the .sqlx folder, don't forget to commit them!

cargo sqlx prepare

About

✨ EroticHub — a university project built in 🦀 Rust for the FI MUNI PV281 Programming in Rust course.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •