Quick Start
Get a GoForge API running locally in under 5 minutes.
1. Create a New Project
Pass the project directory name and Go module path:
goforge new myapp github.com/acme/myapp
cd myapp(Running goforge new with no arguments launches an interactive 4-step wizard where you can also choose which database drivers to keep: sqlite, mysql, postgresql, sqlserver.)
2. Configure Environment & Generate APP_KEY
Copy .env.example to .env and generate a 32-byte cryptographic APP_KEY:
cp .env.example .env
goforge gen:keyWhy APP_KEY is required
GoForge validates configuration before serving (ValidateForServe()). Starting the server with an empty APP_KEY fails fast so an API never boots unprotected.
3. Run Database Migrations & Seeders
Apply the initial schema for the built-in todo service and seed sample records:
goforge migrate
goforge db:seedgoforge migrateuses Atlas (DB_MIGRATOR=atlasby default) or GORM AutoMigrate (DB_MIGRATOR=gorm).goforge db:seedrunsDatabaseSeeder, which executesTodoSeederinside a transaction and inserts 3 sample todos idempotently.
4. Start the Application
goforge app serveIn an interactive terminal, GoForge opens the TUI Dashboard showing live panels for All logs, HTTP, gRPC, and System with real-time request/route/error counters.
For plain log output (e.g., CI or piping):
goforge app serve --no-tui5. Test the Endpoints
Load APP_KEY into your shell and test the public probes and protected routes:
export APP_KEY=$(grep '^APP_KEY=' .env | cut -d= -f2-)
# Public liveness & readiness probes (no X-App-Key required)
curl http://127.0.0.1:3000/health
curl http://127.0.0.1:3000/ready
# Protected Todo API (requires X-App-Key header)
curl -H "X-App-Key: $APP_KEY" http://127.0.0.1:3000/api/todosCreate a new todo:
curl -X POST http://127.0.0.1:3000/api/todos \
-H "Content-Type: application/json" \
-H "X-App-Key: $APP_KEY" \
-d '{"title":"Ship GoForge app","description":"Test CRUD + events"}'6. Explore Interactive OpenAPI Docs
While APP_DEBUG=true in .env, OpenAPI 3.1 docs are accessible in your browser:
- Interactive UI:
http://127.0.0.1:3000/api/docs/todo - OpenAPI JSON spec:
http://127.0.0.1:3000/api/docs/todo.json
(When APP_DEBUG=false, /api/docs/* routes require X-App-Key automatically.)
Next: Build TaskForge — Full End-to-End Tutorial (Limen Auth, CRUD, Docs, Events, gRPC & Tests) →
