Skip to content

Latest commit

ย 

History

History
147 lines (115 loc) ยท 4.39 KB

File metadata and controls

147 lines (115 loc) ยท 4.39 KB

๐ŸŒธ Sakura Dreams โ€” Japanese 3D Authentication

Go Fiber SQLite Tailwind Alpine.js Render

๐ŸŽŒ Tranquil Japanese cherry blossom authentication with falling petals, moonlit night, floating lanterns, and zen garden aesthetics. Fully responsive design!

โœจ Features

  • ๐ŸŒ™ Moonlit Night Sky โ€” Glowing moon with crater details
  • ๐ŸŒธ Falling Sakura Petals โ€” Dynamic CSS-animated cherry blossoms
  • ๐Ÿฎ Floating Lanterns โ€” Traditional Japanese paper lanterns
  • ๐ŸŽ Koi Pond โ€” Water ripples with swimming koi fish
  • ๐ŸŽ‹ Cherry Blossom Branches โ€” Decorative sakura tree elements
  • โœจ 3D Glassmorphism Cards โ€” Subtle breathing animations
  • โšก Real-time Validation โ€” Async field validation via API
  • ๐Ÿ” Secure Auth โ€” bcrypt password hashing
  • ๐Ÿ“ง Email Auth โ€” Login and register with email
  • ๐Ÿ’ช Password Strength Meter โ€” Visual strength indicator
  • ๐Ÿ“ฑ Fully Responsive โ€” Mobile-first design
  • ๐Ÿš€ Zero Page Reloads โ€” All errors handled via AJAX

๐Ÿ›  Tech Stack

Layer Technology
Backend Go 1.21+ with Fiber v2
Database SQLite (Pure Go, no CGO)
ORM GORM
Frontend Alpine.js 3.x
Styling Tailwind CSS 3.x
Auth bcrypt + Sessions

๐Ÿš€ Quick Start

Clone and run:

git clone https://github.com/smart-developer1791/go-fiber-auth-sakura
cd go-fiber-auth-sakura

Initialize and start:

go mod tidy
go run .

Open http://localhost:3000

๐Ÿ”‘ Demo Account

Field Value
Email demo@sakura.app
Password demo1234

๐Ÿ“ Project Structure

go-fiber-auth-sakura/
โ”œโ”€โ”€ main.go              # Fiber server, routes, handlers
โ”œโ”€โ”€ templates/
โ”‚   โ”œโ”€โ”€ login.html       # Email login with sakura theme
โ”‚   โ”œโ”€โ”€ register.html    # Email registration
โ”‚   โ””โ”€โ”€ dashboard.html   # Responsive zen dashboard
โ”œโ”€โ”€ sakura_auth.db       # SQLite database (auto-created)
โ”œโ”€โ”€ render.yaml          # Render deployment config
โ””โ”€โ”€ README.md

๐ŸŽจ Visual Elements

Sakura Petals

  • 35 petals on desktop, 20 on mobile
  • Unique fall trajectories with sway
  • Random sizes and animation delays
  • Soft pink gradient colors with glow

Moon

  • Radial gradient for 3D effect
  • Crater details via pseudo-elements
  • Pulsing glow animation
  • Responsive sizing

Koi Fish

  • Swimming animation across pond
  • Orange-gold gradient
  • Hidden on mobile for performance

Lanterns

  • Floating animation
  • Warm glow effect
  • Responsive visibility

๐Ÿ”’ Security Features

  • bcrypt password hashing (cost 10)
  • HTTP-only session cookies
  • Server-side validation
  • SQL injection protected via GORM
  • XSS protected via template escaping

๐Ÿ“ฑ Responsive Design

  • Mobile-first approach
  • Adaptive petal count (20 mobile / 35 desktop)
  • Collapsible header elements
  • Touch-friendly inputs
  • Optimized animations for mobile

๐ŸŒ API Endpoints

Method Endpoint Description
GET / Redirect to /login
GET /login Login page
POST /api/login Authenticate user
GET /register Registration page
POST /api/register Create account
POST /api/validate/email Check email available (register)
POST /api/validate/email-exists Check email exists (login)
GET /dashboard Protected dashboard
POST /logout End session

๐ŸŽฏ Dependencies

github.com/glebarez/sqlite
github.com/gofiber/fiber/v2
github.com/gofiber/fiber/v2/middleware/logger
github.com/gofiber/fiber/v2/middleware/session
github.com/gofiber/template/html/v2
golang.org/x/crypto
gorm.io/gorm

Deploy in 10 seconds

Deploy to Render