### Install Trunk CLI Source: https://github.com/rommapp/romm/blob/master/DEVELOPER_SETUP.md Installs the Trunk CLI for linting and formatting. Alternative installation methods are available in the Trunk documentation. ```shell curl https://get.trunk.io -fsSL | bash ``` -------------------------------- ### Application Startup Sequence Source: https://github.com/rommapp/romm/blob/master/docs/BACKEND_ARCHITECTURE.md Details the steps involved in starting the application, including database migrations, asynchronous startup tasks like initializing scheduled jobs and loading caches, and finally starting the ASGI server. ```text 1. alembic upgrade head # Run database migrations 2. startup.main() # Async startup tasks ├── Initialize scheduled jobs (RQ Scheduler) │ ├── cleanup_netplay │ ├── scan_library (if ENABLE_SCHEDULED_RESCAN) │ ├── update_switch_titledb │ ├── update_launchbox_metadata │ ├── convert_images_to_webp │ └── sync_retroachievements_progress └── Load fixture caches into Redis ├── mame_index.json ├── scummvm_index.json ├── ps1/ps2/psp serial indexes └── known_bios_files.json 3. uvicorn.run("main:app") # Start ASGI server └── FastAPI lifespan ├── Create aiohttp.ClientSession ├── Create httpx.AsyncClient └── Store in app.state + context vars ``` -------------------------------- ### Install uv and Python Dependencies Source: https://github.com/rommapp/romm/blob/master/DEVELOPER_SETUP.md Installs the uv package manager and then synchronizes all Python dependencies for development. ```shell curl -LsSf https://astral.sh/uv/install.sh | sh uv venv source .venv/bin/activate uv sync --all-extras --dev ``` -------------------------------- ### Install System Dependencies Source: https://github.com/rommapp/romm/blob/master/DEVELOPER_SETUP.md Installs necessary system libraries for MariaDB and PostgreSQL. RAHasher build is optional and not supported on macOS. ```shell # 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.3 git submodule update --init --recursive make HAVE_CHD=1 -f ./Makefile.RAHasher cp ./bin64/RAHasher /usr/bin/RAHasher ``` -------------------------------- ### Run Backend Application Source: https://github.com/rommapp/romm/blob/master/DEVELOPER_SETUP.md Starts the RomM backend application. Database migrations are handled automatically. ```shell cd backend uv run python3 main.py ``` -------------------------------- ### Run Frontend Development Server Source: https://github.com/rommapp/romm/blob/master/DEVELOPER_SETUP.md Starts the frontend development server for RomM. ```shell npm run dev ``` -------------------------------- ### Install Node.js Dependencies Source: https://github.com/rommapp/romm/blob/master/DEVELOPER_SETUP.md Installs frontend Node.js dependencies. Requires npm version 9 or higher. ```shell cd frontend # npm version >= 9 needed npm install ``` -------------------------------- ### Start Docker Containers Source: https://github.com/rommapp/romm/blob/master/DEVELOPER_SETUP.md Starts the RomM application and its dependencies in detached mode. ```shell docker compose up -d ``` -------------------------------- ### Axios Client Setup Source: https://github.com/rommapp/romm/blob/master/docs/FRONTEND_ARCHITECTURE.md Configure the base URL and timeout for the Axios API client. This setup is used for all outgoing API requests. ```typescript const api = axios.create({ baseURL: "/api", timeout: 120000, // 2 minutes }); ``` -------------------------------- ### SQLAlchemy Engine and Session Setup Source: https://github.com/rommapp/romm/blob/master/docs/BACKEND_ARCHITECTURE.md Configures the synchronous SQLAlchemy engine and session factory for database interactions. Ensure database connection URL is correctly set in configuration. ```python sync_engine = create_engine( ConfigManager.get_db_engine(), pool_pre_ping=True, # Connection health check echo=False, # SQL logging (DEV_SQL_ECHO overrides) ) sync_session = sessionmaker(bind=sync_engine, expire_on_commit=False) ``` -------------------------------- ### RomM Other API Endpoints Source: https://github.com/rommapp/romm/blob/master/docs/BACKEND_ARCHITECTURE.md Lists various other API endpoints for system health, setup, statistics, asset management, firmware, export, netplay, and play sessions. ```markdown | Router | Path | | ------------- | -------------------------------------- | | Heartbeat | `GET /api/heartbeat` | | Heartbeat | `GET /api/heartbeat/metadata/{source}` | | Heartbeat | `GET /api/setup/library` | | Heartbeat | `POST /api/setup/platforms` | | Stats | `GET /api/stats` | | Raw | `HEAD /api/raw/assets/{path}` | | Raw | `GET /api/raw/assets/{path}` | | Firmware | Standard CRUD | | Export | `POST /api/export/gamelist-xml` | | Export | `POST /api/export/pegasus` | | Netplay | `GET /api/netplay/list` | | Play Sessions | `POST /api/play-sessions` | | Play Sessions | `GET /api/play-sessions` | | Sync | `/api/sync/*` | ``` -------------------------------- ### Vue App Startup Sequence Source: https://github.com/rommapp/romm/blob/master/docs/FRONTEND_ARCHITECTURE.md Illustrates the order of operations when the Vue application initializes, from creating the app instance to mounting it. ```text index.html └──