How vibhoursharma/pixabay works
Project type and purpose
• This is a Single-Page Application (SPA) built with ReactJS and Tailwind CSS, hosted on Vercel, that clones Pixabay’s image/video search UI and integrates Firebase for authentication and per-user data (favorites, downloads).
• Core features: OAuth/email login, dynamic search (images/videos) via Pixabay API, skeleton loading animations, user-specific favorites and download tracking.
File structure
• Top-level files:
• index.html, package.json/lock.json, vite.config.js, tailwind.config.js, postcss.config.js (build & styling configs)
• vercel.json (deployment)
• src/
• main.jsx → application entry point (boots React app)
• context/Firebase.jsx → React Context provider for Firebase Auth & Firestore SDK
• components/ → reusable UI modules, organized by feature (Dashboard, Modal, Search)
• pages/ → route-level components (HomePage, SearchResult, Downloads, Favourites, LoginPage, SignupPage)
• assets/ → static assets (background images)
• App.css → global styling overrides
• No separate “backend” directory: all data and auth happen via client SDKs to Firebase and direct REST calls to Pixabay API.
Extract insights from the README
• Technology stack: ReactJS (frontend framework), Tailwind CSS (utility CSS), Firebase (authentication & data), Vite (dev/build tool), Vercel (hosting)
• Features explicitly mentioned: Firebase Authentication, dynamic dashboard, search UI, skeleton loader, responsive design, and multi-page routing.
a. Main components
• User’s Browser (Client)
• Static Hosting (Vercel CDN serving index.html + JS/CSS bundle)
• React SPA
– React Router (manages pages)
– Context Layer (Firebase context provider)
– Pages (HomePage, SearchResult, Downloads, Favourites, LoginPage, SignupPage)
– UI Components (Dashboard components, Search components, Modal components)
– Styling Engine (Tailwind CSS + PostCSS)
• External Services
– Pixabay REST API (image/video search endpoints)
– Firebase Auth (email/password & Google OAuth)
– Firebase Firestore (stores user’s favorites and download counts)
b. Relationships & data flow
1. User navigates to the app URL → DNS → Vercel CDN → serves static assets → boots React SPA in browser.
2. React App initializes Firebase context → checks user session with Firebase Auth.
3. User enters search term → React component sends HTTP request to Pixabay API → receives JSON results → components render cards.
4. User favorites or downloads an item → SPA calls Firestore via Firebase SDK to persist or update user data.
5. Firestore streams updates back to the UI context → Favourites/Downloads pages render current data.
c. Architectural patterns & design principles
• Component-based UI decomposition (feature folders under components/ and pages/).
• Unidirectional data flow via React state & Context.
• Client-side routing (React Router implied by pages folder).
• Serverless/backend-as-a-service model: Firebase manages authentication & data storage; Pixabay provides external API.
• Utility-first styling (Tailwind CSS) integrated through PostCSS in Vite.
d. Key technologies & libraries
• ReactJS (core framework)
• Vite (dev server & bundler)
• Tailwind CSS + PostCSS (styling)
• Firebase SDK (Auth + Firestore)
• Pixabay REST API
• Vercel (static hosting)
Detail is key
• Related components (pages vs. feature widgets).
• Context provider boundary (all Firebase calls go through it).
• Explicitly call out API endpoints (e.g., GET https://pixabay.com/api) and Firestore collections (e.g., /users/{uid}/favorites).
• Don’t over-abstract—capture every major directory or service as its own node.