The Recipes Cookbook
Documentation tells you what an API does. Blog posts explain the why. But when you need to build something real - authentication with JWT, deployment to AWS, a WebSocket chat, a CRUD app with Postgres - what you really want is working code you can copy and adapt.
That is what the Fiber Recipes repository is. Over 70 complete, runnable example projects covering everything from "Hello World" to clean architecture with Docker, OAuth2, and Kubernetes. Every recipe is a self-contained Go project with its own go.mod, main.go, and README.
Where to Find Themโ
The recipes live in two places:
- Browse online: docs.gofiber.io/recipes - searchable, categorized, with full READMEs
- Clone and run: github.com/gofiber/recipes -
git clone,cdinto a recipe,go run .
Recipes by Categoryโ
Authenticationโ
| Recipe | What It Shows |
|---|---|
| auth-jwt | Simple JWT authentication |
| auth-docker-postgres-jwt | JWT + Docker + Postgres - full stack |
| firebase-auth | Firebase authentication integration |
| oauth2 | GitHub OAuth2 flow |
| oauth2-google | Google OAuth2 flow |
| todo-app-with-auth-gorm | Todo app with auth and GORM |
If you need authentication in your Fiber app, start with auth-jwt for the simplest case or auth-docker-postgres-jwt for a production-like setup.
Databasesโ
| Recipe | What It Shows |
|---|---|
| gorm | GORM with SQLite |
| gorm-postgres | GORM with PostgreSQL |
| gorm-mysql | GORM with MySQL |
| mongodb | MongoDB driver |
| ent-mysql | Ent ORM with MySQL |
| sqlc | Type-safe SQL with sqlc |
| sqlboiler | SQLBoiler ORM |
| postgresql | Raw PostgreSQL driver |
| mysql | Raw MySQL driver |
| neo4j | Neo4j graph database |
| memgraph | Memgraph graph database |
Deploymentโ
| Recipe | What It Shows |
|---|---|
| docker-nginx-loadbalancer | Docker + Nginx load balancing |
| docker-mariadb-clean-arch | Dockerized MariaDB with Clean Architecture |
| k8s | Kubernetes deployment |
| aws-eb | AWS Elastic Beanstalk |
| aws-sam-container | AWS SAM containerized |
| cloud-run | Google Cloud Run |
| heroku | Heroku deployment |
| vercel | Vercel deployment |
| seenode | Seenode cloud platform |
| cloudflare-workers | Cloudflare Container Workers |
Real-Timeโ
| Recipe | What It Shows |
|---|---|
| websocket | Basic WebSocket communication |
| websocket-chat | Real-time chat app |
| socketio | Socket.io chatroom |
| sse | Server-Sent Events |
Architecture Patternsโ
| Recipe | What It Shows |
|---|---|
| clean-architecture | Clean Architecture in Go |
| clean-code | Clean Code patterns |
| hexagonal | Hexagonal Architecture with MongoDB |
Securityโ
| Recipe | What It Shows |
|---|---|
| csrf | CSRF protection |
| csrf-with-session | CSRF + session management |
| https-tls | HTTPS with TLS |
| https-pkcs12-tls | HTTPS with PKCS12 certificates |
| autocert | Automatic TLS certificate management |
How to Use a Recipeโ
Every recipe follows the same pattern:
# Clone the recipes repository
git clone https://github.com/gofiber/recipes.git
cd recipes
# Pick a recipe
cd auth-jwt
# Read the README
cat README.md
# Run it
go run .
Most recipes start a server on :3000. Some require Docker for databases - the README tells you what you need.
Building on Recipesโ
Recipes are starting points, not finished applications. The typical workflow:
- Find a recipe that matches your use case
- Copy it into your project (or use it as reference)
- Adapt the code to your needs
- Add production concerns (error handling, logging, config)
The clean-architecture and hexagonal recipes are especially useful as project templates - they show how to structure a larger Fiber application with layers, interfaces, and dependency injection.
Contributing Recipesโ
If you have built something interesting with Fiber, the community would benefit from seeing it. The recipes repository accepts contributions following the existing pattern: one directory per recipe, a go.mod, a main.go, and a README.md that explains what the recipe demonstrates.
