# Best Homepage Ever (BHE) - LLM Context File ## Project Overview Best Homepage Ever is a customizable homepage application serving thousands of daily users. It provides a personalized dashboard with widgets, weather information, financial data, and productivity tools, all with a focus on speed and dark theme UX. **Current Version**: 3.8.4 (client), 3.1.4 (server) **Status**: Production-ready, actively maintained **Users**: 50,000+ daily active users **Domain**: Production hosted on 74.208.51.207 ## Tech Stack & Architecture ### Frontend (client/) - **Framework**: Vue 3.5.18 + TypeScript + Vite - **UI Library**: Vuetify 3.9.5 (Material Design) - **State Management**: Pinia stores - **Development Port**: http://localhost:8081 → http://localhost:3005 - **Build Tool**: Vite with HMR, PWA support ### Backend (server/) - **Runtime**: Node.js + Express.js - **Database**: MongoDB (development: localhost:27017/bhe, production: Atlas) - **Caching**: Redis (session management, API caching) - **Process Manager**: PM2 with clustering - **External APIs**: OpenAI, Alpha Vantage (stocks), Google Places, Weather APIs ### Infrastructure - **Production**: PM2 process named "BHE" - **CDN**: Cloudflare - **Authentication**: JWT with refresh tokens - **File Storage**: AWS S3 for user uploads ## Project Structure ``` besthomepageever/ ├── client/ # Vue 3.5 frontend application │ ├── src/ │ │ ├── components/ # Reusable UI components │ │ ├── pages/ # Page-level components │ │ ├── stores/ # Pinia state management │ │ ├── widgets/ # Widget-specific components │ │ └── icons/ # Custom SVG icon components │ ├── public/ # Static assets │ └── package.json # Frontend dependencies ├── server/ # Node.js backend │ ├── routes/ # Express API endpoints │ ├── models/ # MongoDB schemas (Mongoose) │ ├── utils/ # Helper functions and utilities │ ├── config/ # Database and environment config │ └── package.json # Backend dependencies ├── docs/ # Project documentation │ ├── HOMEPAGE_DEVELOPMENT.md # Main development guide │ ├── DEPLOYMENT_GUIDE.md # Production deployment │ ├── FINANCIAL_DASHBOARD_GUIDE.md # Stock features │ └── Justins/ # Personal developer notes └── updates/ # Update tracking and changelogs ``` ## Core Features & Components ### Widget System - **Widgets.vue**: Main grid display with drag-and-drop functionality - **WidgetsModal.vue**: Add/edit widget dialog interface - **Widget Types**: Default websites, custom user sites, productivity tools - **Management**: Full CRUD operations, drag-and-drop reordering ### User Customization - **Backgrounds**: Image uploads, color selection, auto-rotation - **Display Settings**: Dark mode (primary), navbar visibility, auto-hide - **Search Integration**: Multiple engines (Google, Bing, DuckDuckGo, Brave) - **Personalization**: Widget sizing, title display, layout preferences ### Weather System - **WeatherWidget.vue**: Smart location-based weather display - **Location Sources**: Geolocation API, Google Places API custom selection - **Data Flow**: Always fetch Fahrenheit → frontend unit conversion - **Backend**: `/server/routes/weather.js` with Redis caching (30min TTL) - **User Experience**: Permission-based, no preload, modal-aware visibility ### Financial/Stock Features - **Stock Market Integration**: Real-time quotes via Alpha Vantage API - **Mortgage Rates**: Current market rates display - **Performance Optimization**: Intelligent caching, bulk API calls - **Rate Limiting**: User activity-based refresh intervals ### Account System - **Authentication**: JWT-based with automatic refresh - **User Profiles**: Name, country, profile pictures, ranking system - **Settings Sync**: Cross-device synchronization via database - **Notes System**: Personal note-taking with full CRUD operations ## Database Schema (MongoDB) ### Primary Collections - **users**: User accounts with embedded settings, widgets, notes - Fields: email, firstName, lastName, password, profilePicture, rank - Embedded: settings (backgrounds, display, search, widgets) - **tickets**: Support system with notification integration - **notifications**: User notifications with Redis caching - **openais**: OpenAI chat integration records ### User Ranks - **0**: Basic User (default) - **1**: Admin/Owner (full system access) ## Development Guidelines ### Code Patterns - **Vue Components**: `