Weber
A Full-stack Building Framework
Combining Go language backend with Preact frontend for building fast, scalable web applications
Key Features
High Performance
Built on Go and Gin framework for blazing-fast HTTP server performance
Modern Frontend
Preact-powered frontend with SSR and client-side hydration support
Static Generation
Generate static HTML files for optimal SEO and performance
Go Templates
Powerful server-side templating with hot-reload in development
Developer Experience
Hot reload, live development, and comprehensive CLI tools
Built-in Logger
Structured logging with JSON/text formats and context support
Documentation
Getting Started
Installation, setup, and your first Weber application
→Architecture
Understand Weber's system design, rendering strategy, and components
→Backend Development
Go backend guide with routing, handlers, models, and HTTP client
→Frontend Development
Build Preact components, use hooks, and implement client-side features
→Template System
Master Go templates with built-in functions and custom extensions
→Routing
URL routing, parameters, middleware, and request handling
→Configuration
Environment-based configs, database, Redis, and settings
→Deployment
Deploy to production with Docker, Kubernetes, or cloud platforms
→API Reference
Complete API documentation for all modules and functions
→Architecture Overview
Frontend Layer
Backend Layer
Infrastructure Layer
How It Works
- Frontend Build: Preact components are compiled to static HTML and JavaScript bundles using Webpack
- Server-Side Rendering: Go templates render dynamic content on the server for initial page loads
- Client-Side Hydration: Preact takes over on the client-side for interactive components
- Routing: Gin handles HTTP routing and serves both static assets and dynamic pages
- Caching: Built-in caching system for improved performance
Getting Started
Prerequisites
- Go 1.25.3 or higher
- Node.js 18+ and pnpm
- Basic understanding of Go and React/Preact
Installation
1. Clone the Repository
git clone https://github.com/umetech/weber.git
cd weber
2. Install Frontend Dependencies
cd frontend
pnpm install
3. Install Backend Dependencies
go mod tidy
Development
Start Frontend Development Server
cd frontend
pnpm dev
Start Backend Server
# Simple run
make run
# Or with custom port
make run PORT=9090
# Live reload (with nodemon)
make live PORT=8080
Production Build
# Build for current platform
make build
# Build for Linux
make linux
# Build and create zip package
make zip
Preview Static Files
make preview
# or
make preview PORT=9090
Project Structure
weber/
├── backend/ # Go backend code
│ ├── app/ # Application core
│ ├── route/ # HTTP routes
│ ├── model/ # Data models
│ ├── http/ # HTTP clients
│ ├── logger/ # Logging system
│ └── database/ # Database connections
├── frontend/ # Preact frontend
│ ├── src/
│ │ ├── components/ # Reusable components
│ │ ├── pages/ # Page components
│ │ ├── layouts/ # Layout components
│ │ └── utils/ # Utility functions
│ └── build/ # Build configuration
├── config/ # Environment configs
│ ├── dev.json
│ ├── test.json
│ └── prod.json
├── webroot/ # Static files & templates
│ ├── static/ # CSS, JS, images
│ └── *.html # HTML templates
├── doc/ # Documentation
├── main.go # Application entry point
└── Makefile # Build commands