A real-time emotion collection app that gathers one-word feelings from around the world and visualizes global sentiment with a beautiful glass-morphism interface.
- Daily Emotion Collection: Submit one word describing how you feel
- Real-time Global Stats: See what the world is feeling right now
- Device-Specific Privacy: Each device has its own submission cooldown (no cross-device lockouts)
- Smart Device Identification: Advanced fingerprinting ensures reliable device tracking
- Auto-Expiring Data: Submissions automatically expire after 24 hours
- Responsive Glass UI: Modern, Apple-inspired interface with liquid glass effects
- Color-Coded Emotions: Each emotion gets a unique color representation
- Live Updates: Real-time statistics with 15-second refresh intervals
- Node.js 20+
- npm 9+
- MongoDB (local or Atlas)
git clone <repo-url> worldfeel
cd worldfeel
npm installCreate environment files for both server and web apps:
# Server environment
cp apps/server/.env.example apps/server/.env
# Web environment
cp apps/web/.env.example apps/web/.envConfigure the environment variables:
# Server (.env)
MONGODB_URI=mongodb://localhost:27017/worldfeel
DAY_SALT_SECRET=your-32-character-secret-key
WEB_ORIGIN=http://localhost:3000
SUBMIT_COOLDOWN_SECONDS=3600 # 1 hour per device in production
# Web (.env)
VITE_API_BASE=http://localhost:8080/apinpm run dev # Start both server and web apps- Frontend: http://localhost:3000
- API: http://localhost:8080/api
worldfeel/
βββ apps/
β βββ server/ # Express API with MongoDB
β β βββ src/
β β βββ config/ # Environment and DB config
β β βββ models/ # Mongoose schemas
β β βββ routes/ # API endpoints
β β βββ utils/ # Crypto, validation helpers
β βββ web/ # React frontend with Vite
β βββ src/
β βββ app/ # App entry and routing
β βββ components/ # Reusable UI components
β βββ features/ # Page components
β βββ hooks/ # Custom React hooks
β βββ lib/ # Utilities and API clients
β βββ types/ # TypeScript definitions
βββ packages/
βββ shared/ # Shared types and validation
| Script | Purpose |
|---|---|
npm run dev |
Start development servers |
npm run build |
Build all packages |
npm run lint |
Lint all packages |
npm run lint:fix |
Fix linting issues |
npm run typecheck |
TypeScript checking |
npm run test |
Run all tests |
npm run depcheck |
Check for unused dependencies |
npm run tsprune |
Find unused exports |
- Framework: React 18 with TypeScript
- Build Tool: Vite for fast development
- Styling: Tailwind CSS with custom glass-morphism effects
- Routing: React Router for SPA navigation
- State Management: React hooks and context
- Device Identification: Advanced fingerprinting with localStorage backup
- Framework: Express.js with TypeScript
- Database: MongoDB with Mongoose ODM
- Security: Rate limiting, CORS, Helmet
- Validation: Zod schemas for runtime validation
- Caching: In-memory stats caching (5-second TTL)
- Device Tracking: Device-specific cooldown enforcement
- Types: Common TypeScript interfaces
- Validation: Zod schemas for API validation
- Utilities: Shared helper functions
- Use path aliases:
@components/,@lib/,@features/ - Group imports: external β internal aliased β relative β types
- Import types explicitly:
import type { Stats }
- Components: PascalCase (
UniversalBackground) - Hooks: camelCase with
useprefix (useStats) - Files: camelCase for utilities, PascalCase for components
- Strict TypeScript configuration
- Zod schemas for runtime validation
- Shared types in
packages/shared
- Framework: Vite
- Build Command:
npm run build - Output Directory:
dist
- Build Command:
npm run build - Start Command:
npm start - Environment: Production Node.js
- MongoDB Atlas (recommended)
- Whitelist
0.0.0.0/0for serverless deployments
GET /api/health- Health checkGET /api/public/emotion-of-the-day- Get current emotion and color of the dayGET /api/stats- Get global statistics (supportsyourWordanddeviceIdquery params)GET /api/color?word=<emotion>- Get color hex for a specific emotion
- Fork the repository
- Create a feature branch
- Make your changes
- Run all checks:
npm run lint && npm run typecheck && npm run test - Submit a pull request
This project is licensed under the MIT License.