# bladorado/my-app-de-peliculas architecture

> Architecture diagram of the GitHub repository bladorado/my-app-de-peliculas, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-04-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/bladorado/my-app-de-peliculas
- Repository: https://github.com/bladorado/my-app-de-peliculas

## Overview

1. **Repository type and runtime**
   - This is a **Next.js App Router** project (React-based), bootstrapped with `create-next-app`.
   - The app is organized around route segments under `app/`, with shared UI in `components/`, cross-page state in `context/`, and API access in `lib/`.

2. **Route-level architecture**
   - The main user-facing entry points are:
     - `app/page.jsx` — the landing/home page
     - `app/Buscar/page.jsx` — search page
     - `app/Favoritas-pelis/page.jsx` — favorites page
     - `app/peliculas/[id]/page.jsx` — dynamic movie detail route
   - This indicates the app is a multi-page movie browsing experience with list, search, detail, and favorites views.

3. **Global application shell**
   - `app/layout.jsx` defines the shared shell for all routes.
   - `components/Nav.jsx` is the shared navigation boundary, likely used across the whole app.
   - `app/globals.css` provides application-wide styling.

4. **Shared movie browsing subsystem**
   - `components/populares/` contains reusable pieces for displaying movie-related content:
     - `Pelicula.jsx` — likely a movie card or item renderer
     - `ListaPeli.jsx` — likely a list/grid wrapper for multiple movies
     - `Favorito.jsx` — likely a favorite toggle/control tied to a movie item
     - `Deshobard.jsx` — likely a dashboard/home section component
   - These components probably power the home and list-oriented views.

5. **Search subsystem**
   - `components/buscar-ficha/BarraBusqueda.jsx` is the dedicated search input component.
   - `app/Buscar/page.jsx` likely composes this search bar with results rendering.
   - This is a distinct UI boundary from the popular-movies listing, even if both ultimately use the same movie data source.

6. **Movie detail flow**
   - `app/peliculas/[id]/page.jsx` is the dynamic detail page for a single movie.
   - The route parameter `[id]` suggests the page fetches or resolves movie details based on an identifier from the URL.
   - This page is the main leaf node of the browsing flow: list/search result → detail view.

7. **Favorites state boundary**
   - `context/FavoritosContext.jsx` centralizes favorites state across the app.
   - This context likely supports adding/removing favorites from movie cards and reading favorites in the dedicated favorites page.
   - It is the main shared state mechanism connecting otherwise separate routes/components.

8. **Data access layer**
   - `lib/apipeli.js` is the repository’s API abstraction for movie data.
   - This file likely encapsulates network calls, request formatting, and response handling for the movie source.
   - The architecture cleanly separates UI components from data-fetching logic through this library layer.

9. **Data flow across the app**
   - Typical flow is: **route page** → **shared UI components** → **API helper** for movie data → **context** for favorites updates.
   - For favorites, the flow is bidirectional: movie UI can mutate favorites via `FavoritosContext`, and favorites pages read from the same context.
   - The detail route likely fetches by ID, while the search page and home/list pages likely fetch collections or filtered results.

10. **Navigation and user journeys**
   - The app is structured around a small set of user journeys:
     - browse popular movies
     - search for a movie
     - open a movie detail page
     - mark/unmark favorites
     - review saved favorites
   - `Nav.jsx` is the primary route switcher between these journeys.

11. **Assets and styling**
   - `public/` holds static assets.
   - Styling is centralized via Next.js global CSS, with no sign of a separate design system or CSS framework in the tree.
   - This suggests a relatively lightweight UI architecture.

12. **Tooling and platform**
   - `next.config.mjs`, `eslint.config.mjs`, `postcss.config.mjs`, and `jsconfig.json` are the main project-level configuration files.
   - The README indicates standard Next.js development and deployment, with Vercel as the target platform.
   - No backend service or database is visible in the tree; the app likely depends on an external movie API through `lib/apipeli.js` and client-side state for favorites.

13. **What to draw in an architecture diagram**
   - A good diagram would show:
     - Next.js App Router pages as the top-level entry points
     - shared navigation/layout wrapping all routes
     - shared movie UI components used by multiple pages
     - `FavoritosContext` as the global state hub
     - `lib/apipeli.js` as the external data-access boundary
     - `public/` and global CSS as supporting infrastructure
   - The main architectural separation is between **routes/UI**, **state management**, and **movie API access**.

