-
-
Notifications
You must be signed in to change notification settings - Fork 37
Development: Creating your dev environment
For instructions on how to set up the main server component, known as DragaliaAPI, see DragaliaAPI/README.md.
Once the server is running, it 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.
Aspire 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.
See the linting page.
See the testing page.
If you cannot use Visual Studio or JetBrains Rider, Visual Studio Code can work as an IDE.
Firstly, install the necessary extensions. You will need the following extensions:
- C# Dev Kit
- Docker
- CSharpier (for code formatting)
Secondly, start the support containers using the command palette and run Docker Compose Up - Select Services. Select docker-compose.yml and tick every service except dragaliaapi.
Then, add the following config files to the .vscode folder.
launch.json:
{
"version": "0.2.0",
"configurations": [
{
"name": "Docker .NET Launch",
"type": "docker",
"request": "launch",
"preLaunchTask": "docker-run: debug",
"netCore": {
"appProject": "${workspaceFolder}/DragaliaAPI/DragaliaAPI.csproj",
},
}
]
}tasks.json:
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/DragaliaAPI/DragaliaAPI.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary;ForceNoAlign"
],
"problemMatcher": "$msCompile"
},
{
"type": "docker-build",
"label": "docker-build: debug",
"dependsOn": [
"build"
],
"dockerBuild": {
"tag": "dragaliaapi:dev",
"target": "base",
"dockerfile": "${workspaceFolder}/DragaliaAPI/Dockerfile",
"context": "${workspaceFolder}",
"pull": true
},
"netCore": {
"appProject": "${workspaceFolder}/DragaliaAPI/DragaliaAPI.csproj"
}
},
{
"type": "docker-run",
"label": "docker-run: debug",
"dockerRun": {
"envFiles": ["${workspaceFolder}/.env"],
"ports": [
{
"containerPort": 80,
"hostPort": 80,
"protocol": "tcp"
}
]
},
"dependsOn": [
"docker-build: debug"
],
"netCore": {
"appProject": "${workspaceFolder}/DragaliaAPI/DragaliaAPI.csproj",
"enableDebugging": true
},
},
]
}After that, you should be able to start up the container like any other build task.