A production-ready full-stack starter kit with authentication, role-based access control, i18n, and clean architecture.
- JWT Authentication — Login, register, Google OAuth, token refresh, session management
- Role-Based Access Control — Roles, permissions, and module-level access
- Clean Architecture — Consistent structure on both backend and frontend
- Dependency Injection — uber/dig for automatic wiring on the backend
- Internationalization — English & Indonesian out of the box (next-intl)
- Theme System — Light & dark mode with next-themes + shadcn/ui
- Database Migrations — Auto-run on startup with golang-migrate
- Docker Ready — Development and production Docker Compose configs
- API Rate Limiting — Built-in rate limiter middleware
- Security Headers — HSTS, X-Frame-Options, Content-Type sniffing protection
| Layer | Technology |
|---|---|
| Backend | Go, Chi Router, uber/dig, PostgreSQL, Redis |
| Frontend | Next.js 16, React 19, Tailwind CSS v4, shadcn/ui |
| Auth | JWT (access + refresh tokens), Google OAuth |
| State | TanStack Query, Zustand |
| i18n | next-intl (EN, ID) |
| DevOps | Docker, Docker Compose, Makefile |
- Go 1.21+
- Node.js 18+ or Bun
- Docker & Docker Compose
git clone https://github.com/yogameleniawan/gns.git
cd gnscd backend
cp .env.example .env
cp config/config.template.yaml config/config.development.yaml
# Option A: Docker (recommended)
make dev
# Option B: Local (requires PostgreSQL & Redis)
go mod download
make init
make runcd frontend
bun install # or: npm install
bun dev # or: npm run dev- Frontend: http://localhost:3000
- Backend API: http://localhost:8080
| Field | Value |
|---|---|
admin@gns.com |
|
| Password | admin123 |
gns/
├── backend/
│ ├── cmd/api/ # Entry point (main, config, migration, server)
│ ├── config/ # YAML config per environment
│ ├── container/ # Dependency injection (uber/dig)
│ ├── internal/ # Business modules
│ │ ├── auth/ # Authentication (dto, repo, service, handler)
│ │ └── rbac/ # Roles & permissions
│ ├── migrations/ # SQL migrations & seeders
│ └── pkg/ # Shared packages (middleware, router, utils, etc.)
│
├── frontend/
│ ├── app/ # Next.js App Router pages
│ ├── src/
│ │ ├── domain/ # Types & interfaces
│ │ ├── application/ # Hooks & state management
│ │ ├── infrastructure/ # API clients & stores
│ │ └── presentation/ # Components & pages
│ └── locales/ # i18n translations
make dev # Start dev environment (Docker)
make dev-down # Stop dev containers
make run # Run locally
make build # Build binary
make create-migration name=X # Create migration
make migrate-up # Run migrations
make migrate-down # Rollback migrations
make db-shell # PostgreSQL shellEach backend module follows a 4-file pattern inside internal/:
internal/your_module/
├── dto.go # Request/response structs
├── repository.go # Database queries
├── service.go # Business logic
└── handler.go # HTTP handlers
Then wire it in container/container.go and add routes in pkg/router/router.go.
See the Documentation page for detailed guides.
All routes are prefixed with /v1.
| Method | Path | Description |
|---|---|---|
| POST | /auth/register |
Register |
| POST | /auth/login |
Login |
| POST | /auth/refresh |
Refresh token |
| GET | /auth/profile |
Get profile (🔒) |
| GET | /users |
List users (🔒 Admin) |
| POST | /users |
Create user (🔒 Admin) |
| GET | /rbac/roles |
List roles (🔒 Admin) |
| GET | /rbac/permissions |
List permissions (🔒 Admin) |
🔒 = Requires authentication
This project is open source and available under the MIT License.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
