Skip to content

M0hammadUsman/greenlight

Repository files navigation

Greenlight API

Overview

This project follows the Let's Go Further book by Alex Edwards, with some modifications and enhancements.

Key Differences from the Book

  1. Routing: Utilizes Go 1.22's standard library for routing, eliminating the need for httprouter.

  2. Logging: Implements slog with tint for enhanced human readability.

  3. Database Connectivity: Employs pgx instead of pq, following current recommendations.

  4. Logging Format: Uses colorized text output instead of structured JSON logging.

  5. Metrics: Implements more extensive metrics support, with database-specific metrics adapted for pgx.

  6. 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.

Personal Insights

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.

About

Following the Let's Go Further book by Alex Edwards

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published