How ligmajohn/mw works
Main Components
• Frontend Application:
• Located under the “src” folder, this includes React pages (in src/pages), UI components (in src/components), hooks (in src/hooks), and state management (in src/stores).
• Assets, styling (CSS, Tailwind), and themes are present to supply the visual and localization aspects.
• Optional Backend Services:
• Found in src/backend, these include modules for accounts (authentication, sessions, registration), metadata fetching (TMDB, JustWatch, etc.), and extension-related tasks (scraping, proxying, and messaging).
• Public / Static Files:
• The public folder holds index.html, configuration files, and static resources used by the client.
• Build & Deployment Infrastructure:
• Dockerfile, docker-compose.yaml, Vite configuration, GitHub workflows, and other config files indicate containerized deployment and CI/CD pipelines.
• Plugins and Configuration Utilities:
• The plugins folder (with utilities like converting figmaTokens to theme tokens) and various config files (.eslintrc.js, postcss.config.js, tailwind.config.ts, etc.) show important integration and standardization of coding practices.
Relationships and Interactions
• The Frontend (UI) initiates user interactions:
• It uses the pages and components to load various views (home, player view, login, settings, etc.).
• Custom hooks and state management (in stores) handle dynamic UI states, data fetching, and authentication.
• The Frontend communicates with the Optional Backend:
• Endpoints under src/backend/accounts provide session and account-related functionality.
• Metadata endpoints under src/backend/metadata provide movie-related data by scraping or interfacing with third-party APIs.
• Communication might be via REST or similar API patterns.
• Integration with Third-Party Providers:
• The architecture emphasizes that video content is not hosted on the server; instead, the client directly streams from third-party providers.
• The backend assists with scraping and data fetching, but the flow of video content bypasses the server to ensure minimal resource usage.
• External Services & Deployment:
• CI/CD and container orchestration (via Docker, GitHub workflows) ensure that the system can be built, tested, and deployed in predictable environments.
• The self-hosting documentation shows that by using Docker and static hosting, deployments remain inexpensive and scalable.
Architectural Patterns and Principles
• Minimalism and Separation of Concerns:
• The design emphasizes a “thin” backend for authentication and data aggregation, keeping the client as a fully static optimized application.
• Modular Architecture:
• The clear separation between UI components (React), state management (stores), and backend modules (accounts, metadata, extension) allows for easier scalability and maintenance.
• Client-Side Data Fetching:
• The use of client-side scraping to fetch video streams shows that the business logic is mostly in the browser, with the backend supporting only syncing and minimal proxying.
• Containerized and CI/CD Deployments:
• Docker and GitHub workflows underline the modern DevOps practices integrated into the project.
• Every module is represented—even if not every file is drawn, create a high-level component for each logical grouping (e.g., “Player Components,” “Account Management Module,” “Metadata Fetcher”).
• Separation of concerns, particularly the minimalist design of the frontend versus the optional backend services meant for synchronization.
• Remember to include deployment infrastructure as it is crucial for understanding how the application is built and hosted.