GoScaf is a powerful command-line tool for bootstrapping Go web applications with clean architecture, flexible technology combinations, and best practices baked in.
- Quick project scaffolding with interactive CLI
- Modular selection of Web Framework, Database, and ORM
- Clean and extensible project structure
- Built-in support for environment configs and Docker
- Automated dependency installation
- Consistent and idiomatic Go code generation
- Go 1.16 or higher
go install github.com/samznd/goscaf@latest
## Getting Started.
### Create a new project
goscaf init
This will start an interactive prompt asking for:
- Project name
- Web framework selection (Fiber/Gin/Echo/Chi/Iris)
- Database system (Postgres/MySQL/SQLite)
- ORM preference (Yes/No)
- If Yes to ORM, choose between GORM/XORM/Ent
$ goscaf init
? What is your project name? mywebapp
? Choose your web framework: Fiber
? Choose your database system: Postgres
? Would you like to use an ORM? Yes
? Choose your ORM framework: GORM
✅ Project initialized successfully!
The generated project follows a standard Go project layout:
your-project/
├── cmd/
│ └── main.go # Application entry point
├── config/
│ └── database.go # Database configuration
├── internal/
│ ├── middleware/ # HTTP middleware
│ ├── models/ # Data models
│ ├── repositories/ # Data access layer
│ ├── services/ # Business logic
│ ├── handlers/ # HTTP request handlers
│ └── routes/ # Route definitions
├── pkg/ # Public library code
│ ├── utils/ # Utility functions
├── scripts/ # Build and deployment scripts
└── .env # Environment variables
- High-performance, Express-inspired web framework
- Great for REST APIs
- Minimal memory allocation
- Fast HTTP routing
- Full-featured web framework
- Excellent middleware support
- High performance
- Wide community adoption
- Minimalist web framework
- High performance
- Extensible middleware
- Built-in support for data binding and validation
- Lightweight, idiomatic web framework
- Focused on composability and maintainability
- Efficient router
- Middleware support
- Fast, full-featured web framework
- Built-in MVC support
- Rich routing capabilities
- Extensive middleware ecosystem
- PostgreSQL: Advanced open-source database
- MySQL: Popular open-source database
- SQLite: Lightweight file-based database
- GORM: The most popular Go ORM
- XORM: Simple and powerful ORM
- Ent: Facebook's entity framework
- Go 1.16+
git clone https://github.com/yourusername/goscaf.git
cd goscaf
go build
This project is licensed under the MIT License - see the LICENSE file for details.
- Add support for more web frameworks
- Add Docker configuration
- Add GraphQL support
- Add gRPC support