How erickmontesdk/opus-cinemas works
Main components
• Frontend (Client-Side): Represent the “public” folder. This includes:
• HTML pages (e.g., home, about, film-info, payment, etc.)
• CSS files for UI styling.
• JavaScript modules found in “public/js” which manage API calls (to email service, Movieglu, Supabase) and handle features like QR code generation and seat selection.
• Backend (Serverless Functions): Located in “netlify/functions”. These modules encapsulate the business logic for:
• Handling requests related to auditoriums, films, movie schedules, ticket sales, and email services.
• Performing CRUD operations via Node.js-based services.
• Database: Supabase is used for persistent storage. Note the presence of:
• Migration scripts in the “migrations” directory (“createSupabaseElements.js” and “initialMigration.sql”), which set up the necessary tables and functions.
• External Services:
• MovieGlu API – The application integrates with this API for movie metadata.
• Email services invoked through the API functions.
Relationships and interactions
• The client’s browser loads static assets (HTML, CSS, JS) from the “public” folder. When user interactions require dynamic data or processing (like movie schedule queries or ticket purchases), the frontend JavaScript makes API calls.
• These API calls are directed towards the serverless functions deployed via Netlify. The functions process the requests by:
• Querying or updating data in the Supabase database.
• Consuming external APIs like MovieGlu for real-time movie information.
• Migrations scripts are used during the initial application setup or upgrades to prepare and update the database schema.
Architectural patterns and design principles
• Serverless/Function-as-a-Service: Instead of a monolithic backend, the project leverages Netlify’s serverless functions, making scaling and deployments lightweight.
• Separation of Concerns: The clear separation between the frontend (static assets) and backend (API logic) ensures that UI and business logic remain modular.
• Integration Patterns: Explicit integration with third-party services (like MovieGlu) and managed databases (Supabase) are ideal for modular expansion and easier maintenance.
Relevant technologies and libraries
• Node.js for backend functions.
• Netlify for serverless deployments and CI/CD.
• Supabase for database and authentication.
• MovieGlu API for movie information.
• Standard HTML/CSS/JavaScript for the UI.