Example web application projects with top popular and recently active Go lang web frameworks and toolkits.
I am implementing the same features in all frameworks and compare them occasionally.
Currently checking:
This repository is a monorepo, which means it contains all the packages in the same repository.
In the root directory, there is a folder for each web framework. These folders contain the most recent state of the demo project for a given framework. For example, directory fiber is the current final state of the project for the Fiber web framework.
Additionally, in _step_by_step and _steps_by_topics directories, you can final tutorial steps grouped by framework and topics accordingly.
Additionally,
- api directory contains API specifications as a README file.
- pkg directory contains a separate Go package used as a shared code for errors, models, and storage layer.
Check [STRUCTURE.md][] for information about the Go project layout for each demo app.
List of checked features:
- "Hello, World!" and simple JSON response;
- CRUD JSON API for the example entity;
- Paging and error handling;
- Parsing query params;
- Accepting and parsing form data;
- Exposing static assets via an endpoint;
- Building website pages with templates;
- MVC Pattern (model, view, controller);
- Authentication and Authorization;
- Documentation and Swagger;
- Framework specific testing (if there is anything);
- Optimization (e.g. compression with GZIP);
- Security (CORS for example);
Additionaly, some examples with:
- CI/CD using GitHub Actions;
- Logging, tracing, and metrics;
- Docker and Docker Compos;
- Database and ORM;
- Work with MySQL;
- Work with PostgreSQL;
- Work with MongoDB;
- Work with Redis;
- Work with Kafka;
Feature | gin | echo | iris | fiber | micro | goa | gorilla |
---|---|---|---|---|---|---|---|
Final Project Structure | ⏳ | 👷🏼♂️ | ⏳ | 👷🏼♂️ | ⏳ | ⏳ | ⏳ |
"Hello, World!" and simple JSON response | ⏳ | ✅ | ✅ | ✅ | ⏳ | ⏳ | ⏳ |
CRUD JSON API for the example entity | ⏳ | ✅ | ✅ | ✅ | ⏳ | ⏳ | ⏳ |
Paging and error handling | ⏳ | ✅ | ✅ | ✅ | ⏳ | ⏳ | ⏳ |
Parsing query params | ⏳ | ✅ | ✅ | ✅ | ⏳ | ⏳ | ⏳ |
Accepting and parsing form data | ⏳ | 👷🏼♂️ | 👷🏼♂️ | ⏳ | ⏳ | ⏳ | ⏳ |
Exposing static assets via an endpoint | ⏳ | ✅ | 👷🏼♂️ | ⏳ | ⏳ | ⏳ | ⏳ |
Building website pages with templates | ⏳ | ⏳ | 👷🏼♂️ | ⏳ | ⏳ | ⏳ | ⏳ |
MVC Pattern (model, view, controller) | ⏳ | ⏳ | ⏳ | ⏳ | ⏳ | ⏳ | ⏳ |
Authentication and Authorization | ⏳ | ⏳ | ⏳ | ⏳ | ⏳ | ⏳ | ⏳ |
I host live streams on YouTube, Twitch, and Facebook Watch about building this project. Follow me on Twitter for announcements.
Three is also a dedicated blog post where I gather all related tutorials and learning materials in one place. Learn more: Go Web Frameworks and Toolkits