How ateendra24/marvel-characters-explorer works
Project type and purpose
• This is a frontend-only single-page application (SPA) built with React (via Vite) that consumes the external Marvel REST API to let users browse and search Marvel characters. There is no custom backend or database—data comes directly from the external Marvel API.
File structure
• Top-level config files: package.json, vite.config.js, tailwind.config.js, postcss.config.js, eslint.config.js.
• public/: static assets (images, index.html served in production).
• src/: application source
• main.jsx – SPA entry point, ReactDOM.render
• index.css – global styles (Tailwind + custom)
• App.jsx – root component, sets up routing or layout
• Pages/ – page-level components (Home.jsx, FullPage.jsx)
• Components/ – reusable UI widgets (Card.jsx, SkeletonCard.jsx)
• Env config: .env (VITE_MARVEL_PUBLICKEY / PRIVATEKEY) injected at build time.
• Build tool: Vite for dev server, bundling, hot module replacement, production build.
README for additional insights
• Confirms tech stack: React.js, Vite, Tailwind CSS.
• Fetches data from Marvel API.
• No server-side logic beyond static hosting.
a. Main components
1. Browser / Client
– React SPA running in user’s browser
– UI layers: Pages → Components
2. Build & Deployment
– Node.js + npm: installs dependencies, runs Vite dev server
– Vite bundler: transforms JSX, Tailwind, CSS, environment variables → production bundle
– Static hosting (e.g., Netlify, Vercel, S3) serves index.html + JS/CSS assets
3. External Services
– Marvel REST API (HTTPS endpoints requiring public/private keys)
b. Relationships & interactions
• User clicks/searches in the React UI
• React components call fetch(...) to the Marvel API, including API keys from import.meta.env
• Marvel API returns character data → components render grid or details
• Vite handles module hot-reload during dev, and bundles code for deployment
c. Architectural patterns / design principles
• Component-based UI (React): separation into Pages vs. reusable Components
• SPA routing implied in App.jsx (conditional rendering of Home vs. FullPage)
• Environment-based config: VITE_ prefix for secure injection of API keys
• Static asset pipeline: Tailwind processed via PostCSS enabling utility classes
d. Relevant technologies
• React.js (JSX, Hooks)
• Vite (fast dev server, ES module support, bundler)
• Tailwind CSS (utility-first styling)
• Node.js / npm (package management)
• Marvel REST API