https://github.com/xdcobra/gofiber-starter-stack
π Production-ready Go Fiber microservices template with Docker Compose, HA Redis clustering, MySQL, Prometheus monitoring, and Grafana visualization.
https://github.com/xdcobra/gofiber-starter-stack
boilerplate docker docker-compose go gofiber golang gorm grafana high-availability monitoring mysql orm prometheus redis sentinel template
Last synced: 3 months ago
JSON representation
π Production-ready Go Fiber microservices template with Docker Compose, HA Redis clustering, MySQL, Prometheus monitoring, and Grafana visualization.
- Host: GitHub
- URL: https://github.com/xdcobra/gofiber-starter-stack
- Owner: XDcobra
- License: mit
- Created: 2025-06-15T08:44:27.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-23T11:16:22.000Z (about 1 year ago)
- Last Synced: 2025-06-23T11:34:50.413Z (about 1 year ago)
- Topics: boilerplate, docker, docker-compose, go, gofiber, golang, gorm, grafana, high-availability, monitoring, mysql, orm, prometheus, redis, sentinel, template
- Language: Go
- Homepage:
- Size: 33.2 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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](./services/README.md)**
```bash
# 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](./charts/README.md)**
```bash
# 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
- `GET /` - API 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
1. Fork the repository
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request
---
## π License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
---
## π Acknowledgments
- [Go Fiber](https://gofiber.io/) - Fast HTTP framework
- [GORM](https://gorm.io/) - Go ORM library
- [Redis](https://redis.io/) - In-memory data store
- [Prometheus](https://prometheus.io/) - Monitoring system
- [Grafana](https://grafana.com/) - Data visualization
- [Loki](https://grafana.com/oss/loki/) - Log aggregation
- [Helm](https://helm.sh/) - Kubernetes package
- [Go Swagger](https://github.com/gofiber/swagger) - Swagger for GoFiber
---
## π Support
If you have any questions or need help, please open an issue on GitHub.