How emanuelchristo/movie-night works
Main Components
• Frontend Framework: Nuxt.js – This provides SSR, file-based routing (pages directory), Vue components, and middleware.
• Pages: Located in the pages/ directory (e.g., index.vue, _room.vue, createroom.vue, joinroom.vue). These represent the different views like landing, room creation, and join room.
• Layouts: Found in layouts/ – For example, landing.vue sets up different page templates.
• Components: The components/ directory hosts reusable UI components such as AudioBar, Avatar, Controls, etc., and modals specialized for editing and inviting.
• Store: Vuex store (store/index.js) handles state management. This is essential for synchronizing UI state, video progress, and user interactions.
• Plugins: Several plugins (e.g., socket-io.js for real-time socket connections, vue-plyr.js for video playback enhancements, srt-webvtt.js for subtitles) extend the functionality.
Relationships and Interactions
• The Nuxt.js framework glues together the pages, layouts, and components. Page components (from the pages/) import and render the UI elements from components/.
• Vuex (store/) acts as the central hub for state management across the different pages and components.
• Plugins integrate external libraries: for instance, the socket-io.js plugin is likely used to establish a real-time connection with the backend (as suggested by the SERVER_URL environment variable), which drives live updates.
• The middleware directory might manage route guards or other cross-cutting concerns within the app.
Architectural Patterns
• Component-Based Architecture: Emphasizes reusability (the components folder) where UI elements and modals are modularized.
• Single-Page Application (SPA) with Nuxt routing: The pages directory reflects the different routes, and Nuxt’s SSR/SSG capabilities support both dynamic and static builds.
• State Management using Vuex: The store centralizes global state and synchronizes real-time updates.
• Plugin Architecture: External modular functionalities (socket connection, subtitle parsing, media handling) are encapsulated in plugins.
Relevant Technologies
• Nuxt.js/Vue.js for the overall framework
• Vuex for state management
• Plugins like socket-io for real-time data, vue-plyr for video playback, and srt-webvtt for subtitle support
• SCSS for styling (assets/css)
• Middleware for route handling and potentially for security or session management
Summarize the Architecture Visually
• At the top, have a “Client/User” block initiating actions.
• Below that, have the “Frontend Application (Nuxt.js)” broken into:
– Pages (routing)
– Layouts (templates)
– Components (UI elements)
– Store (state management)
– Plugins (integration with external services)