Installation
Prerequisites
Section titled “Prerequisites”Go 1.24 or newer. Nothing else: no C compiler, no Node, no database server (SQLite is built in).
go versionCreate a Project
Section titled “Create a Project”go install github.com/semutdev/goigniter/cmd/goigniter@latestgoigniter new myappcd myappgo run .Open http://localhost:8080 and log in as admin@admin.com. On the first run the console prints the admin password:
Admin account created: admin@admin.com / 3f9c2a7b1e04d6c8a2 (shown only once, change it after logging in)Tables are created automatically on startup. There is no separate migration or seeding step.
Using MySQL
Section titled “Using MySQL”SQLite is the default. For MySQL, pass the connection details (the database must already exist):
goigniter new myapp --db=mysql --db-user=root --db-pass=secret --db-name=myappAll options: goigniter help. You can change the database later in .env (DB_DRIVER, DB_DSN).
Project Structure
Section titled “Project Structure”myapp/├── application/│ ├── config/ # Database connection│ ├── controllers/ # Your controllers (admin/ holds the admin panel)│ ├── libs/ # Shared code, e.g. authentication│ ├── models/ # GORM models│ └── views/ # HTML templates├── database/ # Table setup and first-run data├── public/ # Static files, served at /static/├── .env # Configuration (APP_KEY, database, admin account)├── go.mod└── main.go # Entry pointThe generated app includes a login page and an admin panel with a dashboard, user management and settings. Use it as a starting point or delete what you don’t need.
Hello World
Section titled “Hello World”Add a new route in main.go, before app.Run:
app.GET("/hello", func(c *core.Context) error { return c.JSON(200, core.Map{ "message": "Hello World!", })})Restart the server and visit http://localhost:8080/hello.
Hot Reload (Optional)
Section titled “Hot Reload (Optional)”Templates already reload on every request in development. To also restart on Go code changes, use Air:
go install github.com/air-verse/air@latestairNext: Routing to learn how to define routes.
Migrating from CodeIgniter 3? Check Agentic Migration for automated migration with AI assistance.