How joanguinart/bemobilechallenge works
Project type and purpose
• This is a full-stack-ish web application built with Next.js (v15) and React (v19).
• It lets users search Marvel characters/comics, view details, and save favorites in browser local storage.
• It consumes the external Marvel REST API via Next.js API routes.
File structure
• src/app → Next.js App Router entrypoints (layout.tsx, page.tsx, dynamic [id] pages).
• src/app/api → serverless API routes: /api/marvel and /api/comics. Each invokes Marvel API and returns JSON.
• src/components → reusable React UI components (CharacterCard, SearchBar, Header, etc.).
• src/context/FavoritesContext.tsx → React Context to manage favorites state (reads/writes localStorage).
• src/lib/marvel.ts → low-level Marvel API helper functions (hash creation, fetch wrappers).
• src/styles & css → SCSS/CSS Module files for styling per component.
• playwright-tests → end-to-end tests validating UI flows.
• next.config.ts, tsconfig.json, eslint.config.mjs → build/configuration.
README for additional insights
• Confirms usage of Next.js, React, TypeScript, SCSS Modules, Vercel deployment.
• Describes features: search, detail pages, favorites (localStorage), filter.
• Notes dev vs prod asset handling, Playwright tests.
Detailed capture of essential architectural elements
• Components folder feeding into App Router pages.
• How FavoritesContext wraps components and interacts with localStorage.
• Detail the lib/marvel.ts helper forwarding creds to Marvel API.
• Build & deploy flow: “npm run build → Vercel → global edge network.”