Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
G

gocraft

> 编程语言
Open source

Create Go projects faster → Auth, DB, gRPC, Docker, Swagger, and monitoring included.

192 stars0 likes1 views
WebsiteGitHub

About

Create Go projects faster → Auth, DB, gRPC, Docker, Swagger, and monitoring included.

GoCraft - Go Backend Generator

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.


✨ Why Choose GoCraft?

  • Lightning Fast: Generate production-ready Go backends in seconds
  • ️ Modular Architecture: Choose exactly the features you need
  • Security First: Built-in authentication, validation, and security best practices
  • Well Documented: Comprehensive documentation and examples for every feature
  • Production Ready: Generated code follows Go best practices and industry standards
  • Highly Configurable: Extensive customization options for every component

Quick Start

Prerequisites

  • Go 1.23+ - Install Go
  • PostgreSQL - For user management and project history
  • Git - For version control

Get Started in 3 Steps

  1. Clone and Setup

    bash
    git clone https://github.com/telman03/gocraft-backend.git
    cd gocraft-backend
    go mod tidy
  2. Configure Environment

    bash
    cp .env.example .env
    # Edit .env with your database credentials
    # Make sure to set up PostgreSQL and update the DATABASE_URL
  3. Start the Server

    bash
    go run cmd/gocraft/main.go

    Note: 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


️ Architecture Overview

GoCraft follows a clean, modular architecture designed for scalability and maintainability:

…

️ Supported Technologies

Web Frameworks

  • Gin - Fast and minimalist web framework
  • Echo - High performance, extensible framework
  • Fiber - Express-inspired framework built on Fasthttp

️ Databases

  • PostgreSQL - Advanced relational database
  • MySQL - Popular relational database
  • SQLite - Lightweight embedded database
  • MongoDB - NoSQL document database
  • Redis - In-memory cache and data store

Authentication & Security

  • JWT Authentication - Secure token-based auth
  • OAuth2 - Social login integration
  • OTP Verification - Email-based verification
  • Rate Limiting - Built-in request throttling
  • Input Validation - Comprehensive request validation

AI Integration

  • OpenAI - GPT models integration
  • Claude - Anthropic's AI assistant
  • OpenRouter - Multi-model AI access

Communication

  • gRPC - High-performance RPC framework
  • WebSocket - Real-time bidirectional communication
  • REST API - Standard HTTP API structure

DevOps & Deployment

  • Docker - Container configuration
  • Docker Compose - Multi-service orchestration
  • Makefile - Build automation
  • Swagger - Interactive API documentation

Usage Examples

User Registration & Authentication

bash
# 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!"}'

️ Project Generation

…

Project Management

bash
# 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.zip

Generated Project Structure

Every generated project follows Go best practices and includes:

…

Configuration

Environment Variables

GoCraft automatically generates comprehensive .env.example files based on selected features:

…

Feature Compatibility

GoCraft includes intelligent conflict detection:

✅ Compatible Combinations:

  • gin + postgresql + auth + redis + swagger
  • fiber + mongodb + websocket + docker
  • echo + mysql + grpc + openai

❌ Conflicting Features:

  • Multiple frameworks: gin + echo + fiber
  • Multiple primary databases: postgresql + mysql + mongodb

Security Features

GoCraft prioritizes security with built-in features:

  • JWT Authentication - Secure token-based authentication
  • ️ Input Validation - Comprehensive request validation and sanitization
  • Password Security - bcrypt hashing with configurable cost
  • OTP Verification - Cryptographically secure email verification
  • Rate Limiting - Configurable request throttling (100 req/min default)
  • CORS Protection - Configurable cross-origin resource sharing
  • SQL Injection Prevention - Parameterized queries and ORM protection
  • Audit Logging - Comprehensive security event logging

Development & Testing

Running Tests

bash
# Run all tests
go test ./...

# Run tests with coverage
go test -cover ./...

# Run specific test package
go test ./internal/handlers/...

Building for Production

bash
# 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

Docker Development

bash
# Build Docker image
docker build -t gocraft:latest .

# Run with Docker Compose
docker-compose up -d

# View logs
docker-compose logs -f gocraft

API Documentation

Interactive Documentation

Visit http://localhost:8080/swagger/ for interactive API documentation with:

  • Complete endpoint documentation
  • Interactive request testing
  • Request/response examples
  • Authentication testing
  • Schema definitions

Key Endpoints

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

Contributing

We welcome contributions from the community! Here's how to get started:

Quick Contribution Guide

  1. Fork the Repository

    bash
    git clone https://github.com/YOUR_USERNAME/gocraft-backend.git
    cd gocraft-backend
  2. Create a Feature Branch

    bash
    git checkout -b feature/amazing-new-feature
  3. Make Your Changes

    • Follow Go best practices and existing code style
    • Add tests for new functionality
    • Update documentation as needed
  4. Test Your Changes

    bash
    go test ./...
    go fmt ./...
    go vet ./...
  5. Submit a Pull Request

    • Provide a clear description of your changes
    • Reference any related issues
    • Ensure all tests pass

Areas for Contribution

  • New Features: Add support for new frameworks, databases, or integrations
  • Bug Fixes: Help us squash bugs and improve reliability
  • Documentation: Improve docs, add examples, or create tutorials
  • Testing: Expand test coverage and add integration tests
  • Templates: Create new project templates or improve existing ones

Development Guidelines

  • Follow Go Code Review Comments
  • Write clear, descriptive commit messages
  • Add tests for new functionality
  • Update documentation for user-facing changes
  • Use gofmt and go vet before submitting

License

This project is licensed under the MIT License - see the LICENSE file for details.

The MIT License allows you to:

  • ✅ Use the software for any purpose
  • ✅ Modify and distribute the software
  • ✅ Include in proprietary software
  • ✅ Sell copies of the software

Support & Community

Getting Help

  • Documentation: Check our comprehensive docs
  • Bug Reports: Create an issue
  • Feature Requests: Request a feature
  • Discussions: Join the conversation

Show Your Support

If GoCraft helps you build better Go applications, please consider:

  • ⭐ Star the repository on GitHub
  • Share on social media with #GoCraft
  • Write a blog post about your experience
  • Contribute to the project

What's Next?

Upcoming Features

  • GraphQL Support - GraphQL server generation
  • Prometheus Metrics - Built-in observability
  • Message Queues - NATS, RabbitMQ, Kafka integration
  • ️ Microservices - Multi-service project generation
  • Custom Templates - User-defined project templates
  • CLI Tool - Command-line interface for project generation

Roadmap

  • Q1 2026: GraphQL support, Prometheus metrics
  • Q2 2026: Message queue integrations, CLI tool
  • Q3 2026: Microservices architecture, custom templates
  • Q4 2026: Advanced monitoring, performance optimizations

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Gogolangopen-source

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言