A web API and web application for searching information for the game Elite Dangerous
This is an open-source project written in Python, Django, Django REST Framework, and Celery, while the web interface will be developed in Vue.js. Currently, the project is still in development and features an alpha version with the API available on the main branch at the URL eddai.italiangamingsystem.it.
- Data Collection: EDDAI collects data from EDDN, processes and saves the information in the database. It is also possible to send data through the available APIs.
- Data Access: Users can access the data through API endpoints, which provide structured and easy-to-use information. Additionally, it will be possible to access the data through a web application.
To set up the development environment, follow these steps:
For development, some dependencies are required: RabbitMQ, Redis, and PostGIS. Specifically, RabbitMQ is used as a broker for Celery, Redis as the backend for Celery and Django cache, and finally, PostGIS is a spatial database based on PostgreSQL.
It is recommended to host everything on Docker for development, for better management.
services:
rabbitmq:
image: rabbitmq:3.11.13-management
ports:
- "5672:5672"
- "15672:15672"
environment:
TZ: UTC
RABBITMQ_DEFAULT_USER: user
RABBITMQ_DEFAULT_PASS: password
redis_result_backend:
image: redis:6.2.12
ports:
- "6379:6379"
environment:
TZ: UTC
redis_cache:
image: redis:6.2.12
ports:
- "6379:6379"
environment:
TZ: UTC
db:
image: "postgis/postgis:16-3.4"
environment:
TZ: UTC
POSTGRES_DB: eddai
POSTGRES_USER: user
POSTGRES_PASSWORD: password
ports:
- "5432:5432"
git clone https://github.com/yourusername/EDDAI-EliteDangerousApiInterface.git
cd EDDAI-EliteDangerousApiInterface
To streamline the development process, you can use Visual Studio Code Dev Containers. This allows you to develop inside a containerized environment with all dependencies pre-configured.
-
Install the Remote - Containers extension:
- Go to the Extensions view in Visual Studio Code (
Ctrl+Shift+X
). - Search for
Remote - Containers
and install it.
- Go to the Extensions view in Visual Studio Code (
-
Open the project in a Dev Container:
- Open the Command Palette (
Ctrl+Shift+P
). - Select
Remote-Containers: Open Folder in Container...
. - Choose the project folder.
- Open the Command Palette (
If you prefer to develop without using containers, you can set up your environment manually. This method is not recommended due to the complexity of managing dependencies and configurations.
-
Install Miniconda:
- Download and install Miniconda from the official website for your operating system.
- Follow the installation instructions provided on the website.
-
Create and Configure the Conda Environment:
conda env create -f eddai_EliteDangerousApiInterface/environment.yml conda activate eddai
Before running the application, you need to set up the environment variables. This can be done by copying the .env.template
file and creating a new .env
file where you will set your environment-specific variables.
-
Copy the
.env.template
file:cp .env.template .env
-
Edit the
.env
file: Open the.env
file in your preferred text editor and set the necessary environment variables according to your development setup.
After setting up the environment, you need to initialize the database. This involves cleaning the database, applying migrations, and importing initial data from fixtures. You can do this using Django's management commands.
-
Clean the Database:
python manage.py flush --no-input
-
Apply Migrations:
python manage.py migrate
-
Import Initial Data:
python manage.py loaddata user economy system body bgs exploration material mining station
These commands will ensure that your database is properly set up and ready for development.
You can start the server using Visual Studio Code's debugging feature or through the terminal. Visual Studio Code is already configured for this project, so it is the recommended choice.
-
Open the Debug View:
- Click on the Debug icon in the Activity Bar on the side of Visual Studio Code.
- Alternatively, you can use the shortcut
Ctrl+Shift+D
.
-
Start Debugging:
- Click the green play button at the top of the Debug panel.
- Select the debug configuration named
Django/Celery Workers
. - This will start the Django development server along with the three Celery workers and the Celery beat scheduler with the debugger attached.
If you prefer to start the server through the terminal, you can do so with the following command:
python manage.py runserver
To start the three Celery workers and the Celery beat scheduler, use the following commands in separate terminal windows:
-
Start the first Celery worker:
celery -A eddai worker --loglevel=info -n worker1@%h
-
Start the second Celery worker:
celery -A eddai worker --loglevel=info -n worker2@%h
-
Start the third Celery worker:
celery -A eddai worker --loglevel=info -n worker3@%h
-
Start the Celery beat scheduler:
celery -A eddai beat --loglevel=info
This will start the Django development server, and you can access the application at http://127.0.0.1:8000/
.
Using Visual Studio Code's debugging feature is recommended as it provides a more integrated development experience.
EDDAI is not managed or affiliated with the game developer - Frontier Developments.