A modern full-stack web application template featuring a Go backend with Fiber framework, SolidJS frontend, and Valkey cache database. This baseline template provides a solid foundation for building scalable web applications with authentication, real-time features, and a modern development environment orchestrated using Docker and Tilt. I realize this is not for everyone, wanted to try and put together a solid base that would allow for rapid iteration and still be production quality.
- Clone or fork this repository as your new project
- Copy environment file:
cp .env.template .env
- Update security values in
.env
(generate secure secrets for production) - Update project names in
client/package.json
and other config files - Start development:
tilt up
- Begin customizing the application for your specific needs
baseline/
βββ server/ # Go backend (Repository pattern + Fiber + GORM + SQLite)
β βββ internal/
β β βββ repositories/ # Data access layer with interfaces
β β βββ controllers/ # Business logic with DI
β β βββ interfaces/ # Service contracts
β β βββ app/ # Dependency injection container
β β βββ ...
βββ client/ # SolidJS frontend (TypeScript + Vite)
βββ database/valkey/ # Valkey cache database
βββ docker-compose.dev.yml
-
Tilt - Modern development environment orchestrator
-
Node.js v22 (for local development)
-
Go 1.24+ (for local development)
-
π§ Server API: http://localhost:8280 (with WebSocket at /ws)
-
π¨ Client App: http://localhost:3010 (with automatic WebSocket auth)
-
πΎ Valkey DB: localhost:6379
-
π Tilt Dashboard: http://localhost:10350
The easiest way to get started is with Tilt, which provides hot reloading, service orchestration, and a web dashboard:
# Start the entire development environment
tilt up
# Access the Tilt dashboard
open http://localhost:10350
This will start:
- π§ Server API: http://localhost:8280
- π¨ Client App: http://localhost:3010
- πΎ Valkey DB: localhost:6379
- π Tilt Dashboard: http://localhost:10350
If you prefer to use Docker Compose directly:
# Start all services
docker compose -f docker-compose.dev.yml up --build
# Stop all services
docker compose -f docker-compose.dev.yml down
Once the environment is up and running, you need to do the following:
- Run migrate up to initialize the database
- Run seed to populate the database with initial data
Go backend using Fiber framework with repository pattern architecture.
- API Framework: Fiber v2
- Database: SQLite with GORM + Valkey cache
- Architecture: Repository pattern with dependency injection
- Authentication: JWT with bcrypt
- WebSockets: Real-time communication support
- Data Access: Interface-based repositories with dual database/cache strategy
The server implements a clean repository pattern for data access:
- User Repository: Handles user data with cache-first strategy and database fallback
- Session Repository: Manages JWT sessions exclusively in Valkey cache
- Interface-based Design: All repositories implement contracts for easy testing and swapping
The App struct serves as a centralized dependency injection container:
- Constructor Injection: Repositories and services injected via constructors
- Interface Contracts: Loose coupling through interface-based design
- Circular Dependency Handling: WebSocket manager uses setter injection
- Centralized Configuration: Single App struct manages all service dependencies
Modern SolidJS frontend application with TypeScript.
- Framework: SolidJS with TypeScript
- Build Tool: Vite
- Styling: SCSS with CSS Modules
- Routing: @solidjs/router
- State Management: Solid Query + Context API
Valkey cache database for session management and caching.
- Database: Valkey (Redis-compatible)
- Configuration: Optimized for development
- Persistence: AOF + RDB snapshots
The Tilt dashboard at http://localhost:10350 provides:
- Live Service Status: Real-time health monitoring
- Log Streaming: Aggregated logs from all services
- Manual Triggers: Run tests, linting, and utilities
- Resource Management: Easy service restart and debugging
# Development shortcuts via Tilt
tilt trigger server-tests # Run Go tests
tilt trigger server-lint # Run Go linting
tilt trigger client-tests # Run frontend tests
tilt trigger client-lint # Run frontend linting
tilt trigger valkey-info # Show Valkey database info
# Stop all services
tilt down
# Start with streaming logs
tilt up --stream
A comprehensive development script is available:
# Setup development environment
./scripts/dev-tools.sh setup
# Run all tests
./scripts/dev-tools.sh test
# Run all linters
./scripts/dev-tools.sh lint
# Build production assets
./scripts/dev-tools.sh build
# Clean all artifacts
./scripts/dev-tools.sh clean
# Database operations
./scripts/dev-tools.sh db reset
./scripts/dev-tools.sh db migrate
All environment variables are managed in a single .env
file at the project root:
# .env (project root)
# General
GENERAL_VERSION=0.0.1
# Server Configuration
SERVER_PORT=8280
DB_PATH=data/app.db
DB_CACHE_ADDRESS=valkey
DB_CACHE_PORT=6379
# CORS - must expose X-Auth-Token header for WebSocket auth
CORS_ALLOW_ORIGINS=http://localhost:3010
# Security & Authentication
SECURITY_SALT=12
SECURITY_PEPPER=your-secure-pepper-string
SECURITY_JWT_SECRET=your-secure-jwt-secret
# Client Configuration
VITE_API_URL=http://localhost:8280
VITE_WS_URL=ws://localhost:8280/ws
VITE_ENV=local
Each component has its own testing and linting setup:
- Server: Go tests with
go test
, linting withgolangci-lint
- Repository interface testing with mock implementations
- Controller unit tests with dependency injection
- Interface compliance testing
- Client: TypeScript tests (ready for setup), ESLint for linting
- Integration: Manual testing utilities via Tilt dashboard
While the current setup is optimized for development, production deployment considerations:
- Use multi-stage Docker builds for optimized images
- Configure proper environment variables for production
- Set up proper database backups for Valkey
- Configure reverse proxy for the frontend
- Enable HTTPS and security headers
- Development Setup: Use
tilt up
for the best development experience - Code Style: Follow the established patterns in each component
- Testing: Run tests before submitting changes
- Documentation: Update README files when adding new features
- Port Conflicts: Ensure ports 8280, 3010, and 6379 are available
- Docker Issues: Try
docker system prune
to clean up resources - Tilt Issues: Check the Tilt dashboard logs for detailed error information
- Database Issues: Use
./scripts/dev-tools.sh db reset
to reset the database
- Check the Tilt dashboard for real-time service status
- Review individual component README files for specific issues
- Check Docker container logs:
docker compose -f docker-compose.dev.yml logs [service]
Happy coding! π
- Testing how well a hybrid migration works, mostly led by Gorm AutoMigrate. Probably not the best way to go. But it works. And want to see how far it goes.
- Seeing how well SQLite works as a production level database with light load and minimal complex operations.
- See how well the logger works, including how well with built in returning. :TODO Add perfomance metrics to logging.