A REST API server for Pixelstarships Fleet Data to be deployed on CapRover.
In order to deploy the API, the following prerequisites must be met:
DATABASE_URL
: The URL to the database server, including username, password, server IP or name and port.DATABASE_NAME
: The name of the database. Will be overriden during tests.CREATE_DUMMY_DATA
: Set to true
to create dummy data in the database at app start.DATABASE_ENGINE_ECHO
: Set to true
to have SQL statements printed to stdout.DEBUG_MODE
: Set to true
to start the application in debug mode. Enables more verbose logging.FLEET_DATA_API_URL_OVERRIDE
: If this is set, the API server url in the Swagger UI will be overriden.FLEET_DATA_API_URL_DESCRIPTION_OVERRIDE
: If this is set, the API server url description in the Swagger UI will be overriden.REINITIALIZE_DATABASE
: Set to true
to drop all tables at app start before recreating them.ROOT_API_KEY
: If this is set, the following endpoints require a client to send the specified key in the Authorization
header:
POST /collections
DELETE /collections/{collectionId}
POST /collections/upload
To deploy the API on CapRover you need to:
Follow the steps outlined in the Contribution Guide to set up your local development environment. Create a file called .docker-env
in the workspace folder and add the following environment variables:
DATABASE_URL
DATABASE_NAME
ROOT_API_KEY
(optional)Then open a terminal, navigate to the workspace folder and run make docker
. The command will:
The API can then be accessed at http://localhost:8000
.
make run
to start the API server. Alternatively run make dev
to start the API server in development mode, in which any changes to code files will make the API restart to reflect those changes.The API can then be accessed at http://localhost:8000
.
If you ran across a bug or have a feature request, please check if there's already an issue for that and if not, please open a new one.
If you want to fix a bug or add a feature, please check out the Contribution Guide.
If you need help using the API or want to contribute, you can join my support Discord at: discord.gg/kKguSec