Main entry points: [`app/layout.jsx`](https://github.com/bladorado/my-app-de-peliculas/blob/main/app/layout.jsx) (App shell), [`app/page.jsx`](https://github.com/bladorado/my-app-de-peliculas/blob/main/app/page.jsx) (Home), [`app/Buscar/page.jsx`](https://github.com/bladorado/my-app-de-peliculas/blob/main/app/Buscar/page.jsx) (Search), [`components/populares/ListaPeli.jsx`](https://github.com/bladorado/my-app-de-peliculas/blob/main/components/populares/ListaPeli.jsx) (Movie list)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_routes["Routes"]
  node_app_layout["App shell<br/>Next layout<br/>[layout.jsx]"]
  node_home_page["Home<br/>Route page<br/>[page.jsx]"]
  node_search_page["Search<br/>Route page<br/>[page.jsx]"]
  node_favorites_page["Favorites<br/>Route page<br/>[page.jsx]"]
  node_detail_page["Movie detail<br/>Dynamic route<br/>[page.jsx]"]
end

subgraph group_ui["Shared UI"]
  node_nav["Nav<br/>[Nav.jsx]"]
  node_search_bar["Search bar<br/>Search input<br/>[BarraBusqueda.jsx]"]
  node_movie_card["Movie card<br/>Movie item<br/>[Pelicula.jsx]"]
  node_movie_list["Movie list<br/>List wrapper<br/>[ListaPeli.jsx]"]
  node_favorite_toggle["Favorite toggle<br/>Action control<br/>[Favorito.jsx]"]
  node_dashboard["Dashboard<br/>Home section<br/>[Deshobard.jsx]"]
end

subgraph group_state["State & Data"]
  node_favorites_ctx[("Favorites context<br/>React context")]
  node_movie_api["Movie API<br/>API client<br/>[apipeli.js]"]
end

subgraph group_support["Support"]
  node_styles["Global styles<br/>CSS<br/>[globals.css]"]
  node_assets{{"Public assets<br/>Static assets"}}
end

node_app_layout -->|"uses"| node_nav
node_app_layout -->|"loads"| node_styles
node_app_layout -->|"wraps"| node_home_page
node_app_layout -->|"wraps"| node_search_page
node_app_layout -->|"wraps"| node_favorites_page
node_app_layout -->|"wraps"| node_detail_page
node_home_page -->|"composes"| node_dashboard
node_home_page -->|"renders"| node_movie_list
node_movie_list -->|"uses"| node_movie_card
node_movie_card -->|"includes"| node_favorite_toggle
node_search_page -->|"composes"| node_search_bar
node_search_page -->|"renders"| node_movie_list
node_favorites_page -->|"renders"| node_movie_list
node_detail_page -->|"fetches"| node_movie_api
node_home_page -->|"fetches"| node_movie_api
node_search_page -->|"fetches"| node_movie_api
node_favorites_page -->|"reads"| node_favorites_ctx
node_favorite_toggle -->|"updates"| node_favorites_ctx
node_movie_card -.->|"links"| node_movie_api
node_assets -.->|"supports"| node_app_layout

click node_app_layout "https://github.com/bladorado/my-app-de-peliculas/blob/main/app/layout.jsx"
click node_home_page "https://github.com/bladorado/my-app-de-peliculas/blob/main/app/page.jsx"
click node_search_page "https://github.com/bladorado/my-app-de-peliculas/blob/main/app/Buscar/page.jsx"
click node_favorites_page "https://github.com/bladorado/my-app-de-peliculas/blob/main/app/Favoritas-pelis/page.jsx"
click node_detail_page "https://github.com/bladorado/my-app-de-peliculas/blob/main/app/peliculas/[id]/page.jsx"
click node_nav "https://github.com/bladorado/my-app-de-peliculas/blob/main/components/Nav.jsx"
click node_search_bar "https://github.com/bladorado/my-app-de-peliculas/blob/main/components/buscar-ficha/BarraBusqueda.jsx"
click node_movie_card "https://github.com/bladorado/my-app-de-peliculas/blob/main/components/populares/Pelicula.jsx"
click node_movie_list "https://github.com/bladorado/my-app-de-peliculas/blob/main/components/populares/ListaPeli.jsx"
click node_favorite_toggle "https://github.com/bladorado/my-app-de-peliculas/blob/main/components/populares/Favorito.jsx"
click node_dashboard "https://github.com/bladorado/my-app-de-peliculas/blob/main/components/populares/Deshobard.jsx"
click node_favorites_ctx "https://github.com/bladorado/my-app-de-peliculas/blob/main/context/FavoritosContext.jsx"
click node_movie_api "https://github.com/bladorado/my-app-de-peliculas/blob/main/lib/apipeli.js"
click node_styles "https://github.com/bladorado/my-app-de-peliculas/blob/main/app/globals.css"
click node_assets "https://github.com/bladorado/my-app-de-peliculas/tree/main/public"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app_layout,node_home_page,node_search_page,node_favorites_page,node_detail_page toneBlue
class node_nav,node_search_bar,node_movie_card,node_movie_list,node_favorite_toggle,node_dashboard toneAmber
class node_favorites_ctx,node_movie_api toneMint
class node_styles,node_assets toneRose
```

## Components

### Routes

App Router entry points and page-level flows

- [App shell](https://github.com/bladorado/my-app-de-peliculas/blob/main/app/layout.jsx): Next layout · Shared application shell for all routes · `app/layout.jsx`
- [Home](https://github.com/bladorado/my-app-de-peliculas/blob/main/app/page.jsx): Route page · Landing page for browsing movies · `app/page.jsx`
- [Search](https://github.com/bladorado/my-app-de-peliculas/blob/main/app/Buscar/page.jsx): Route page · Movie search entry point · `app/Buscar/page.jsx`
- [Favorites](https://github.com/bladorado/my-app-de-peliculas/blob/main/app/Favoritas-pelis/page.jsx): Route page · Saved movies view · `app/Favoritas-pelis/page.jsx`
- [Movie detail](https://github.com/bladorado/my-app-de-peliculas/blob/main/app/peliculas/[id]/page.jsx): Dynamic route · Per-movie detail page by id · `app/peliculas/[id]/page.jsx`

### Shared UI

Reusable navigation and movie presentation components

- [Nav](https://github.com/bladorado/my-app-de-peliculas/blob/main/components/Nav.jsx): Shared nav · Primary navigation across the app · `components/Nav.jsx`
- [Search bar](https://github.com/bladorado/my-app-de-peliculas/blob/main/components/buscar-ficha/BarraBusqueda.jsx): Search input · Dedicated movie search control · `components/buscar-ficha/BarraBusqueda.jsx`
- [Movie card](https://github.com/bladorado/my-app-de-peliculas/blob/main/components/populares/Pelicula.jsx): Movie item · Reusable movie display component · `components/populares/Pelicula.jsx`
- [Movie list](https://github.com/bladorado/my-app-de-peliculas/blob/main/components/populares/ListaPeli.jsx): List wrapper · Collection layout for movies · `components/populares/ListaPeli.jsx`
- [Favorite toggle](https://github.com/bladorado/my-app-de-peliculas/blob/main/components/populares/Favorito.jsx): Action control · Add/remove a movie from favorites · `components/populares/Favorito.jsx`
- [Dashboard](https://github.com/bladorado/my-app-de-peliculas/blob/main/components/populares/Deshobard.jsx): Home section · Home-page movie browsing section · `components/populares/Deshobard.jsx`

### State & Data

Cross-route state and API access

- [Favorites context](https://github.com/bladorado/my-app-de-peliculas/blob/main/context/FavoritosContext.jsx): React context · Shared favorites state across routes · `context/FavoritosContext.jsx`
- [Movie API](https://github.com/bladorado/my-app-de-peliculas/blob/main/lib/apipeli.js): API client · Movie data access layer · `lib/apipeli.js`

### Support

Global styling and static assets

- [Global styles](https://github.com/bladorado/my-app-de-peliculas/blob/main/app/globals.css): CSS · Application-wide styling · `app/globals.css`
- [Public assets](https://github.com/bladorado/my-app-de-peliculas/tree/main/public): Static assets · Images and other static files · `public`

## Connections

- App shell → Nav: uses · Shared shell renders the navigation
- App shell → Global styles: loads · Global stylesheet is applied app-wide
- App shell → Home: wraps · Layout surrounds route pages
- App shell → Search: wraps · Layout surrounds route pages
- App shell → Favorites: wraps · Layout surrounds route pages
- App shell → Movie detail: wraps · Layout surrounds route pages
- Home → Dashboard: composes · Home page is built from dashboard sections
- Home → Movie list: renders · Lists popular movies
- Movie list → Movie card: uses · List renders movie items
- Movie card → Favorite toggle: includes · Cards expose favorite actions
- Search → Search bar: composes · Search page centers on the search control
- Search → Movie list: renders · Search results use shared list UI
- Favorites → Movie list: renders · Favorites page reuses list UI
- Movie detail → Movie API: fetches · Detail route resolves a movie by id
- Home → Movie API: fetches · Home page loads movie data
- Search → Movie API: fetches · Search page queries movie data
- Favorites → Favorites context: reads · Favorites view consumes shared state
- Favorite toggle → Favorites context: updates · Toggles mutate global favorites state
- Movie card → Movie API: links · Movie items relate to movie data
- Public assets → App shell: supports · Static files can be consumed by the app
