/Backend

DB Backend for FredBoat

Primary LanguageJavaMIT LicenseMIT

FredBoat

Quarterdeck TeamCity (full build status) Docker Pulls Docker Layers Docker Version Coverage

Please see the main repo for more information on the FredBoat project: https://github.com/Frederikam/FredBoat

This repository is home to FredBoat's internal database backend. At this point, this is not a public API of any sorts. Any documentation found here is aimed at FreBoat developers. Future development of the API might include additional, semi-public services.

Versions

v1

Click here to find detailed online docs.

The online documentation includes running test queries in the browser against a live staging deployment of Quarterdeck. If you are a developer who wants to build apps based on FredBoat's backend, please read the document linked below to learn how to join our community, where you can request credentials to access our testing environment.

v0 [Deprecated]

v0 has been fully deprecated and nothing new should be built based on it. The v1 endpoints should fully support any existing use cases. If any routes are discovered to be missing please open an issue or PR.

Since v0 and v1 endpoints can coexists in a single application, both will stay accessible for a while. The v0 endpoints are scheduled to be deleted from the code once our clients are past the risk of potential rollbacks to versions with v0 implementations.

[Deprecated] Click me

The existing entity endpoints are:

  • /blacklist
  • /guildconfig
  • /guilddata
  • /guildmodules
  • /guildperms
  • /prefix
  • /searchresult

Each entity endpoint supports the following operations:

  • POST /fetch
  • POST /merge
  • POST /delete

fetch and delete require the id to be sent, merge the entity itself.

Some entity endpoints have additional calls:

  • Blacklist:

    • GET /loadall
  • Prefix:

    • POST /getraw
  • Search result:

    • POST /getmaxaged

The entity endpoints are reachable behind the version path, for example:

GET http[s]://backend.url[:port]/v0/blacklist/loadall

There is an additional endpoint, that will return the supported versions of the API:

  • GET /info/api/versions

Authentication happens via Basic access authentication.
No kind of authorization is existent, you either have access, or you don't. In terms of security, treat this the same way you would treat a redis instance.

Building And Testing Quarterdeck

To make a build, including running tests, do:

./gradlew build

To run tests against our postgres database, Quarterdeck requires docker and docker-compose installed, as well an unoccupied port 5433.

When running tests repeatedly on a development machine you can shave off some time by passing a property to keep the postgres container alive between tests:

./gradlew test -DkeepPostgresContainer=true

or setting it via IntelliJ IDEA's run/debug config as a VM option: Setting the keep postgres container property with IntelliJ IDEA's run/debug config

Keep in mind that in that case you will have to manually shut down the container to get rid of it:

docker stop quarterdecktest_db_1
docker rm quarterdecktest_db_1

Contributing

The constribution guideline for this project can be found here.

Code of Conduct

The code of conduct for this project can be found here.