A modern React frontend application for the Shared Media Streaming platform, built with atomic design principles and following MVC/MVVM patterns.
src/
βββ ui/ # Atomic design system
β βββ atoms/ # Basic building blocks (Button, Input, Label)
β βββ molecules/ # Simple combinations (FormField, MediaCard)
β βββ organisms/ # Complex components (Navbar, MediaGrid)
β βββ templates/ # Page layouts (DashboardLayout, AuthLayout)
β βββ pages/ # Full page components (HomePage)
βββ features/ # Feature-based grouping
β βββ auth/ # Authentication features
β βββ dashboard/ # Dashboard features
β βββ media/ # Media management features
βββ app/ # Application setup
β βββ providers/ # Context providers
β βββ routes/ # Routing configuration
β βββ store/ # State management
βββ services/ # API and external services
βββ hooks/ # Custom React hooks
βββ utils/ # Utility functions
βββ types/ # TypeScript type definitions
- Atomic Design: Systematic approach to building design systems
- MVC/MVVM: Separation of concerns between data, logic, and presentation
- Component Composition: Reusable, composable UI components
- Custom Hooks: Encapsulated logic for state management
- User Authentication: Login, registration, and session management
- Media Management: Upload, view, and manage audio/video files
- Real-time Sync: Collaborative viewing with Socket.IO integration
- Responsive Design: Mobile-first, accessible interface
- TypeScript: Full type safety and better developer experience
- React Router: Client-side routing with protected routes
- Context API: State management without external libraries
- Axios: HTTP client with interceptors and error handling
- Form Validation: Client-side validation with error handling
- Framework: React 19 with TypeScript
- Routing: React Router DOM
- HTTP Client: Axios
- Build Tool: Vite
- Package Manager: npm/pnpm
- Styling: CSS with BEM methodology (layout only, no visual styling)
-
Clone the repository
git clone <repository-url> cd shared-media-streaming/apps/frontend
-
Install dependencies
npm install # or pnpm install -
Set up environment variables
cp env.example .env.local # Edit .env.local with your configuration -
Start development server
npm run dev # or pnpm dev
npm run dev- Start development servernpm run build- Build for productionnpm run preview- Preview production buildnpm run lint- Run ESLint
- Atoms: Basic HTML elements (Button, Input, Label)
- Molecules: Simple combinations (FormField, MediaCard)
- Organisms: Complex components (Navbar, MediaGrid)
- Templates: Page layouts (DashboardLayout, AuthLayout)
- Pages: Full page components (HomePage)
- Use TypeScript interfaces for all props
- Implement proper accessibility attributes
- Follow BEM CSS methodology
- Keep components focused and single-purpose
- Use custom hooks for complex logic
- Use React Context for global state (auth, user)
- Use local state for component-specific data
- Use custom hooks for reusable state logic
- Avoid prop drilling with proper context usage
- Create the component file in the appropriate atomic design folder
- Define TypeScript interfaces for props
- Implement the component with proper accessibility
- Add CSS classes following BEM methodology
- Create an index file for easy imports
- Update the main UI index file
- Create feature folder in
src/features/ - Add components, hooks, and services as needed
- Update routing in
AppRoutes.tsx - Add to navigation if needed
- Update types in
src/types/
The frontend is configured to work with the following backend endpoints:
- Authentication:
/api/auth/* - Media:
/api/media/* - Users:
/api/users/*
- Base URL: Configurable via environment variables
- Authentication: JWT tokens with automatic refresh
- Error Handling: Centralized error handling with user feedback
- Interceptors: Automatic token injection and refresh logic
- BEM Methodology: Block, Element, Modifier naming convention
- Layout-First: CSS focuses on structure, not visual styling
- Responsive Design: Mobile-first approach with CSS Grid and Flexbox
- Accessibility: Proper focus states and screen reader support
- Each component has its own CSS classes
- Classes follow BEM naming convention
- No external CSS frameworks or libraries
- Minimal styling for rapid UI development
- Unit Tests: Individual component testing
- Integration Tests: Feature workflow testing
- E2E Tests: Full user journey testing
npm run test # Run unit tests
npm run test:watch # Run tests in watch mode
npm run test:coverage # Run tests with coverage- Mobile: < 768px
- Tablet: 768px - 1024px
- Desktop: > 1024px
- CSS written for mobile devices first
- Progressive enhancement for larger screens
- Touch-friendly interface elements
- Optimized for mobile performance
- WCAG 2.1 AA: Web Content Accessibility Guidelines
- ARIA Labels: Proper screen reader support
- Keyboard Navigation: Full keyboard accessibility
- Focus Management: Clear focus indicators
- Semantic HTML elements
- Proper heading hierarchy
- Alt text for images
- Form labels and error messages
- Screen reader announcements
- Production Build:
npm run build - Static Files: Generated in
dist/folder - Deployment: Deploy
dist/contents to web server
- Development:
.env.localfor local development - Production: Environment variables set on deployment platform
- Build-time: Vite replaces environment variables during build
- Feature Branch: Create branch from
main - Development: Implement feature following guidelines
- Testing: Ensure all tests pass
- Code Review: Submit pull request for review
- Merge: After approval and CI checks pass
- TypeScript: Strict type checking enabled
- ESLint: Code quality and consistency
- Prettier: Code formatting (if configured)
- Git Hooks: Pre-commit checks (if configured)
This project is part of the Shared Media Streaming platform. See the main repository for license information.
For questions or issues:
- Check the documentation
- Search existing issues
- Create a new issue with detailed information
- Contact the development team
Note: This frontend is designed to work with the corresponding backend API. Ensure the backend is running and properly configured before testing frontend functionality.