Introducing GoScaf CLI: Streamline Your Go Web Development

GoScaf CLI is a powerful command-line tool that enables Go developers to quickly scaffold web applications with best practices, standardized layouts, and automation. Whether you're starting from scratch or need a strong foundation, GoScaf streamlines the setup process and ensures maintainability.

🔥 Why Use GoScaf?

  • Instant Project Setup – Get up and running in seconds.
  • Flexible Framework Choices – Supports Fiber, Gin, Echo, Chi, and Iris.
  • Database Integration – Works seamlessly with PostgreSQL, MySQL, and SQLite.
  • ORM Support – Choose between GORM, XORM, or Ent for data modeling.
  • Scalable Project Structure – Organized layout for maintainability.
  • Automated Dependency Management – Installs necessary packages for you.

🚀 Getting Started

Prerequisites

Ensure you have Go 1.16+ installed before using GoScaf.

Installation

Install GoScaf globally with:

go install github.com/samznd/goscaf@latest

Creating a New Project

Run the following command to start an interactive setup:

goscaf init

You'll be prompted to configure your project:
1️⃣ Enter your project name
2️⃣ Select a web framework (Fiber, Gin, Echo, Chi, Iris)
3️⃣ Choose a database (PostgreSQL, MySQL, SQLite)
4️⃣ Select an ORM (GORM, XORM, Ent) or go ORM-free

Example:

$ goscaf init
? What is your project name? myapp
? Choose your web framework: Gin
? Choose your database system: MySQL
? Would you like to use an ORM? Yes
? Choose your ORM framework: Ent
✅ Project initialized successfully!

📂 Project Structure

GoScaf generates a well-organized folder structure for scalability and best practices:

myapp/
├── cmd/               # Application entry point
│   └── main.go
├── config/            # Configuration files (e.g., database, env)
├── internal/          # Core business logic
│   ├── handlers/      # HTTP request handlers
│   ├── middleware/    # Custom middleware
│   ├── models/        # ORM models (if applicable)
│   ├── repositories/  # Database access layer
│   ├── routes/        # API routes
│   ├── services/      # Business logic layer
├── pkg/               # Shared utility packages
│   ├── utils/         # Helper functions
├── scripts/           # Deployment & automation scripts
└── .env               # Environment variables

⚡ Supported Technologies

Web Frameworks

  • Fiber – High-performance, Express-inspired framework
  • Gin – Robust middleware and high-speed HTTP processing
  • Echo – Minimalist and extensible framework
  • Chi – Lightweight and idiomatic router
  • Iris – Feature-rich web framework with MVC support

Database & ORM Support

  • Databases: PostgreSQL, MySQL, SQLite
  • ORMs: GORM, XORM, Ent

Development & Contribution

Requirements

  • Go 1.16+

Built with

GoScaf is powered by:

  • 🛠 Cobra – A powerful Go library for creating CLI applications.
  • 🎨 Survey – Enhances user interaction with intuitive prompts.

Build from Source

Clone the repository and build the project:

git clone https://github.com/samznd/goscaf.git
cd goscaf
go build

Roadmap & Future Enhancements

  • 🔜 Docker configuration
  • 🔜 GraphQL & gRPC support
  • 🔜 Authentication module

📜 License & Community

GoScaf is open-source and licensed under the MIT License.


Start building with GoScaf today!

🌟 Check out the repo on GitHub
💡 Have ideas or feedback? Open an issue or submit a PR!