Skip to main content

Local development

Clone the Repository

First, clone the FaynoSync repository to your local machine:

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

Prerequisites

To get started with developing FaynoSync locally, you will need to set up the following services:

MongoDB - A NoSQL database used to store application data, including version information, channel settings, and metadata. MongoDB’s flexible document structure is perfect for handling the dynamic data models required by FaynoSync.

Golang - The main programming language used to build FaynoSync. Golang’s performance, simplicity, and strong concurrency support make it an ideal choice for developing efficient, scalable backend services.

Garage - An S3-compatible object storage service recommended for local development. In FaynoSync, use Garage with the aws storage driver to upload and manage application files locally while keeping configuration close to production-style S3 setups.

Setting Up Your Local Environment

Install MongoDB

MongoDB is used to store all necessary data for FaynoSync, including application metadata, version control, channel, platform and architecture information. Ensure MongoDB is up and running on your local machine before starting the API.

Installation Guide: MongoDB Installation

Install Golang

The FaynoSync API is built with Golang, so you need to have it installed to run the application locally. Once installed, you can build, run, and test the API with ease.

Installation Guide: Golang Installation

Garage acts as your local storage solution, providing an S3-compatible API where your application files can be uploaded and managed during development.

Configure FaynoSync to use:

  • STORAGE_DRIVER=aws
  • S3_API_ENDPOINT with your Garage S3 API endpoint
  • S3_FORCE_PATH_STYLE=true
  • S3_DISABLE_OBJECT_ACL=true

You can find full environment variable details and examples in the Environment Configuration page.

Running FaynoSync Locally

Once you have all these services set up, you can run FaynoSync locally, allowing you to develop and test your application seamlessly. This setup ensures that your local environment closely mirrors the production setup, making your development process efficient and straightforward.

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.

Starting FaynoSync

To run FaynoSync, use the following command:

go run faynoSync.go

If this is your first time running FaynoSync, include the --migration flag to apply initial migrations:

go run faynoSync.go --migration

To roll back migrations, use:

go run faynoSync.go --migration --rollback

Testing Your Setup

You can verify that everything is set up correctly by running the test suite:

go test

This will ensure that all components are correctly configured and that your local development environment is ready for use.

Setting Up Admin Dashboard

The FaynoSync Admin Dashboard provides a web interface for managing your FaynoSync API server. Here's how to set it up locally:

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

If you encounter any issues during setup, feel free to consult the linked guides or reach out to our community on GitHub.