Skip to content

stackcurious/worldvibe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

69 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

WorldVibe

Live at: worldvibe.app

A global emotional check-in platform where users submit one anonymous check-in daily, and we visualize the world's mood in real-time through an interactive 3D globe.

✨ Features

  • πŸ”’ Privacy-First: Ephemeral tokens, region hashing, no personal identifiers
  • 🌍 Interactive Globe: Real-time 3D visualization of global emotional data
  • 🎨 Emotion Avatars: Unique visual representations for each emotional state
  • πŸ“Š Live Analytics: Real-time dashboard showing global mood trends
  • πŸ”„ Daily Check-ins: One anonymous emotional check-in per user, per day
  • 🎭 8 Core Emotions: Joy, Love, Surprise, Sadness, Fear, Anger, Disgust, Neutral
  • πŸ“± Responsive Design: Seamless experience across desktop and mobile
  • ⚑ Real-time Updates: WebSocket-powered live data streaming

πŸš€ Quick Start

Development (SQLite - Simplest)

# Install dependencies
npm install

# Start the app with SQLite
npm run dev:sqlite

This automatically creates a SQLite database, seeds sample data, and starts the dev server.

Production Database (Supabase PostgreSQL)

# Install dependencies
npm install

# Set up environment variables
cp .env.example .env
# Edit .env with your Supabase credentials

# Run development server
npm run dev

πŸ› οΈ Tech Stack

  • Framework: Next.js 14.0.3 (App Router)
  • Language: TypeScript
  • Database: Supabase PostgreSQL (Production), SQLite (Development)
  • ORM: Prisma
  • Styling: Tailwind CSS
  • Animations: Framer Motion
  • 3D Visualization: react-globe.gl, Three.js
  • Analytics: Vercel Analytics, Google Analytics
  • Deployment: Vercel
  • Real-time: WebSockets

πŸ“ Project Structure

worldvibe/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ app/                    # Next.js App Router pages
β”‚   β”‚   β”œβ”€β”€ api/                # API routes
β”‚   β”‚   β”œβ”€β”€ checkin/            # Check-in flow
β”‚   β”‚   β”œβ”€β”€ globe/              # Interactive globe view
β”‚   β”‚   └── about/              # About page
β”‚   β”œβ”€β”€ components/             # React components
β”‚   β”‚   β”œβ”€β”€ layout/             # Header, footer, etc.
β”‚   β”‚   β”œβ”€β”€ ui/                 # Reusable UI components
β”‚   β”‚   β”œβ”€β”€ visualization/      # Globe, charts, etc.
β”‚   β”‚   └── notifications/      # Toast notifications
β”‚   β”œβ”€β”€ lib/                    # Core libraries
β”‚   β”‚   β”œβ”€β”€ db/                 # Database clients
β”‚   β”‚   β”œβ”€β”€ privacy/            # Privacy utilities
β”‚   β”‚   └── realtime/           # WebSocket handling
β”‚   β”œβ”€β”€ services/               # Business logic
β”‚   β”‚   β”œβ”€β”€ check-in-service.ts
β”‚   β”‚   β”œβ”€β”€ analytics-service.ts
β”‚   β”‚   └── region-service.ts
β”‚   └── types/                  # TypeScript types
β”œβ”€β”€ prisma/
β”‚   └── schema.prisma           # Database schema
β”œβ”€β”€ scripts/                    # Utility scripts
└── public/                     # Static assets

πŸ”§ Available Scripts

Development

npm run dev              # Standard Next.js development
npm run dev:sqlite       # Development with SQLite
npm run dev:safe         # Development with DB checks
npm run dev:seed         # Development with DB setup and seeding

Database

npm run db:setup         # Initialize database with schema
npm run db:check         # Verify database connectivity
npm run db:test          # Test database functionality

Quality Checks

npm run lint             # ESLint
npm run type-check       # TypeScript check
npm run format           # Prettier formatting
npm run test             # Run unit tests

Production

npm run build            # Production build
npm run start            # Start production server

🌐 Deployment

The app is deployed on Vercel at worldvibe.app.

Environment Variables (Vercel)

Required:

DATABASE_URL=postgresql://...              # Supabase connection string
NEXT_PUBLIC_APP_URL=https://worldvibe.app  # Production URL

Optional:

NEXT_PUBLIC_GA_MEASUREMENT_ID=G-XXXXXXXXXX  # Google Analytics

Pre-push Hook

Husky pre-push hook automatically runs ESLint and TypeScript checks before pushing to prevent deployment failures:

# Located in .husky/pre-push
npm run lint
npm run type-check

πŸ“Š Database

Production: Supabase PostgreSQL

  • Session pooler connection on port 5432
  • 8 tables: check_ins, analytics, sessions, events, privacy_consents, rate_limits, realtime_stats, base_model
  • Automatic connection pooling and health monitoring

Development: SQLite

  • Local file-based database
  • Same schema as PostgreSQL for compatibility
  • Automatic seeding with sample data

See DATABASE_SETUP.md for detailed database documentation.

🎨 Key Features

Interactive Globe

  • 3D Earth visualization using react-globe.gl
  • Real-time emotional data points from global check-ins
  • Hover interactions showing location and emotion details
  • Ambient lighting and atmosphere effects

Emotion System

  • 8 core emotions with unique color schemes and avatars
  • Joy (Yellow), Love (Pink), Surprise (Purple), Sadness (Blue)
  • Fear (Dark Purple), Anger (Red), Disgust (Green), Neutral (Gray)
  • Each emotion has a custom-designed avatar character

Privacy Architecture

  • Device fingerprinting without personal data
  • Regional data anonymization (no exact coordinates)
  • Automatic data retention policies
  • No user accounts or authentication required

Analytics

  • Global emotion distribution
  • Real-time check-in counts
  • Geographic emotion mapping
  • Trend analysis over time

πŸ” Security

  • Content Security Policy (CSP) headers
  • X-Frame-Options, X-XSS-Protection
  • No personal identifiers stored
  • Anonymous check-ins only
  • Rate limiting on API endpoints

πŸ“– Documentation

🀝 Contributing

Pull requests welcome! Please ensure:

  1. ESLint and TypeScript checks pass
  2. Tests are updated/added for new features
  3. Follow existing code style and conventions

The pre-push hook will automatically validate your code before pushing.

πŸ“ License

MIT


Built with ❀️ for understanding global emotions

About

Vibe of the world

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •