Installation & Quick Start
This guide sets up a new Kashvi project from zero to a running server.
Requirements
- Go
1.25+(matches this framework'sgo.mod) - Optional: Redis (session, queue, cache features)
- Optional: Postgres/MySQL/SQL Server (SQLite works by default)
Step 1: Install the CLI
Install the global kashvi command once:
go install github.com/shashiranjanraj/kashvi/cmd/kashvi@latest
kashvi --helpIf you are developing the framework repository itself, you can also run:
gogo
make installStep 2: Create a project
mkdir my-app
cd my-app
go mod init my-app
go get github.com/shashiranjanraj/kashviCreate main.go:
main.gogo
package main
import (
"github.com/shashiranjanraj/kashvi/pkg/app"
appctx "github.com/shashiranjanraj/kashvi/pkg/ctx"
"github.com/shashiranjanraj/kashvi/pkg/router"
)
func main() {
app.New().
Routes(func(r *router.Router) {
r.Get("/health", "health", appctx.Wrap(func(c *appctx.Context) {
c.Success(map[string]any{"ok": true})
}))
}).
Run()
}Step 3: Add environment config
Create .env:
.envgo
APP_ENV=local
APP_PORT=8080
JWT_SECRET=replace-with-long-random-secret
DB_DRIVER=sqlite
DATABASE_DSN=kashvi.db
REDIS_ADDR=localhost:6379
REDIS_PASSWORD=Notes
DB_DRIVERsupports:sqlite,postgres,mysql,sqlserver.- Kashvi reads both
config/app.jsonand.env(then applies defaults)..envwins.
Step 4: Run the app
From the project directory:
kashvi serveThe CLI delegates to your project entrypoint (go run . serve), so your own routes/migrations/seeders are used.
Quick checks:
curl http://localhost:8080/health
kashvi route:listStep 5: Add your first resource
kashvi make:crud PostThis generates model/controller/service/migration/seeder/test-scenario files. Then:
kashvi migrate
kashvi serve