A production-grade, enterprise-scale social media platform frontend built with Nuxt 4. Yapper delivers a Twitter-like experience with sophisticated architecture, real-time capabilities, and comprehensive feature modules following industry-leading design patterns and best practices.
Live Demo - Experience it live!
- Overview
- Features
- Architecture & Design Patterns
- Tech Stack
- System Design
- Project Structure
- Module Architecture
- Getting Started
- Available Scripts
- Testing
- Related Repositories
- Contributors
- License
Yapper Frontend is an enterprise-level social media application that showcases modern frontend architecture and engineering excellence. Built as a scalable, maintainable, and performant solution, it implements advanced design patterns and follows domain-driven design principles to handle complex business logic and user interactions.
- Enterprise-Scale Architecture - Modular, scalable design supporting rapid feature development
- Feature-Driven Development - Domain-driven modular organization
- Advanced State Management - Multi-layer state handling with global and module-specific stores
- Performance Optimized - Lazy loading, code splitting, and optimistic updates
- Type-Safe - Full TypeScript implementation for reliability
- Accessible - WCAG compliant with responsive design
- Production Ready - Docker support, CI/CD ready, and monitoring integrated
- Authentication & Authorization - Secure user authentication with reCAPTCHA integration
- Tweet Management - Create, edit, delete, like, and retweet posts with rich media
- Real-time Chat - Instant messaging powered by Socket.IO
- Live Notifications - Real-time notification system with WebSocket integration
- User Profiles - Comprehensive user profiles with customizable themes
- Advanced Search - Full-text search across users, tweets, and hashtags
- Bookmarks System - Save and organize favorite content
- Internationalization - Multi-language support (English & Arabic)
- Responsive Design - Mobile-first, fully responsive UI across all devices
- Theming System - Dynamic theme customization
- Media Management - Image and video uploads with optimized delivery
- Rich Content - Emoji picker, mentions, hashtags, and URL parsing
- Infinite Scrolling - Virtualized lists with pagination
- Media Lightbox - Full-screen media viewer with gestures
- Video Streaming - Integrated video player with controls
- Optimistic UI - Instant feedback with automatic rollback on errors
- Analytics Ready - Event tracking and user behavior monitoring
- Security First - XSS protection, CSRF tokens, and secure headers
Yapper Frontend implements a sophisticated architectural approach combining multiple enterprise design patterns:
A centralized service registry manages all API interactions, providing:
- Dependency Injection - Services are registered and injected where needed
- Single Responsibility - Each service handles one domain of business logic
- Testability - Easy mocking and testing of service layer
- Reusability - Services shared across modules without duplication
Implements TanStack Query for sophisticated data management:
- Caching Strategy - Intelligent cache invalidation and updates
- Optimistic Updates - Immediate UI feedback with automatic rollback
- Background Refetching - Keeps data fresh automatically
- Request Deduplication - Prevents unnecessary network calls
- Error Handling - Centralized error management and retry logic
Multi-tier state architecture using Pinia:
- Global Store - Application-wide state (auth, theme, settings)
- Module Stores - Feature-specific state management
- Computed State - Derived state with automatic reactivity
- Persistence - State hydration and persistence strategies
- DevTools Integration - Full debugging capabilities
Modular architecture organized by business domains:
- Module Autonomy - Self-contained feature modules
- Clear Boundaries - Well-defined interfaces between modules
- Shared Kernel - Common utilities and components
- Scalability - Easy to add new features without affecting existing code
- Team Collaboration - Multiple teams can work on different modules
Clean separation of concerns across layers:
┌─────────────────────────────────────────┐
│ Presentation Layer │
│ (Views, Components, Composables) │
├─────────────────────────────────────────┤
│ Application Layer │
│ (Stores, State Management) │
├─────────────────────────────────────────┤
│ Domain Layer │
│ (Business Logic, Services) │
├─────────────────────────────────────────┤
│ Infrastructure Layer │
│ (API Clients, Query Layer, Utils) │
└─────────────────────────────────────────┘
- Repository Pattern - Abstraction over data sources
- Factory Pattern - Dynamic component and service creation
- Observer Pattern - Event-driven communication via Socket.IO
- Facade Pattern - Simplified interfaces for complex subsystems
- Singleton Pattern - Single instance services and utilities
- Strategy Pattern - Pluggable algorithms for sorting, filtering, etc.
- Decorator Pattern - Middleware for API calls and route guards
- Nuxt 4 - The intuitive Vue framework for production
- Vue 3 - Progressive JavaScript framework with Composition API
- TypeScript - Type-safe development environment
- Tailwind CSS - Utility-first CSS framework
- Lucide Icons - Beautiful, consistent icon library
- Swiper - Modern mobile-first slider component
- Pinia - Intuitive, type-safe Vue store
- TanStack Query (Vue Query) - Powerful asynchronous state management
- Axios - Promise-based HTTP client with interceptors
- Socket.IO Client - Real-time bidirectional event-based communication
- VeeValidate - Form validation library
- Yup - Schema validation
- Vitest - Next generation testing framework
- Testing Library - Simple testing utilities
- ESLint - Pluggable linting utility
- Prettier - Opinionated code formatter
- Commitlint - Lint commit messages
- Husky - Git hooks made easy
- SonarQube - Code quality and security scanner
- @nuxtjs/i18n - Internationalization module
- Day.js - Lightweight date manipulation
- Twitter Text - Tweet text processing
- reCAPTCHA - Bot protection
- vue-virtual-scroller - Efficient list rendering
- Docker - Containerization platform
- Nginx - High-performance web server
- GitHub Actions - CI/CD automation
The architecture diagram above illustrates the comprehensive system design:
Commons Layer
- Global Store - Application-wide state management
- General Components - Reusable UI components
- Services & Utils - Shared business logic and utilities
- Types - TypeScript type definitions and interfaces
Module Architecture
- Views - Page-level components and routing
- High-order Components - Smart components with business logic
- Sub Components - Presentational components
- Module Store - Feature-specific state management
Backend Integration
- Services Layer - Business logic and API abstraction
- Query Layer - Data fetching, caching, and synchronization
For detailed information about system architecture, module interactions, and data flow, refer to the System Modules Diagrams PDF.
yapper-frontend/
├── app/
│ ├── modules/ # Feature modules (domain-driven)
│ │ ├── auth/ # Authentication module
│ │ │ ├── components/ # Module-specific components
│ │ │ ├── composables/ # Reusable composition functions
│ │ │ ├── queries/ # TanStack Query hooks
│ │ │ ├── services/ # API service layer
│ │ │ ├── stores/ # Pinia stores
│ │ │ ├── types/ # TypeScript definitions
│ │ │ └── views/ # Page components
│ │ ├── chat/ # Real-time messaging module
│ │ ├── timeline/ # Tweet feed module
│ │ ├── profile/ # User profile module
│ │ ├── notifications/ # Notification module
│ │ ├── search/ # Search & explore module
│ │ └── bookmarks/ # Bookmarks module
│ ├── pages/ # Nuxt pages (routing)
│ ├── layouts/ # Layout components
│ ├── components/ # Global shared components
│ ├── composables/ # Global composition functions
│ ├── plugins/ # Nuxt plugins
│ ├── middleware/ # Route middleware
│ ├── assets/ # Static assets
│ │ ├── css/ # Global styles
│ │ └── images/ # Images
│ └── lib/ # Core utilities
│ ├── api/ # API client configuration
│ ├── utils/ # Helper functions
│ └── constants/ # Application constants
├── i18n/ # Internationalization
│ ├── locales/ # Translation files
│ └── config.ts # i18n configuration
├── docker/ # Docker configuration
│ ├── Dockerfile
│ └── nginx.conf
├── tests/ # Test files
│ ├── unit/ # Unit tests
│ ├── integration/ # Integration tests
│ └── e2e/ # End-to-end tests
├── public/ # Public static files
├── nuxt.config.ts # Nuxt configuration
├── tailwind.config.ts # Tailwind configuration
├── tsconfig.json # TypeScript configuration
└── package.json # Dependencies and scripts
Each feature module follows a consistent structure ensuring maintainability and scalability:
module-name/
├── components/ # UI components specific to this module
│ ├── ModuleComponent.vue
│ └── NestedComponent.vue
├── composables/ # Composition API logic
│ ├── useModuleFeature.ts
│ └── useModuleState.ts
├── queries/ # TanStack Query definitions
│ ├── useModuleQuery.ts
│ ├── useModuleMutation.ts
│ └── queryKeys.ts
├── services/ # Business logic and API calls
│ ├── moduleService.ts
│ └── moduleApi.ts
├── stores/ # Pinia state management
│ └── moduleStore.ts
├── types/ # TypeScript interfaces
│ ├── module.types.ts
│ └── module.interfaces.ts
├── views/ # Page-level components
│ └── ModuleView.vue
├── utils/ # Module-specific utilities
│ └── moduleHelpers.ts
└── index.ts # Module exports
Services Layer
- API communication
- Business logic implementation
- Data transformation
- Error handling
Queries Layer
- Data fetching with caching
- Optimistic updates
- Background synchronization
- Query invalidation strategies
Stores Layer
- Module-specific state
- Computed properties
- Actions and mutations
- State persistence
Composables
- Reusable reactive logic
- Component lifecycle management
- Event handling
- UI state management
Components
- Presentational logic
- User interactions
- Accessibility features
- Responsive behavior
Views
- Page-level orchestration
- Route management
- Layout composition
- Data loading coordination
- Node.js 18.x or higher
- npm 9.x or yarn 1.22.x
- Git
# Clone the repository
git clone https://github.com/yourusername/yapper-frontend.git
# Navigate to project directory
cd yapper-frontend
# Install dependencies
npm install
# Set up environment variables
cp .env.example .env
# Edit .env with your configuration
# Run development server
npm run dev# API Configuration
NUXT_PUBLIC_API_BASE_URL=https://api.yapper.example.com
NUXT_PUBLIC_SOCKET_URL=wss://socket.yapper.example.com
# Authentication
NUXT_PUBLIC_RECAPTCHA_SITE_KEY=your_recaptcha_site_key
# Feature Flags
NUXT_PUBLIC_ENABLE_ANALYTICS=true
NUXT_PUBLIC_ENABLE_MOCK_SERVER=false# Development
npm run dev # Start development server
npm run dev:mock # Start with mock API server
# Building
npm run build # Build for production
npm run generate # Generate static site
npm run preview # Preview production build
# Testing
npm run test # Run unit tests
npm run test:watch # Run tests in watch mode
npm run test:coverage # Generate coverage report
npm run test:e2e # Run end-to-end tests
# Code Quality
npm run lint # Lint code
npm run lint:fix # Fix linting errors
npm run format # Format code with Prettier
npm run type-check # Check TypeScript types
# Analysis
npm run analyze # Analyze bundle size
npm run sonar # Run SonarQube analysisComprehensive testing strategy covering multiple levels:
npm run test- Component testing with Vue Test Utils
- Service layer testing
- Store testing with Pinia Testing
- Utility function testing
npm run test:integration- Module interaction testing
- API integration testing
- State management flow testing
npm run test:e2e- Complete user journey testing
- Cross-browser testing
- Accessibility testing
npm run test:coverageTarget: >80% code coverage across all modules
This frontend application is part of a larger ecosystem:
Repository: Coming Soon
Native mobile applications built with React Native for iOS and Android platforms, sharing the same backend infrastructure.
Repository: Coming Soon
RESTful API and WebSocket server built with Node.js/Nest.js, providing authentication, data persistence, real-time communication, and business logic for all client applications.
The complete Yapper platform consists of:
- Frontend Web App (This repository) - Nuxt 4 web application
- Mobile Apps - iOS and Android applications
- Backend API - Node.js REST API and WebSocket server
- Database - PostgreSQL for data persistence
- Redis - Caching and session management
- CDN - Media storage and delivery
- Monitoring - Application performance monitoring
| Name | Role | GitHub | |
|---|---|---|---|
| Ali Alaa | Frontend Developer | @AliAlaa88 | Profile |
| Amr Hany | Frontend Developer | @Amrhanysayed | Profile |
| Abdallah Ahmed | Frontend Developer | @Safan05 | Profile |
| Abdelrahman Medhat Saber | Frontend Developer | @bedosaber77 | Profile |
| Hagar Abdelsalam | Frontend Developer | @hagar3bdelsalam | Profile |
| Esraa Hassan | QA Engineer | @Esraa-Hassan0 | Profile |
This project is licensed under the MIT License - see the LICENSE file for details.
Built with ❤️ by the Yapper Team
For questions, issues, or contributions, please visit our GitHub Issues page.