A comprehensive Go-based web application framework that combines server-side rendering, client-side reactivity, and API services (REST/gRPC) in a single cohesive stack.
-
Multi-Protocol Support
- REST API Server (
/api/rest
) - gRPC Server (
/api/rpc
) - Web Application Server (
/api/web
)
- REST API Server (
-
Web Stack
- Server-Side Rendering with templ
- Enhanced interactivity with HTMX
- Lightweight client-side reactivity using Petite Vue (6kb)
-
Embedable Applications
- Utilize Go's
embed
feature for serving static assets - Support for multiple web applications (e.g., main app, admin panel)
- Utilize Go's
graph TD
A[Main Application] --> B[API Layer]
B --> C[REST API]
B --> D[gRPC API]
B --> E[Web Application]
E --> F[Templates]
E --> G[Static Assets]
E --> H[Handlers]
F --> I[templ Engine]
G --> J[JavaScript/CSS]
H --> K[HTTP Routes]
subgraph "Embedded Applications"
L[Admin Panel]
M[Other Apps...]
end
A --> L
A --> M
graph LR
A[Web Request] --> B{Route Type}
B -->|Full Page| C[Server-Side Rendering]
B -->|Dynamic Update| D[HTMX Request]
B -->|Client Interaction| E[Petite Vue]
C --> F[templ Templates]
D --> G[Partial HTML]
E --> H[Reactive Components]
subgraph "Server-Side"
F
G
end
subgraph "Client-Side"
H -->|Local State| I[6kb Vue Runtime]
H -->|User Events| J[DOM Updates]
end
webstack/
├── api/
│ ├── rest/ # REST API server
│ ├── rpc/ # gRPC server
│ ├── web/ # Main web application
│ └── admin/ # Admin panel (example additional web app)
-
Clone the repository
-
Install dependencies:
make setup
This will install both Go and Node.js dependencies.
-
Build and run:
# Build the application make build # Run the application make run
-
Development mode:
# Watch JavaScript changes make js-watch # Run the application make run
For detailed development instructions and guidelines, see COPILOT-INSTRUCTIONS.md.