Skip to content
/ Quick Start

Documentation

Quick Start

Create a project and your first module in minutes.

1. Create a project

bash
gostrata new my-saas
cd my-saas

Run it with no flags for the interactive wizard, or pass --router and --database. gostrata sets up the directory structure, go.mod, a .env file, a Makefile and, for PostgreSQL and MySQL, a Docker Compose file for the database.

2. Generate a module

bash
gostrata make:module Product name:string price:float stock:int

This creates the entity, DTOs, repository, usecase, handler and migration for Product, and registers its routes.

3. Set up the database and migrate

With PostgreSQL or MySQL, start the database container first. SQLite needs no setup, so skip that line.

bash
docker compose up -d
make migrate

4. Run it

Start the server with hot reload. It uses Air when installed and otherwise falls back to go run:

bash
make dev

The API listens on port 8080 by default. Check http://localhost:8080/health, then see the tutorial for a full walkthrough with curl examples.

Want to see what would be created first? Add --dry-run to any command to preview the generated files. See Available Commands.