### Install Dependencies and Run Development Server Source: https://github.com/mewolab/aquadx/blob/v1-dev/AquaNet/README.md Use these commands to install project dependencies and start the local development server. Ensure Node.js and bun are installed, and the AquaDX server is running with the correct `aqua_host` configuration. ```shell bun install bun run dev ``` -------------------------------- ### Start AquaDX with Docker Compose Source: https://github.com/mewolab/aquadx/blob/v1-dev/docs/self-hosting.md Use Docker Compose to start the AquaDX services. Ensure you are in the AquaDX folder. ```bash docker compose up ``` -------------------------------- ### Build AquaDX Project Source: https://github.com/mewolab/aquadx/blob/v1-dev/docs/self-hosting.md Build the AquaDX project using Gradle after installing JDK 21. The output JAR file will be in the build/libs folder. ```bash ./gradlew clean build ``` -------------------------------- ### Import Data into MariaDB Source: https://github.com/mewolab/aquadx/blob/v1-dev/docs/mysql_to_mariadb.md First, connect to your MariaDB server using the MySQL client. Then, use the `source` command to import the data from the `aqua.sql` file. ```bash mysql --user={username} --password={password} --host={host} --port={port} {database} ``` ```sql source aqua.sql; ``` -------------------------------- ### Run MariaDB Server with Docker Compose Source: https://github.com/mewolab/aquadx/blob/v1-dev/docs/mysql_to_mariadb.md Use this Docker Compose configuration to set up a MariaDB server. Ensure the volume path `./db` exists or adjust as needed. ```yaml version: '3.1' services: mariadb: image: mariadb restart: always environment: MYSQL_ROOT_PASSWORD: example MYSQL_DATABASE: aqua MYSQL_USER: aqua MYSQL_PASSWORD: aqua ports: - '127.0.0.1:3306:3306' volumes: - ./db:/var/lib/mysql ``` -------------------------------- ### Backup Database for Self-Hosted Instance Source: https://github.com/mewolab/aquadx/blob/v1-dev/docs/self-hosting.md Back up your MariaDB database before updating. This command connects to the database running via Docker and dumps its contents to a SQL file. ```bash # Backup your database docker run --rm -it mariadb:latest mariadb-dump -h host.docker.internal --port 3369 --user=cat --password=meow main > backup.sql ``` -------------------------------- ### Add Chunithm Firewall Rules (Batch) Source: https://github.com/mewolab/aquadx/blob/v1-dev/docs/chu3-national-matching.md This batch script adds necessary inbound and outbound firewall rules for Chunithm national matching. Ensure it's run as administrator and the game path is correctly specified. ```batch @echo off set /p gamedirectory = Make sure this is run as admin and enter game path (e.g. C:\SegaGames\Chunithm\bin\chusanApp.exe)\n netsh advfirewall firewall add rule name="Chunithm National Matching Inbound" dir=in action=allow profile=any program="%gamedirectory%" enable=yes netsh advfirewall firewall add rule name="Chunithm National Matching Outbound" dir=out action=allow profile=any program="%gamedirectory%" enable=yes ``` -------------------------------- ### Configure SSH Host for Devtainer Source: https://github.com/mewolab/aquadx/blob/v1-dev/config/devtainer/README.md Add this configuration to your `~/.ssh/config` file to define a shortcut for connecting to the devtainer. This allows you to use `ssh aquadx-devtainer` for easy access. ```sshconfig Host aquadx-devtainer HostName localhost Port 2322 User root StrictHostKeyChecking no ``` -------------------------------- ### Game Encryption Key Configuration Source: https://github.com/mewolab/aquadx/blob/v1-dev/docs/encryption.md Use this JSON structure to define encryption keys for supported games. Ensure `key`, `salt`, and `iv` are hex strings. Include relevant game versions and adjust `iterations` based on the game. ```json { "code": "SDHD", "versions": [215, 216], "key": "DECAFBADDECAFBADDECAFBADDECAFBADDECAFBADDECAFBADDECAFBADDECAFBAD", "iv": "DECAFBADDECAFBADDECAFBADDECAFBAD", "salt": "DECAFBADDECAFBAD", "iterations": 36 } ``` -------------------------------- ### Export Data from MySQL Source: https://github.com/mewolab/aquadx/blob/v1-dev/docs/mysql_to_mariadb.md Export your MySQL database to an SQL file. Replace placeholders with your actual database credentials. This command is recommended for Linux/macOS to ensure proper character encoding. ```bash mysqldump --user={username} --password={password} --host={host} --port={port} {database} > aqua.sql ``` -------------------------------- ### Clone AquaDX Repository Source: https://github.com/mewolab/aquadx/blob/v1-dev/docs/self-hosting.md Clone the AquaDX repository to your local machine using Git. ```bash git clone https://github.com/MewoLab/AquaDX ``` -------------------------------- ### Configure AquaBox Default URL Source: https://github.com/mewolab/aquadx/blob/v1-dev/docs/aquabox-url-mode.md Set the base URL for your AquaBox assets. If hosting on AquaNet, use '/chu3' for the public directory. Always test this configuration in the UI before applying it to the config file. ```typescript // Change this to the base url of where your assets are stored. // If you are hosting on AquaNet, you can put the files @ /public/chu3 & use '/chu3' for your base url. // This will work the same way as setting it on the UI does. TEST IT ON THE UI BEFORE YOU APPLY THIS CONFIG!!! export const USERBOX_DEFAULT_URL = "/chu3"; ``` -------------------------------- ### SQL Query to Inspect User Kaleidx Rows Source: https://github.com/mewolab/aquadx/blob/v1-dev/docs/dev/sinmai_dev_notes.md Use this SQL query to retrieve a user's Kaleidx gate progression data. This is helpful for debugging issues where gates are not appearing as expected. ```sql SELECT gate_id, is_gate_found, is_key_found, is_clear, is_info_watched FROM maimai2_user_kaleidx WHERE user_id = ORDER BY gate_id; ``` -------------------------------- ### Declare Variable with Comma-Separated Initialization in Kotlin Source: https://github.com/mewolab/aquadx/blob/v1-dev/docs/dev/kt.md This pattern shows how to declare a variable and initialize it with a comma-separated value, useful for multiple assignments. ```kotlin (var [\w: =?"]+[^,])\n $1,\n ``` -------------------------------- ### Run Updated AquaDX Version Source: https://github.com/mewolab/aquadx/blob/v1-dev/docs/self-hosting.md Restart AquaDX services using Docker Compose after pulling the latest images to run the updated version. ```bash # Run the updated version docker compose up ``` -------------------------------- ### CardController API Source: https://github.com/mewolab/aquadx/blob/v1-dev/docs/api-v2.md Endpoints for managing card-related operations. ```APIDOC ## POST /api/v2/card/default-game ### Description Get the default game for the card. ### Method POST ### Endpoint /api/v2/card/default-game ### Parameters #### Query Parameters - **username** (String) - Required - The username associated with the card. ### Response #### Success Response (200) - **Game ID** (String) - The ID of the default game. ``` ```APIDOC ## POST /api/v2/card/link ### Description Bind a card to the user. This action will migrate selected data from the card to the user's ghost card. ### Method POST ### Endpoint /api/v2/card/link ### Parameters #### Query Parameters - **token** (String) - Required - Authentication token. - **cardId** (String) - Required - The ID of the card to link. - **migrate** (String) - Required - Specifies data to migrate. ### Response #### Success Response (200) - **Success message** (String) - Indicates successful linking. ``` ```APIDOC ## POST /api/v2/card/summary ### Description Get a summary of the card, including the user's name, rating, and last login date. ### Method POST ### Endpoint /api/v2/card/summary ### Parameters #### Query Parameters - **cardId** (String) - Required - The ID of the card. ### Response #### Success Response (200) - **Summary of the card** (Object) - Contains user's name, rating, and last login date. ``` ```APIDOC ## POST /api/v2/card/unlink ### Description Unbind a card from the user. No data will be migrated during this action. ### Method POST ### Endpoint /api/v2/card/unlink ### Parameters #### Query Parameters - **token** (String) - Required - Authentication token. - **cardId** (String) - Required - The ID of the card to unlink. ### Response #### Success Response (200) - **Success message** (String) - Indicates successful unlinking. ``` -------------------------------- ### Update AquaDX Docker Images Source: https://github.com/mewolab/aquadx/blob/v1-dev/docs/self-hosting.md Pull the latest Docker images for AquaDX services before restarting. ```bash # Pull the new repository docker compose pull ``` -------------------------------- ### Replace MySQL Character Set for MariaDB Compatibility Source: https://github.com/mewolab/aquadx/blob/v1-dev/docs/mysql_to_mariadb.md On Linux/macOS, use this command to replace `utf8mb4_0900_ai_ci` with `utf8mb4_general_ci` in the exported SQL file to avoid compatibility issues with MariaDB. ```bash # A command to replace the strings as mentioned above (Linux / macOS only). sed -i 's/utf8mb4_0900_ai_ci/utf8mb4_general_ci/g' aqua.sql ``` -------------------------------- ### UserRegistrar API Source: https://github.com/mewolab/aquadx/blob/v1-dev/docs/api-v2.md Endpoints for user authentication, registration, and profile management. ```APIDOC ## POST /api/v2/user/confirm-email ### Description Confirm email address with a token sent through email to the user. ### Method POST ### Endpoint /api/v2/user/confirm-email ### Parameters #### Query Parameters - **token** (String) - Required - The confirmation token sent via email. ### Response #### Success Response (200) - **Success message** (String) - Indicates successful email confirmation. ``` ```APIDOC ## POST /api/v2/user/me ### Description Get the information of the current logged-in user. ### Method POST ### Endpoint /api/v2/user/me ### Parameters #### Query Parameters - **token** (String) - Required - Authentication token. ### Response #### Success Response (200) - **User information** (Object) - Details about the logged-in user. ``` ```APIDOC ## POST /api/v2/user/login ### Description Login with email/username and password. This will also check if the email is verified and send another confirmation. ### Method POST ### Endpoint /api/v2/user/login ### Parameters #### Query Parameters - **email** (String) - Required - User's email address or username. - **password** (String) - Required - User's password. - **turnstile** (String) - Required - Turnstile token for bot prevention. ### Response #### Success Response (200) - **JWT token** (String) - Authentication token for the user. ``` ```APIDOC ## POST /api/v2/user/register ### Description Register a new user. This will also create a ghost card for the user and send a confirmation email. ### Method POST ### Endpoint /api/v2/user/register ### Parameters #### Query Parameters - **username** (String) - Required - Desired username. - **email** (String) - Required - User's email address. - **password** (String) - Required - User's password. - **turnstile** (String) - Required - Turnstile token for bot prevention. ### Response #### Success Response (200) - **Success message** (String) - Indicates successful user registration. ``` ```APIDOC ## POST /api/v2/user/reset-password ### Description Send the user a reset password email. This will also check if the email is verified or if many requests were sent recently. ### Method POST ### Endpoint /api/v2/user/reset-password ### Parameters #### Query Parameters - **email** (String) - Required - User's email address. - **turnstile** (String) - Required - Turnstile token for bot prevention. ### Response #### Success Response (200) - **Success message** (String) - Indicates that a password reset email has been sent. ``` ```APIDOC ## POST /api/v2/user/change-password ### Description Reset a user's password with a token sent through email to the user. ### Method POST ### Endpoint /api/v2/user/change-password ### Parameters #### Query Parameters - **token** (String) - Required - The password reset token sent via email. - **password** (String) - Required - The new password. ### Response #### Success Response (200) - **Success message** (String) - Indicates successful password change. ``` ```APIDOC ## POST /api/v2/user/setting ### Description Validate and set a user setting field. ### Method POST ### Endpoint /api/v2/user/setting ### Parameters #### Query Parameters - **token** (String) - Required - Authentication token. - **key** (String) - Required - The setting key to update. - **value** (String) - Required - The new value for the setting. ### Response #### Success Response (200) - **Success message** (String) - Indicates successful setting update. ``` ```APIDOC ## POST /api/v2/user/keychip ### Description Get a Keychip ID so that the user can connect to the server. ### Method POST ### Endpoint /api/v2/user/keychip ### Parameters #### Query Parameters - **token** (String) - Required - Authentication token. ### Response #### Success Response (200) - **Keychip ID** (String) - The Keychip ID for server connection. ``` ```APIDOC ## POST /api/v2/user/upload-pfp ### Description Upload a profile picture for the user. ### Method POST ### Endpoint /api/v2/user/upload-pfp ### Parameters #### Query Parameters - **token** (String) - Required - Authentication token. - **file** (MultipartFile) - Required - The profile picture file to upload. ### Response #### Success Response (200) - **Success message** (String) - Indicates successful profile picture upload. ``` -------------------------------- ### Fix Flyway Checksum in MariaDB Source: https://github.com/mewolab/aquadx/blob/v1-dev/docs/mysql_to_mariadb.md Execute this SQL query to correct the checksum in the `flyway_schema_history` table, which is necessary due to a case difference in a migration script between MySQL and MariaDB. ```sql UPDATE main.flyway_schema_history t SET t.checksum = 357127209 WHERE t.installed_rank = 144; ``` -------------------------------- ### Frontier API Source: https://github.com/mewolab/aquadx/blob/v1-dev/docs/api-v2.md Endpoints for frontier-related operations, including card lookup and registration. ```APIDOC ## POST /api/v2/frontier/lookup-card ### Description Lookup a card by access code. ### Method POST ### Endpoint /api/v2/frontier/lookup-card ### Parameters #### Query Parameters - **ftk** (String) - Required - Frontier token. - **accessCode** (String) - Required - The access code of the card. ### Response #### Success Response (200) - **Card information** (Object) - Details about the card. ``` ```APIDOC ## POST /api/v2/frontier/register-card ### Description Register a new card by access code. ### Method POST ### Endpoint /api/v2/frontier/register-card ### Parameters #### Query Parameters - **ftk** (String) - Required - Frontier token. - **accessCode** (String) - Required - The access code for the new card. ### Response #### Success Response (200) - **Card information** (Object) - Details about the newly registered card. ``` -------------------------------- ### Declare Integer Variable with Type Inference in Kotlin Source: https://github.com/mewolab/aquadx/blob/v1-dev/docs/dev/kt.md Use this pattern to declare an integer variable where Kotlin infers the type as Int. ```kotlin (var \w+) = 0 $1: Int = 0 ``` -------------------------------- ### Declare String Variable with Type Inference in Kotlin Source: https://github.com/mewolab/aquadx/blob/v1-dev/docs/dev/kt.md Use this pattern to declare a string variable where Kotlin infers the type as String. ```kotlin (var \w+) \= "" $1: String = "" ``` -------------------------------- ### Kaleidx Scope Gate User Data Structure Source: https://github.com/mewolab/aquadx/blob/v1-dev/docs/dev/sinmai_dev_notes.md This JSON structure represents a user's status for a specific Kaleidx Scope gate. It's used to determine gate visibility and unlock announcements. ```json { "gateId": 8, "isGateFound": true, "isKeyFound": true, "isClear": false } ``` -------------------------------- ### Declare Boolean Variable with Type Inference in Kotlin Source: https://github.com/mewolab/aquadx/blob/v1-dev/docs/dev/kt.md Use this pattern to declare a boolean variable where Kotlin infers the type as Bool. ```kotlin \= false : Bool = false ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.