go-forge-api

A powerful and flexible toolkit for building production-ready REST APIs in Go.
Features
-
π Production-Ready: Built with best practices and real-world usage in mind
-
π Secure: Built-in authentication and middleware support
-
π Clean Architecture: Following SOLID principles and clean architecture patterns
-
π Extensible: Easy to add new features and customize existing ones
-
π Database Support: PostgreSQL support with migrations included
-
π Logging: Structured logging with logrus
-
β‘ Performance: Optimized for high performance
-
π§ͺ Testing: Comprehensive testing utilities included
Quick Start
Prerequisites
Installation
# Clone the repository
git clone https://github.com/bambutcha/go-forge-api.git
# Navigate to the project
cd go-forge-api
# Install dependencies
go mod download
Running
# Using make
make run
# Or directly
go run cmd/api-server/main.go
Project Structure
go-forge-api/
βββ cmd/ # Application entry points
βββ configs/ # Configuration files
βββ internal/ # Private application code
β βββ app/ # Application core
β β βββ api-server/ # HTTP server implementation
β β βββ model/ # Domain models
β β βββ store/ # Data access layer
βββ migrations/ # Database migrations
API Endpoints
Method |
Path |
Description |
POST |
/users |
Create a new user |
POST |
/sessions |
Create a new session |
GET |
/private/whoami |
Get current user info |
Development
Running Tests
# Run all tests make test # Run specific tests go test ./internal/app/...
Database Migrations
# Create a new migration make migrate-create name=add_users_table # Apply migrations make migrate-up # Rollback migrations make migrate-down
Contributing
We welcome contributions! Please see ourΒ Contributing GuidelinesΒ for details.
Development Process
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
)
- Commit your changes (
git commit -m 'Add some amazing feature'
)
- Push to the branch (
git push origin feature/amazing-feature
)
- Open a Pull Request
License
This project is licensed under the MIT License - see theΒ LICENSEΒ file for details.
Acknowledgments