
GoServe
Production-Ready Go Backend Architecture Framework
A comprehensive, production-ready framework for building scalable Go backend services with PostgreSQL, MongoDB, Redis, and NATS microservices support.

Getting Started
Features
- Clean Architecture - Well-structured, maintainable codebase following Go best practices
- HTTP Server - Built on Gin framework with middleware support
- Authentication - JWT-based authentication and authorization
- Multiple Databases - Support for PostgreSQL, MongoDB, and Redis
- Microservices - NATS-based microservice communication patterns
- Validation - Comprehensive request/response validation using validator v10
- Error Handling - Structured error handling and API responses
- Testing - Extensive test coverage with mocking support
- DTOs - Type-safe data transfer objects for common types (UUID, ObjectID, Slug, Pagination)
- Performance - Optimized for high-throughput production workloads
Core Packages
| Package | Description |
|---|
| network | HTTP routing, middleware, request/response handling, validation |
| mongo | MongoDB connection, query builder, validation utilities |
| postgres | PostgreSQL database connectivity and operations |
| redis | Redis caching and key-value store operations |
| micro | NATS microservice framework for message-based communication |
| dto | Common DTOs (MongoID, UUID, Slug, Pagination) |
| utility | Helper functions for formatting, mapping, random generation |
| middleware | HTTP middleware (error catcher, 404 handler) |
Example Projects
Real-world applications built with GoServe:
-
PostgreSQL API Server
Complete REST API with PostgreSQL, JWT authentication, and clean architecture
-
MongoDB API Server
MongoDB-based backend with flexible schema design
-
Microservices Example
NATS-based microservices communication patterns
Technology Stack
- Language: Go 1.21+
- Web Framework: Gin
- Authentication: JWT tokens
- Databases:
- Validation: validator
- Configuration: Viper
- Messaging: NATS
- Testing: Testify
Documentation
Comprehensive guides, API references, and examples for all packages
Articles & Tutorials
Contributing
We welcome contributions! Please see our Contributing Guidelines and Code of Conduct.
Development Setup
- Fork the repository
- Clone your fork:
git clone https://github.com/YOUR_USERNAME/goserve.git
- Create a feature branch:
git checkout -b feature/your-feature
- Make changes and add tests
- Run tests:
go test ./...
- Commit with clear messages:
git commit -m "Add feature: description"
- Push to your fork:
git push origin feature/your-feature
- Open a Pull Request
Learn More
Subscribe to AfterAcademy on YouTube for in-depth tutorials and concept explanations:

License
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
Support This Project
If you find GoServe useful, please consider:
- Starring this repository
- Reporting bugs and issues
- Suggesting new features
- Contributing code improvements
- Sharing with the community
Security
For security concerns, please review our Security Policy.
Built with love by AfterAcademy
Documentation • Quick Start Guide • Contributing • License