Skip to content
Quick Start

Quick Start

Creating an Application

Now that you have installed the lemmego CLI, you can create a new project:

lemmego new my-project

This command will walk you through interactive prompts:

  1. Module name — the Go module path (e.g., github.com/username/my-project)
  2. Preset — choose between mvc (with frontend) or rest_api (backend-only)
  3. ORM — select gorm or bun as the database ORM
  4. Redis — enable or disable Redis support
  5. Auth — enable or disable authentication scaffolding
  6. GPA (experimental) — enable the Go Persistence API
  7. Frontend preset (for mvc) — pick Go Templates, Templ, Inertia React, Inertia Vue, or combinations

Once configured, navigate into your project directory:

cd my-project

Running the Application

Start the development server:

lemmego run

Or use hot-reload:

lemmego dev

The dev command orchestrates three parallel processes:

  • air — Go hot reload on :8080
  • templ generate –watch — Templ file watcher (if .templ files exist)
  • vite dev — Frontend dev server (if package.json exists)

Visit http://localhost:8080 in your browser — you should see the application’s homepage.

Development Workflow

The generated project includes a Makefile with common tasks:

CommandDescription
make runStart with hot reload (air)
make watchParallel templ + tailwind + air + file watcher
make devFrontend dev server
make buildBuild frontend assets
make migrateRun pending migrations
make migration n=nameCreate a new migration
make model n=nameGenerate a model
make handlers n=nameGenerate CRUD handlers
make input n=nameGenerate input validation
make form n=nameGenerate a form component

Frontend Options

Lemmego supports multiple frontend approaches:

  • Go Templates (*.page.gohtml) — server-rendered HTML with layouts and partials
  • Templ (*.templ) — type-safe Go templates with compile-time checking
  • Inertia.js with React or Vue — SPA-like experience with server-side routing

The make watch command handles Go Templates and Templ reloading. For Inertia, run npm run dev separately.

Project Structure

After scaffolding, your project will have this structure:

├── bootstrap/          # Application bootstrap layer
│   ├── providers.go    # Service provider registration
│   ├── routes.go       # Route registration
│   ├── middleware.go   # App-level middleware
│   └── commands.go     # CLI commands
├── cmd/app/main.go     # Application entry point
├── internal/           
│   ├── commands/       # CLI command implementations
│   ├── configs/        # Configuration (auto-loaded)
│   ├── handlers/       # HTTP request handlers
│   ├── inputs/         # Input validation structs
│   ├── middleware/      # App-specific middleware
│   ├── migrations/     # Database migrations
│   ├── models/         # Domain models
│   ├── plugins/        # Extension point
│   ├── repos/          # Repository layer
│   └── routes/         # Route definitions
├── resources/          # Frontend source (JS, CSS, templates)
├── templates/          # Go/Templ templates
├── public/             # Compiled static assets
└── storage/            # Runtime data (database, sessions, uploads)