Create Go projects faster → Auth, DB, gRPC, Docker, Swagger, and monitoring included.
Create Go projects faster → Auth, DB, gRPC, Docker, Swagger, and monitoring included.
GoCraft is a powerful, production-ready Go backend generator that helps developers quickly scaffold modern microservices with their preferred frameworks, databases, and features. Generate complete, well-structured Go applications in seconds with built-in best practices, security features, and comprehensive documentation.
Clone and Setup
git clone https://github.com/telman03/gocraft-backend.git
cd gocraft-backend
go mod tidyConfigure Environment
cp .env.example .env
# Edit .env with your database credentials
# Make sure to set up PostgreSQL and update the DATABASE_URLStart the Server
go run cmd/gocraft/main.goNote: If you encounter database connection errors, ensure PostgreSQL is running and your .env file has the correct database credentials.
Your GoCraft server is now running at http://localhost:8080
GoCraft follows a clean, modular architecture designed for scalability and maintainability:
…# Register a new user
curl -X POST http://localhost:8080/auth/register \
-H "Content-Type: application/json" \
-d '{"email":"[email protected]","password":"SecurePass123!"}'
# Verify email with OTP
curl -X POST http://localhost:8080/auth/verify-otp \
-H "Content-Type: application/json" \
-d '{"email":"[email protected]","otp":"123456"}'
# Login and get JWT token
curl -X POST http://localhost:8080/auth/login \
-H "Content-Type: application/json" \
-d '{"email":"[email protected]","password":"SecurePass123!"}'…# View project history
curl -X GET http://localhost:8080/api/history \
-H "Authorization: Bearer YOUR_JWT_TOKEN"
# Get project statistics
curl -X GET http://localhost:8080/api/history/stats \
-H "Authorization: Bearer YOUR_JWT_TOKEN"
# Download previous project
curl -X GET http://localhost:8080/api/history/123/download \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
--output project-backup.zipEvery generated project follows Go best practices and includes:
…GoCraft automatically generates comprehensive .env.example files based on selected features:
…GoCraft includes intelligent conflict detection:
✅ Compatible Combinations:
gin + postgresql + auth + redis + swaggerfiber + mongodb + websocket + dockerecho + mysql + grpc + openai❌ Conflicting Features:
gin + echo + fiberpostgresql + mysql + mongodbGoCraft prioritizes security with built-in features:
# Run all tests
go test ./...
# Run tests with coverage
go test -cover ./...
# Run specific test package
go test ./internal/handlers/...# Build binary
go build -o bin/gocraft cmd/gocraft/main.go
# Build with optimizations
go build -ldflags="-s -w" -o bin/gocraft cmd/gocraft/main.go
# Cross-compile for Linux
GOOS=linux GOARCH=amd64 go build -o bin/gocraft-linux cmd/gocraft/main.go# Build Docker image
docker build -t gocraft:latest .
# Run with Docker Compose
docker-compose up -d
# View logs
docker-compose logs -f gocraftVisit http://localhost:8080/swagger/ for interactive API documentation with:
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
GET |
/health |
Health check | ❌ |
GET |
/features |
List supported features | ❌ |
POST |
/auth/register |
User registration | ❌ |
POST |
/auth/login |
User authentication | ❌ |
POST |
/generate |
Generate project | ✅ |
GET |
/api/history |
Project history | ✅ |
GET |
/api/admin/users |
Admin: List users |
We welcome contributions from the community! Here's how to get started:
Fork the Repository
git clone https://github.com/YOUR_USERNAME/gocraft-backend.git
cd gocraft-backendCreate a Feature Branch
git checkout -b feature/amazing-new-featureMake Your Changes
Test Your Changes
go test ./...
go fmt ./...
go vet ./...Submit a Pull Request
gofmt and go vet before submittingThis project is licensed under the MIT License - see the LICENSE file for details.
The MIT License allows you to:
If GoCraft helps you build better Go applications, please consider:
#GoCraftNo open issues yet, or sync has not completed.