Skip to content

FAForever/faf-java-api

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Folders and files

NameName
Last commit message
Last commit date
Nov 27, 2023
Nov 27, 2023
Jul 14, 2024
Jul 31, 2018
Feb 5, 2023
Nov 18, 2017
Apr 13, 2021
Nov 29, 2023
Dec 22, 2016
May 11, 2020
Aug 12, 2024
Jun 26, 2022
Dec 16, 2021
Nov 27, 2023
Feb 5, 2023
Aug 5, 2022
Apr 6, 2020
Jun 7, 2022
Jun 7, 2022
Mar 1, 2020
Mar 1, 2020
Jun 7, 2022

Repository files navigation

FAF API

Codacy Badge Build Coverage Status

This is the official FAForever API. Amongst others, the API offers the following functionality:

  • User management (registration, password reset, etc.)
  • JSON-API compliant REST API for lots of community data (i.e. map, mod & replay vault, game statistics, etc.)
  • Leaderboards
  • Clan management
  • Vault upload functionality
  • Internal FAF featured mod deployments
  • Challonge proxy

How to run

Setup database

The application requires a database scheme in the right version. To create this database please checkout the project faf-stack, open a shell terminal (git bash on Windows) and run the script scripts/init-db.sh. This will setup the database in the latest version and configure the users for you.

From source

In order to run the application from source code:

  1. Clone the repository
  2. Import the project into IntelliJ. For some reason, IntelliJ deletes launch configurations after import. Please revert such deleted files first (Version Control (Alt+F9) -> Local Changes)
  3. Configure your JDK if you haven't already
  4. Make sure you have the IntelliJ Lombok plugin installed
  5. Set up a FAF database.
  6. Launch FafApiApplication

From binary

Given the number of required configuration values, it's easiest to run the API using faf-stack:

docker-compose up -d faf-java-api

Database dependency

Due to potential issues with Hibernate, the application checks on startup if the flyway migration version matches the expected version and otherwise fails to boot.

  • To increment the db version you need to change it in two places:
    • application.yml: faf-api.database.schema-version (just an integer of the version)
    • .github/workflows/build.yaml: Global variable FAF_DB_VERSION (git tag of the db release, usually prefixed with a v)
  • In some cases it might make sense to override the required version on the server. Use the env variable DATABASE_SCHEMA_VERSION

Sample routes

Technology Stack

This project uses: