Start only the infrastructure services while developing your Go services locally:
# Start infrastructure (MySQL, NATS, Prometheus, Grafana, Redis)
make infra-up
# Or equivalently:
make dev-local
This will give you:
- MySQL:
localhost:3306
(user:appuser
, password:apppassword
) - NATS:
localhost:4222
(monitoring:http://localhost:8222
) - Prometheus:
http://localhost:9090
- Grafana:
http://localhost:3000
(admin/admin) - Redis:
localhost:6379
Then run your services locally:
# Run specific services
make run-auth-service
make run-user-service
make run-gateway
# Or run multiple services
make run-local
Start everything in Docker:
# Build and start all services
make docker-up
# Or for development with hot reload
make dev-up
# Check database status
make db-status
# Connect to database
make db-shell # As appuser
make db-root-shell # As root
# Reset all databases
make db-reset
# Initialize databases manually
make db-init
- Copy the environment template:
cp .env.example .env
- For infrastructure-only development, you can use:
cp .env.infrastructure .env
If databases aren't being created:
- Check the init script exists:
ls -la infra/db/init/init-databases.sql
- Check MySQL logs:
docker logs fn-mysql
- Manually run the init script:
make db-init
If services can't connect to infrastructure:
- Check infrastructure is running:
docker ps
- Check network connectivity:
docker exec fn-mysql mysqladmin ping
docker exec fn-nats nats-server --version
- Verify environment variables in your services match the infrastructure ports.
- Start infrastructure:
make infra-up
- Run your service locally:
make run-user-service
- View logs:
make infra-logs
- Stop when done:
make infra-down
# Stop and remove containers
make infra-down
# Stop and remove containers + volumes
make infra-clean
# Full cleanup including images
make clean