๐น Real-time 3D rose garden where everyone can plant a rose with a love message. All visitors see all roses bloom instantly via WebSocket. Perfect for Valentine's Day 2026!
- Three.js Rendering โ Beautiful 3D rose garden with realistic lighting
- Procedural Roses โ Each rose is uniquely generated with petals, stem, and leaves
- Bloom Animation โ Roses grow and bloom with elastic animation
- Fireflies โ Ambient particles floating in the garden
- Grass Particles โ Ground covered with grass-like particles
- OrbitControls โ Rotate and zoom the camera
- WebSocket Sync โ New roses appear instantly for all visitors
- Persistent Storage โ SQLite database saves all roses
- Live Counter โ See total roses in the garden
- Connection Status โ Visual indicator for WebSocket connection
- Click to Plant โ Click anywhere on the ground to plant
- Custom Message โ Write a love message (up to 200 characters)
- Author Name โ Optional name or anonymous
- Color Selection โ Choose from 8 rose colors
- Hover Tooltips โ See messages when hovering over roses
Clone and run:
git clone https://github.com/smart-developer1791/go-virtual-rose-garden
cd go-virtual-rose-gardenInitialize and start:
go mod tidy
go run .Open http://localhost:3000 ๐น
| Layer | Technology |
|---|---|
| Backend | Go 1.21+, Fiber v2 |
| Real-time | WebSocket (Fiber) |
| Database | SQLite + GORM (Pure Go) |
| 3D Engine | Three.js r160 |
| Frontend | Alpine.js 3.x, Tailwind CSS |
| Fonts | Playfair Display, Quicksand |
go-virtual-rose-garden/
โโโ main.go # Server, WebSocket, API
โโโ go.mod # Dependencies
โโโ render.yaml # Deploy config
โโโ .gitignore
โโโ README.md
โโโ templates/
โโโ index.html # 3D garden app
| Method | Path | Description |
|---|---|---|
| GET | / |
Main garden page |
| GET | /api/roses |
Get all roses |
| POST | /api/roses |
Plant a new rose |
| GET | /api/stats |
Garden statistics |
| WS | /rose-ws |
Primary WebSocket endpoint used by the web app |
| WS | /ws |
Legacy compatibility endpoint (same behavior) |
{
"message": "I love you",
"author": "Valentine",
"x": 2.5,
"z": -1.3,
"color": "#e11d48"
}| Type | Direction | Data |
|---|---|---|
all_roses |
Server โ Client | Array of all roses on connect |
new_rose |
Server โ Client | New rose object when planted |
ping |
Client โ Server | Keep-alive ping |
pong |
Server โ Client | Keep-alive response |
| Color | Hex |
|---|---|
| Classic Red | #e11d48 |
| Bright Rose | #f43f5e |
| Deep Red | #be123c |
| Light Pink | #fb7185 |
| Burgundy | #9f1239 |
| Blush | #fda4af |
| Hot Pink | #f472b6 |
| Magenta | #ec4899 |
| Action | Result |
|---|---|
| Click on ground | Open plant modal |
| Drag | Rotate camera |
| Scroll | Zoom in/out |
| Hover on rose | Show message tooltip |
CREATE TABLE roses (
id INTEGER PRIMARY KEY AUTOINCREMENT,
message TEXT NOT NULL,
author TEXT DEFAULT 'Anonymous',
x REAL NOT NULL,
z REAL NOT NULL,
color TEXT DEFAULT '#e11d48',
scale REAL DEFAULT 1.0,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP
);- Moonlight โ Directional light with soft shadows
- Pink Glow โ Point light adding romantic atmosphere
- Warm Light โ Secondary point light for depth
- Fog โ Exponential fog for depth effect
- Fireflies โ Animated glowing particles
- Rose Sway โ Gentle swaying animation
Plant a rose for someone special! Every rose in the garden carries a message of love, visible to everyone who visits.
"A single rose can be my garden... a single friend, my world." โ Leo Buscaglia
- Three.js with ES modules (no build)
- Efficient WebSocket broadcasting
- SQLite for lightweight persistence
- Optimized particle systems
- Shadow map caching