Skip to content

112batuhan/mapper-influences-backend-rs

Repository files navigation

https://www.mapperinfluences.com


Mapper influences backend code. This is actually a rewrite of this repository.

This implementation has more complete responses, optimizes osu! API calls and uses SurrealDB instead MongoDB as database. I'm more comfortable with rust and strong types so that's going to make things easier for me going forward.

/docs for endpoint documentation.

If you have feature requests or bug reports, you can do so in frontend repository or in our discord

How to run

Easiest way would be to use docker:

  • Copy .env.example and change the name to .env
  • Fill it with your credentials.
  • Use docker compose up to run the project..

You might only want to run database in docker, to do that just use docker compose up surrealdb -d

To run locally

cargo run --release

What is conversion.rs for?

It's a script to insert MongoDB data into SurrealDB. Don't use in production. I'm going to delete it after the migration is complete.

cargo run --bin conversion

How to run tests

Tests utilize Testcontainers to set up a new database for each test function. Testcontainers is based on docker. So be sure to have docker installed.

Then run cargo test

Tests record the osu! API responses into files. These files are then added to the repository to allow CI to work without calling osu! API every time. So if you make changes to the tests, delete the files in /tests/data and run tests with osu! API requests.

How to satisfy taplo (what even is it?)

Taplo is a toml file toolkit. You can format and check formatting of toml files. It even has an LSP!

For basic usage, run cargo install taplo-cli --locked and run taplo fmt to format the toml files.