Skip to content

Installation

This guide covers setting up the Cobra Database on your server using Docker and integrating it with your Unity project.

Prerequisites

Before starting, ensure you have Docker installed on your server. If Docker is not installed on your server, follow the Docker Installation Guide.

Setting Up Your Server

Import Dependencies

First, import Cobra Logging from the Unity Asset Store. This step is necessary before you can import the Cobra Database into your Unity project.

Add Cobra Database

Import the Cobra Database package into your Unity project.

Extract The Server Files

There should be a zip file in the package that contains the source code for the server. Extract it to your server or your development machine for local testing.

Configure Environment

Find the .env file in the extracted folder and open it in a text editor. You'll need to set your MASTER_USERNAME, MASTER_PASSWORD, and MASTER_KEY here. These credentials are used for authenticating with other services such as PostgreSQL, and more.

Start the Database Services

Open a terminal or command prompt in the folder where you've extracted the Cobra Database files. To start the database and associated services, execute:

docker-compose -p bytecobra up -d --build

Confirming the Installation

To ensure everything is running smoothly:

  • Check Services: Use Docker Desktop or the docker ps command to see if all services are up and running.
  • Test the API: Open http://localhost:21301/index.html in your browser to access the Swagger UI for the database service. Click the Authorize button and enter your MASTER_PASSWORD. As a test, try using the /Data/keys GET endpoint to fetch all keys. If this is your first run, it should return an empty collection.