Hey I'm Phuc, I'm cooking a new Golang framework.
A Go web application framework template designed to accelerate development of production-ready web applications. It provides a solid foundation with best practices, common utilities, and integrations for building scalable web services.
- Go 1.25+
- Chi Router
- sqlx
- Jet Templating
- Uber Config
- SCS (Session Management)
- nosurf (CSRF Protection)
- httprate (Rate Limiting)
- Hotwired (Turbo/Stimulus)
- Vite
- Tailwind CSS
- Mailgun / Resend
- AWS S3 SDK
- melody (WebSockets)
- cron (Task Scheduling)
- goose (Database Migrations)
- slog-chi (Structured Logging)
- Ansible (Deployment)
.
├── cmd/
│ ├── kit/ # CLI tools for project management
│ └── server/ # Main application entry point
├── internal/
│ ├── biz/ # Business logic components
│ ├── config/ # Configuration management
│ ├── data/ # Data access layer
│ ├── domain/ # Domain models
│ ├── handler/ # HTTP handlers
│ ├── middleware/ # Custom middleware
│ ├── server/ # Server initialization
│ └── ... # Other internal packages
├── web/ # Static assets and compiled binaries
├── config/ # Configuration files
├── deploy/ # Deployment scripts
└── ...
cmd/server/main.go
: Main application entry point.internal/handler/routes.go
: HTTP route definitions.internal/domain/
: core domain definition.internal/biz/
: business logic implementation.internal/data/
: database repositories impplementation of core domain repository outbox.internal/handler/
: folder contains http handlers.internal/cron/
: folder contains cronjob.internal/job/
: folder contains job queue and job worker implementation.config/
: Application configuration files.migration/
: Database migration files.web/views/
: Jet template files.web/js/
: frontend javascript, hotwired.js and stimulus controller files.web/assets/
: Frontend asseets build folder (JS, CSS).kit.toml
:kit
CLI configuration.
- Go 1.25+
- MariaDB 11.4+ (or compatible MySQL)
- Node.js (for building frontend)
- Ansible (optional, for production deployment)
The framework includes a CLI tool (kit
) for common tasks:
Command | Description |
---|---|
kit init |
Initialize project dependencies. |
kit serve |
Start the development server with hot reloading. |
kit build |
Build the production binary. |
kit debug |
Start a debugging session. |
go test ./... |
Run all tests. |
kit assets |
Build frontend assets. |
kit provision |
Provision the production server. |
kit deploy |
Deploy the application. |
kit domain -n NAME |
Generate new domain file. |
kit repo -n NAME |
Generate new database repository file. |
kit service -n NAME |
Generate new business service file. |
kit handler -n NAME |
Generate new http handler file. |
kit job -n NAME |
Generate new job queue worker file file. |
kit cron -n NAME |
Generate cron job file. |
kit migration -n NAME |
Generate database migration file. |
kit migrate up/down/reset |
Run datbase migration. |
-
Install dependencies:
brew install go nodejs ansible mysql@8.4
Tip
Why not using docker, well develop on local is blazing fast. but you can use docker if you want.
-
Create a new project:
kit new -n blog -p github.com/username/blog
-
Generate local configuration:
kit vault local
-
Initialize project dependencies:
kit init
-
Start development server:
kit serve
kit serve
starting dev server with hot reload for both backend and frontend which enable by default.- Debugging can be started with:
kit debug
-
Provision production server:
kit provision
-
Deploy to production:
kit deploy # For ARM64 servers kit deploy -a amd64 # For AMD64 servers
Configuration is managed through:
- Environment variables
- TOML configuration files in the
config/
directory - Encrypted vault files managed by the
kit vault
command
Database migrations are handled by kit CLI tol:
# Create new migration
kit migration -n NAME # create new migration file
# Apply migrations
kit migrate up|down|reset # run migration
Run tests with:
go test ./...
For integration tests requiring a testcontainer, make sure you have docker is running.