-
-
Notifications
You must be signed in to change notification settings - Fork 33
Development environment
Here is a quick guide for getting started with a development environment to contribute to the project.
Start by cloning the repository into a directory of your choosing. Docker Compose is used to run the repository locally. On Windows, the recommended setup is Visual Studio as an IDE and Docker Desktop which enables debugging in containers.
Once you have cloned the repository, copy .env.default
to .env
and choose a database username and password, and a developer token. The developer token is expected in the Authorization header of any requests that want to import or delete a savefile.
You should then be able to run the server by running 'Docker Compose' in the top toolbar in Visual Studio (or docker compose up -f docker-compose.yml -f docker-compose.override.yml -d
if using the CLI/an IDE which doesn't support container tools). Verify that all 3 containers start up properly and that they appear healthy. The server should now be live on localhost
-- try navigating to localhost/health
in your browser. If it says 'Healthy' this means that the app has successfully started and can connect to the database and Redis.
It is a good idea to set up a real Dragalia client to enable end-to-end testing. While it is possible to verify that your code works automated testing, the fact that we are working with a proprietary client means that seemingly valid response data can sometimes cause unforeseen issues when received by the client.
The docker-compose file will start the server on port 80, so you can use Dragalipatch (see README.md) with your PC's local IP address to play on your local server. You must input this as http://192.168.xxx.xxx
because without a http
prefix, Dragalipatch assumes HTTPS which is not enabled on the development setup.
This is possibly due to database credential issues -- did you set up .env as described at the start of this guide? Alternatively the database is persisted with docker-compose and if the credentials are changed after it has been created then these will now be invalid. To address this, delete the dragaliaapi-pgdata volume in Docker and the database will be recreated on next startup.