How marvin3312/cartelera-vue works
Project Type and Purpose
• This is a frontend‐only, single‐page application (SPA) built with Vue.js (CLI scaffold).
• It displays and searches a movie “cartelera” (listing), leveraging an API client to fetch movie data.
Main Components to Illustrate
a. User’s Browser (Client)
b. Web Server / Static Hosting (e.g., nginx, Netlify, GitHub Pages)
c. Vue.js Application
• Entry Point: public/index.html → src/main.js → mounts App.vue
• Component Layer:
– BuscarPeliculas.vue (search form + triggers API calls)
– FormularioPelicula.vue (movie‐data form)
– ListadoPeliculas.vue (renders search results)
– CarruselDestacado.vue (carousel of featured movies)
– Shared/HelloWorld.vue (example component)
• Assets: CSS files under src/assets for styling
• Service Layer: src/services/api.js (axios wrapper for HTTP requests)
d. External Movie Data API (third-party or custom backend)
Relationships and Data Flow
1. User opens the URL → Browser requests index.html from the Web Server.
2. index.html loads the Vue bundle (built by webpack via vue.config.js).
3. main.js initializes the Vue instance, renders App.vue.
4. Child components render UI, bind user events (search, form submit).
5. On events, components call methods in src/services/api.js (axios).
6. api.js issues HTTP requests to the External Movie Data API.
7. API responds with JSON → api.js returns data to the component.
8. Component updates its data model → Vue’s reactive binding updates the DOM.
Architectural Patterns & Principles
• MVVM approach: Vue components = View + ViewModel, data flows from service → model → view.
• Single Responsibility:
• Components manage only presentation and event handling.
• api.js centralizes all HTTP logic.
• Modularization: Each feature (search, listing, carousel) is its own Vue component.
Relevant Technologies
• Vue.js (CLI) with Single‐File Components (.vue)
• webpack (via vue.config.js) for bundling
• axios (inside src/services/api.js) for HTTP requests
• CSS assets for styling (src/assets/*.css)
• npm scripts for serve, build, lint