This project follows the Let's Go Further book by Alex Edwards, with some modifications and enhancements.
-
Routing: Utilizes Go 1.22's standard library for routing, eliminating the need for httprouter.
-
Logging: Implements
slog
with tint for enhanced human readability. -
Database Connectivity: Employs pgx instead of pq, following current recommendations.
-
Logging Format: Uses colorized text output instead of structured JSON logging.
-
Metrics: Implements more extensive metrics support, with database-specific metrics adapted for pgx.
-
Deployment: Adopts a different approach:
- Utilizes Amazon EC2 instance as a self-hosted runner
- Implements GitHub Actions CI/CD pipeline
- Containerizes the application using Docker
For more details, refer to the Dockerfile, compose file, and CI/CD pipeline configuration in the repository.
This book is a must-read. Everything you learn from it will be applicable elsewhere in your development future. It follows best practices throughout.
I've built APIs before moving to Go, primarily using Java Spring Boot. However, after reading this book, I realized I was unaware of several important concepts. This book helped me gain valuable knowledge that I hadn't encountered in my previous development experiences.
Even for beginner level developers with prior API development experience, this book offers insights and best practices that may not be immediately apparent when transitioning to Go. It's an excellent resource for both newcomers to API development and those looking to enhance their skills in Go.