Example of full-stack Go based Web app
Features:
- Comfortable and flexible component based templates via templ
- CRUD functionality (Create, Read, Update, and Delete entries)
- Persistent storage via SQLite + ORM (gorm)
- User friendly interface with interactive Modals for better UX
- Error handling on server and user interface side
- Infinite Scrolling via lazy loading
- Security configration
- Native light and dark mode support
- Preserve static files
- Swagger API documentation via swaggo
- CSRF Protection — session-based tokens via Fiber middleware (Synchronizer Token Pattern)
- SQL Injection Prevention — all database queries use gorm parameterized bindings
- Content-Security-Policy — restricts resource loading
- Input Validation — server-side length limits and empty checks with field-level error reporting
- Secure Cookies —
HttpOnly,SameSite=Lax, session-scoped for CSRF and session tokens
# 1. Clone this repository
git clone https://github.com/sonjek/go-full-stack-example && cd go-full-stack-example
# 2. Run (with hot-reload)
make dev
# Or run (without hot-reload)
make start
# Or build a binary and run
make build && bin/appThe server starts on :3000.
The SQLite database is created automatically and migrations are applied on startup.