This repository contains a comprehensive RESTful API project built in Go, designed as a structured, modular system ideal for modern web applications. The project follows a step-by-step approach, from initial setup to deployment, covering essential backend concepts and advanced functionality.
Introduction
This project serves as a guide to building scalable, secure, and performant APIs in Go, emphasizing best practices and a modular, extensible design. Each chapter of the project adds layers of capability, reliability, and scalability to the API, enabling you to create a robust web service.
Features
- Modular Structure: Organized chapters for clear project progression.
- HTTP Server: Basic server setup with RESTful routing.
- JSON Handling: Advanced JSON encoding/decoding, including error responses and custom formats.
- Database Integration: PostgreSQL setup with connection pooling and SQL migrations.
- CRUD Operations: Complete implementation of Create, Read, Update, Delete functionality.
- Advanced CRUD: Features like partial updates, optimistic concurrency control, and query timeouts.
- Filtering and Pagination: Comprehensive data retrieval with filtering, sorting, and pagination support.
- Rate Limiting: Global and IP-based rate limiting to manage traffic.
- Graceful Shutdown: Smooth server shutdown handling.
- User Management: User registration, activation, and permission-based authorization.
- Email Notifications: SMTP setup for sending templated and background emails.
- CORS Support: Secure handling of cross-origin requests.
- Metrics Tracking: Request-level and custom metrics for monitoring performance.
- Build Automation: Makefile usage for version control and build management.
- Deployment Guidance: Step-by-step instructions for deploying on Digital Ocean.