Skip to content

Latest commit

ย 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŒน Virtual Rose Garden

Go Version Fiber Three.js WebSocket Tailwind CSS SQLite Render

๐ŸŒน 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!

โœจ Features

3D Garden Experience

  • 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

Real-time Collaboration

  • 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

Plant Your Rose

  • 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

๐Ÿš€ Quick Start

Clone and run:

git clone https://github.com/smart-developer1791/go-virtual-rose-garden
cd go-virtual-rose-garden

Initialize and start:

go mod tidy
go run .

Open http://localhost:3000 ๐ŸŒน

๐Ÿ›  Tech Stack

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

๐Ÿ“ Project Structure

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

๐ŸŒ API Endpoints

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)

POST /api/roses Body

{
  "message": "I love you",
  "author": "Valentine",
  "x": 2.5,
  "z": -1.3,
  "color": "#e11d48"
}

WebSocket Messages

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

๐ŸŽจ Rose Colors

Color Hex
Classic Red #e11d48
Bright Rose #f43f5e
Deep Red #be123c
Light Pink #fb7185
Burgundy #9f1239
Blush #fda4af
Hot Pink #f472b6
Magenta #ec4899

๐ŸŽฎ Controls

Action Result
Click on ground Open plant modal
Drag Rotate camera
Scroll Zoom in/out
Hover on rose Show message tooltip

๐Ÿ’พ Database Schema

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
);

๐ŸŒ™ Visual Effects

  • 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

๐Ÿ’• Valentine's Day 2026

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

โšก Performance

  • Three.js with ES modules (no build)
  • Efficient WebSocket broadcasting
  • SQLite for lightweight persistence
  • Optimized particle systems
  • Shadow map caching

Deploy in 10 seconds

Deploy to Render

About

๐ŸŒน Real-time 3D rose garden with WebSocket. Plant roses with love messages, visible to everyone instantly. Go Fiber + Three.js + SQLite. Valentine 2026!

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages