Skip to content

Latest commit

Β 

History

History
108 lines (67 loc) Β· 2.13 KB

File metadata and controls

108 lines (67 loc) Β· 2.13 KB

πŸš€ Live Demo πŸš€

# πŸš€ [Live Demo](https://book-explorer-14.onrender.com/)

πŸš€ Live Demo

Live Demo

Example Image

πŸ“š Book Explorer

Book Explorer is a full-stack web application that scrapes book data from an external site, stores it (in JSON or MongoDB), and provides a searchable and browsable interface for customers.


πŸ—‚ Project Structure

book-explorer/
│── scraper/   # Node.js + Axios + Cheerio scraper script
│── backend/   # Express.js backend (API + MongoDB or JSON storage)
│── frontend/  # React + Vite frontend (book explorer UI)

πŸš€ Quick Start (Local Setup)

1️⃣ Run the Scraper

cd scraper
npm install
  • Create a .env file (optional, for MongoDB connection) β†’ see .env.example.
  • Run the scraper:
node scraper.js

This will create a books.json file in /scraper.
If MONGO_URI is provided, data will also be upserted into MongoDB.


2️⃣ Start the Backend

cd backend
npm install
  • Create a .env file (optional) β†’ see .env.example.
  • Run the server:
node index.js

πŸ‘‰ API will be served at: http://localhost:5000


3️⃣ Launch the Frontend

cd frontend
npm install
npm run dev

πŸ‘‰ Open the Vite dev server (usually http://localhost:5173).


πŸ”— API Endpoints

  • GET /api/books β†’ Fetch all books
  • POST /api/refresh β†’ Trigger scraper (only works if Node + paths are configured)

πŸ“ Notes

  • If you don’t configure MongoDB, the backend will read from scraper/books.json.
  • The project is modular β€” scraper, backend, and frontend can run independently.
  • Built with:
    • Scraper: Node.js, Axios, Cheerio
    • Backend: Express.js, MongoDB (optional)
    • Frontend: React (Vite, Tailwind optional)


πŸ“œ License

MIT