Skip to content
Quick Start

Quick Start

Creating an application

With the lemmego CLI installed, create your project:

lemmego new my-project

This writes you a complete, working application — directories, configuration, a route file, a home page — rather than an empty folder. Generating files like this is called scaffolding, and it means your first lemmego run serves a real page.

The first question asks how much you want to be asked:

  • Quick start wants four answers and picks sensible defaults for everything else.
  • Customise walks you through each part and lets you choose.

If you take Quick start, here is what you are agreeing to. Don’t worry about getting these right now — every one of them can be changed later, and each links to the page that explains it:

DefaultWhat it is
DatabaseSQLiteA database kept in a single file, so there is no server for you to install or run
SQL layerthe Lemmego ORMLets you query in Go — db.Model[User]() — instead of writing SQL by hand
CachefileKeeps the results of slow work so you don’t repeat it, here in files on disk
QueueSQLHolds work to be done later, so a slow job doesn’t make your visitor wait
SessionsfileHow your app remembers who is signed in between requests
StoragelocalWhere uploaded files go — your own disk, rather than S3

The other two answers are your module name (your Go import path, like github.com/you/my-project) and a preset — the overall shape of the project. mvc gives you a server-rendered site with pages and templates; rest_api gives you JSON endpoints and no frontend at all.

The database, cache and queue can each be set to None, which leaves that part out of the project entirely — no dependency, no provider, no config file. See the CLI reference.

Everything is also available as a flag with --non-interactive:

lemmego new my-project --non-interactive \
  --module github.com/username/my-project \
  --database postgres --cache redis --queue redis

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)