Skip to main content

Docker Development

Docker is a platform that allows developers to automate the deployment of applications inside lightweight, portable containers. Containers package an application with all its dependencies, ensuring that it runs consistently across different environments. This makes it easier to develop, ship, and run applications, as you can be confident that they will behave the same way in development, testing, and production.

For more information on Docker and to install it, visit the official Docker Documentation.

Install Docker Compose.

To get started, you need to create an environment file (.env) and set all the required configurations. For more details on the necessary environment variables, please refer to the Environment Configuration page.

Building and Running the API

This step is primarily for users who want to explore the API without installing Golang locally.

First, clone the FaynoSync repository to your local machine:

git clone https://github.com/ku9nov/faynoSync.git
cd faynoSync

Now you can build and run the FaynoSync API along with all its dependencies using the following command:

docker compose up --build

This command will build the necessary Docker images and start the containers as defined in docker-compose.yaml file. This includes the API, MongoDB, Redis, Garage (S3-compatible storage), and the Admin Dashboard running in development mode.

Once the stack is healthy, the API is available at http://localhost:9000 and the dashboard at http://localhost:3000. The dashboard talks to the API through the VITE_API_URL variable set in docker-compose/services/frontend.yml (defaults to http://localhost:9000).

For more details, see the faynoSync README.

Note

Rebuilding the Docker images each time can be time-consuming, making this approach less suitable for active development. It's recommended mainly for initial setup and testing the API’s functionality rather than for regular development tasks.

Running Tests

Once the services are running, you can execute the test suite with the following command (please wait until the s3-service successfully creates the bucket):

docker exec -it faynoSync_backend "/usr/bin/faynoSync_tests"

This command runs tests directly inside the faynoSync_backend container.

Running Dependency Services for Local Development

If you prefer to work locally with Golang installed, you can start only the dependency services required for FaynoSync development by using this command:

docker compose -f docker-compose.yaml -f docker-compose.development.yaml up

This setup will start essential services like MongoDB, Redis, and local S3-compatible storage (recommended: Garage with STORAGE_DRIVER=aws). The docker-compose.development.yaml override scales both the backend and frontend services to 0 replicas, so you can run the API and the dashboard from source while the dependencies stay containerized.

Important

Make sure Golang is installed on your local machine. For instructions on setting up Golang, refer to the Golang Installation Guide.

Running the Dashboard from Source

The docker compose up --build command already runs the Admin Dashboard in a container (in development mode) at http://localhost:3000, so you don't need this step just to use the dashboard.

However, Docker isn't ideal for actively developing the dashboard frontend — you lose fast hot-reload and a tight edit loop. If you're working on the dashboard UI itself, scale the containerized frontend to 0 (see Running Dependency Services for Local Development above) and run it from source instead:

Clone the Dashboard Repository

First, clone the admin dashboard repository:

git clone https://github.com/ku9nov/faynoSync-dashboard.git
cd faynoSync-dashboard

Environment Configuration

Copy the example environment file and configure it:

cp .env.example .env

The .env file should contain:

VITE_API_URL=http://localhost:9000
VITE_PORT=3000

Make sure the VITE_API_URL points to your running FaynoSync API server (default port 9000).

Install Dependencies

Install all necessary dependencies using yarn:

yarn install

Run the Dashboard

Start the dashboard in development mode:

yarn dev

This will launch the dashboard on http://localhost:3000 (or the port specified in your .env file).

First-Time Setup

  1. Open the dashboard in your browser
  2. Register a new account using your API_KEY
  3. Once registered, you can start using the dashboard to manage your FaynoSync server

The dashboard provides an intuitive interface for:

  • Managing applications and versions
  • Configuring channels and platforms
  • Monitoring server health and statistics
  • User and team management