If you prefer to use Docker for development, you can set up RomM using the provided Docker Compose configuration. This method simplifies the setup process by encapsulating all dependencies within Docker containers.
mkdir -p romm_mock/library/roms/switch
touch romm_mock/library/roms/switch/metroid.xci
mkdir -p romm_mock/resources
mkdir -p romm_mock/assets
mkdir -p romm_mock/config
touch romm_mock/config/config.ymlcp env.template .envROMM_BASE_PATH=/app/romm
DEV_MODE=truedocker compose build # or `docker compose build --no-cache` to rebuild from scratchdocker compose up -dAnd you're done! You can access the app at http://localhost:3000. Any changes made to the code will be automatically reflected in the app thanks to the volume mounts.
mkdir -p romm_mock/library/roms/switch
touch romm_mock/library/roms/switch/metroid.xci
mkdir -p romm_mock/resources
mkdir -p romm_mock/assets
mkdir -p romm_mock/config
touch romm_mock/config/config.ymlcp env.template .env# https://mariadb.com/docs/skysql-previous-release/connect/programming-languages/c/install/#Installation_via_Package_Repository_(Linux):
sudo apt install libmariadb3 libmariadb-dev libpq-dev
# Build and configure RAHasher (optional)
# This is only required to calculate RA hashes
# Users on macOS can skip this step as RAHasher is not supported
git clone --recursive https://github.com/RetroAchievements/RALibretro.git
cd ./RALibretro
git checkout 1.8.0
git submodule update --init --recursive
sed -i '22a #include <ctime>' ./src/Util.h
make HAVE_CHD=1 -f ./Makefile.RAHasher
cp ./bin64/RAHasher /usr/bin/RAHasherYou'll need uv installed
https://docs.astral.sh/uv/getting-started/installation/
curl -LsSf https://astral.sh/uv/install.sh | shThen create the virtual environment and install the dependencies using uv:
uv venv
source .venv/bin/activate
uv sync --all-extras --devdocker compose up -dMigrations will be run automatically when running the backend.
cd backend
uv run python3 main.pycd frontend
# npm version >= 9 needed
npm installmkdir assets/romm
ln -s ../romm_mock/resources assets/romm/resources
ln -s ../romm_mock/assets assets/romm/assetsnpm run devWe use Trunk for linting, which combines multiple linters and formatters with sensible defaults and a single configuration file. You'll need to install the Trunk CLI to use it.
curl https://get.trunk.io -fsSL | bashAlternative installation methods can be found in their docs. On commit, the linter will run automatically. To run it manually, use the following commands:
trunk fmt
trunk checkFailing to install and run the linter will result in a failed CI check, which won't allow us to merge your PR.
docker exec -i romm-db-dev mariadb -uroot -p<root password> < backend/romm_test/setup.sqlMigrations will be run automatically when running the tests.
cd backend
# path or test file can be passed as argument to test only a subset
uv run pytest [path/file]
# or run the following command to run all tests
# the -vv switch increases the verbosity of the output, providing more detailed information during test execution.
uv run pytest -vv