GoFiber Starter Stack
π A production-ready Go Fiber microservices template with multiple deployment options,
featuring Redis clustering, MySQL database, comprehensive monitoring, and observability solutions.
π― What This Repository Offers
This repository provides a complete microservices stack built with Go Fiber that can be deployed using either:
- π³ Docker Compose - For local development and simple deployments
- βΈοΈ Kubernetes with Helm - For production-ready cloud deployments
π Key Features
- Go Fiber API Gateway - High-performance HTTP framework with built-in middleware
- Redis Cluster - Master-slave replication with Redis Sentinel for high availability
- MySQL Database - Relational database with GORM ORM integration
- Comprehensive Monitoring Stack:
- Prometheus - Metrics collection and monitoring
- Grafana - Data visualization and dashboards
- Loki & Promtail - Log aggregation and querying (Kubernetes only)
- Redis Insight - Redis GUI for database management
- Go Swagger Documentation - Auto-generated API documentation
- Prometheus Auto Service Discovery - Automatic service monitoring (Kubernetes only)
π Quick Start
Choose your deployment method:
π³ Docker Compose (Local Development)
Perfect for local development, testing, and simple deployments.
π Click here for Docker Compose Documentation
# Quick start with Docker Compose
git clone https://github.com/XDcobra/gofiber-starter-stack.git
cd gofiber-starter-stack
make docker-start
βΈοΈ Kubernetes with Helm (Production)
Enterprise-ready deployment with advanced features like log aggregation and auto service discovery.
π Click here for Kubernetes/Helm Documentation
# Quick start with Kubernetes
git clone https://github.com/XDcobra/gofiber-starter-stack.git
cd gofiber-starter-stack/charts/gofiber-starter-stack
helm install gofiber-starter-stack .
ποΈ Architecture Overview
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β API Gateway β β Grafana β β Prometheus β
β (Go Fiber) β β (Port 3000) β β (Port 9090) β
β (Port 8000) β β β β β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β β β
βββββββββββββββββββββββββΌββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββββββββββββββββββββ
β Redis Cluster β
β βββββββββββ βββββββββββ βββββββββββ βββββββββββ β
β β Master β β Slave β βSentinel1β βSentinel2β β
β β (6379) β β (6379) β β (26379) β β (26380) β β
β βββββββββββ βββββββββββ βββββββββββ βββββββββββ β
β β β β
β βββββββββββ βββββββββββ β
β βSentinel3β βRedis β β
β β(26381) β βInsight β β
β βββββββββββ β(5540) β β
ββββββββββββββββββββββββββββββββββββ΄ββββββββββ΄ββββββ
β
βββββββββββββββββββββββββββββββββββββββββββββββββββ
β MySQL Database β
β (Port 3306) β
βββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββ
β Loki & Promtail β
β (Kubernetes Only) β
β βββββββββββ βββββββββββ βββββββββββ β
β β Loki β βPromtail1β βPromtail2β β
β β (3100) β β β β β β
β βββββββββββ βββββββββββ βββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββ
π Prerequisites
For Docker Compose
- Docker and Docker Compose
- Go 1.24.4 or higher
- Git
For Kubernetes/Helm
- Kubernetes cluster (minikube, kind, or cloud provider)
- Helm 3.x
- kubectl configured
- Ingress controller (nginx-ingress recommended)
π§ API Endpoints
Health Check
Redis Operations
GET /redis/ping - Redis connection test
GET /redis/get - Get value from Redis
POST /redis/post - Set value in Redis
MySQL Operations
GET /mysql/get/:id - Get record by ID
POST /mysql/post - Create new record
Documentation & Monitoring
GET /swagger/* - Swagger API documentation
GET /metrics - Prometheus metrics endpoint
π Security Features
Both deployment methods include:
- Authentication for monitoring dashboards (Prometheus, Grafana)
- Database security with configurable credentials
- Service isolation and network security
- Environment-based configuration management
π Monitoring & Observability
Docker Compose
- Prometheus metrics collection
- Grafana dashboards
- Basic logging
Kubernetes/Helm
- Enhanced monitoring with auto service discovery
- Centralized logging with Loki & Promtail
- Advanced dashboards and alerting
- Service mesh ready architecture
π Production Deployment
Docker Compose
- Suitable for small to medium deployments
- Easy to set up and maintain
- Good for development and testing environments
Kubernetes/Helm
- Enterprise-grade scalability and reliability
- Auto-scaling and load balancing
- Advanced monitoring and logging
- Multi-environment support (dev, staging, prod)
π€ Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature)
- Commit your changes (
git commit -m 'Add amazing feature')
- Push to the branch (
git push origin feature/amazing-feature)
- Open a Pull Request
π License
This project is licensed under the MIT License - see the LICENSE file for details.
π Acknowledgments
π Support
If you have any questions or need help, please open an issue on GitHub.