Skip to content

FAQ

Frequently asked questions

Quick answers about installing gostrata, the stack it generates and how it fits into your workflow.

The basics

What is gostrata?

gostrata is an open-source command-line tool that scaffolds structured Go backend projects using Clean Architecture. One command gives you the layers, wiring, configuration, Docker files and tooling already in place.

Read the introduction
Is gostrata free?

Yes. gostrata is MIT licensed, free to use in personal and commercial projects, and developed in the open on GitHub.

Why use Clean Architecture in Go?

Clean Architecture keeps business rules independent of frameworks and databases. Dependencies point inward toward the domain, so you can test usecases in isolation and swap an HTTP framework or database without rewriting core logic.

See the four layers
How is gostrata different from copying a template repository?

A template needs manual renaming and cleanup, and it cannot grow with your app. gostrata asks for your stack, generates a project with your module path, and then keeps generating new modules (entity, DTOs, repository, usecase, handler, migration and routes) that match the same structure.

Installing and using it

How do I install gostrata?

On Linux and macOS run the install script, on Windows run the PowerShell script, or use go install. You can also download a release archive manually. Every release publishes a checksums.txt file.

Installation guide
Do I need Go installed to use gostrata?

Not to install the binary. You do need Go 1.23 or newer to build and run the projects it generates. Run gostrata doctor to check that Go, git and Docker are present and recent enough.

Which operating systems are supported?

Linux, macOS and Windows, on both amd64 and arm64.

How do I create my first project?

Run gostrata new my-app, then gostrata make:module Product name:string price:float to generate your first feature module. Start the server with Air for hot reload.

Quick Start
Can I preview what gostrata will generate?

Yes. Add --dry-run to any command to list the files it would create without writing anything. Use --force only when you want to overwrite existing files.

Command reference

Stack and features

Should I choose Gin or Chi?

Both are supported through the --router flag, and Gin is the default. Gin is popular and batteries-included; Chi is lightweight and close to the standard library. Because handlers live in the delivery layer, the choice does not leak into your business logic.

Which databases and ORMs are supported?

PostgreSQL, MySQL and SQLite, all through GORM. Database access is isolated in the infrastructure layer, and usecases only see repository interfaces.

Database setup
What else is included in a generated project?

Viper configuration, Zerolog structured logging, graceful shutdown, a working User feature with a health endpoint, middleware, migrations, a Dockerfile, a Docker Compose file for PostgreSQL and MySQL, Air hot reload and a Makefile.

Project structure
What does make:module generate?

For each module it generates the domain entity and repository interface, the usecase, DTOs, handler and route registration, the GORM repository, and a migration. Use --no-register if you do not want gostrata to patch container.go and routes.go.

Module generation
Can I generate only one piece, like a handler or a migration?

Yes. The single-piece generators are make:entity, make:types, make:repo, make:usecase, make:handler and make:migration.

Deploying and getting help

Can I deploy a gostrata project to production?

Yes. The generated server shuts down gracefully, so it fits container platforms and orchestrators. New projects include a multi-stage Dockerfile and .dockerignore. Provide secrets through your platform and run migrations before starting a new version.

Deployment checklist
I get "gostrata: command not found". What do I do?

The Go bin directory is probably not on your PATH. Add $(go env GOPATH)/bin to it, or restart your terminal after using the Windows installer.

Troubleshooting
How do I upgrade gostrata?

Run the install command again. It always fetches the newest release. See the changelog for what changed.

Changelog
How can I report a bug or contribute?

Open an issue or pull request on GitHub. Bug reports, ideas and improvements are welcome.

Still have a question?

Check the documentation, or ask on GitHub and we will help.