Local Development with faynoSync — Choose Your Path
Getting started with faynoSync development? Great! You have two main options for setting up your local environment. Whether you prefer a traditional local setup or the convenience of Docker, we've got you covered.
Option 1: Traditional Local Development 🖥️
Perfect for developers who want full control over their environment and need to make frequent code changes.
What You'll Need:
-
MongoDB 🗄️
- Stores all your application data, versions, and metadata
- Installation Guide
-
Golang 🐹
- The heart of faynoSync
- Installation Guide
-
MinIO 📦
- Your local S3-compatible storage
- Installation Guide
Setting Up:
- Install all required services
- Create your
.envfile with necessary configurations - Run faynoSync:
# First run (with migrations)
go run faynoSync.go migrate up
# Subsequent runs
go run faynoSync.go
Benefits:
- ⚡ Fast development cycle
- 🔧 Direct access to all components
- 🧪 Easy debugging
- 🔄 Quick code changes
Testing Your Setup:
Want to make sure everything is working correctly? Just run:
go test
This will verify that all components are properly configured and your local environment is ready for development.
Option 2: Docker Development 🐳
Ideal for quick setup and testing, or when you want to avoid installing dependencies locally.
What You'll Need:
- Docker 🐳
- Docker Compose 🎵
Two Ways to Use Docker:
1. Full Container Setup
docker compose up --build
Perfect for:
- 🚀 Quick testing
- 🧪 Initial setup
- 🔄 Testing API functionality
2. Hybrid Approach
docker compose -f docker-compose.yaml -f docker-compose.development.yaml up
This starts only the dependencies (MongoDB and MinIO) while you run faynoSync locally.
Benefits:
- 🚀 Quick setup
- 🧩 Isolated environment
- 🔄 Consistent across machines
- 🧪 Easy testing
Testing Your Setup:
After running docker compose up --build, wait until the s3-service successfully creates the bucket, then run:
docker exec -it faynoSync_backend "/usr/bin/faynoSync_tests"
This will run the test suite inside the container to verify everything is working correctly.
Environment Configuration ⚙️
Both approaches need proper environment configuration. Here are the key variables you'll need:
# Storage Configuration
STORAGE_DRIVER=minio
S3_ACCESS_KEY=your_access_key
S3_SECRET_KEY=your_secret_key
S3_BUCKET_NAME=your_bucket
# Database Configuration
MONGODB_URL=mongodb://root:password@127.0.0.1/faynosync_db
# API Configuration
API_URL=http://localhost:9000
PORT=9000
For a complete list of environment variables, check out our Environment Configuration Guide.
