Skip to content
This repository was archived by the owner on Sep 11, 2026. It is now read-only.

Repository files navigation

🦊 Ladefuchs - API

MIT licensed Documentation made-with-rust Docker-Build

Documentation to access the Ladefuchs API. If you are an App Developer, please read the OpenAPI documentation.

API Documentation

Endpoints

Production

https://api.ladefuchs.app

Configuration

Environment variables are used for the entire configuration. For development we recommend direnv.

Important

Do not forget to set the JWT_KEY for the admin auth.

Name Type Default Values
DATABASE_URL URI None postgres://adminfuchs:ringdingdingding@localhost:5432/ladefuchs
DATABASE_POOL_SIZE uint32 8 0...4294967295
LISTEN ipAddr 127.0.0.1 0.0.0.0
LOG string INFO TRACE | DEBUG | INFO | WARN | ERROR
PORT uint16 3000 0...65535
ECO_MOVEMENT_API_KEY string ""
DOMAIN uri http://127.0.0.1:3000 localhost:3000
ADMIN_DOMAIN uri http://127.0.0.1:8080 127.0.0.1:8080
ADMIN_USER string None admin_user
ADMIN_PWD string None admin_pwd
JWT_KEY string None
SLACK_TOKEN string ""
SLACK_CHANNEL string ""
CRON_SCHEDULE string "0 45 23 * * *" cron expression when to start the import

Slack

If none Slack channel and none token was provided, the slack bot will be disabled for that instance. If you do want slack messages, do not forget to add the RoboFuchs Bot into the selected channel.

(note improve config documentation)

Local Development

Start Database

We have a prepared docker-compose file docker-compose.dev.yml you can use to spin up a database PostgreSQL Database instance. Every configuration is passed via an environment variable.

You can use this command:

sudo -E docker-compose -f ./docker-compose/docker-compose.yml up

Migration

You need to have sqlx-cli installed.

sqlx migrate run
# or
sqlx migrate revert

Compile & Run

Be sure that you set all necessary environment variables are set. Please take a look at the configuration section.

SQL Errors: In case of compile errors related to SQL queries, this could possible mean that sqlx the used crate can't reach the database, to verify the correctness of every query. Thus, be sure to have a working database connection wit an initialized schema running.

Alternative you can set SQLX_OFFLINE=true so it will a least compile.

Debug Build

cargo r

Release Build

cargo r --release

Run tests

To run the tests there is a small helper script. It sources the config.env and enables the right features. To run the tests simply execute:

./scripts/run-tests.sh

Monitoring

uptime.ladefuchs.app/status/api

Docker

Build Image

sudo docker build -t ladefuchs .

About

The Backend of Ladefuchs.

Resources

Code of conduct

Stars

1 star

Watchers

3 watching

Forks

Releases

Used by

Contributors

Languages