Skip to content

amanbind898/Full-Stack-Scraper-Challenge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

🧠 Full Stack Scraper Challenge

A full-stack application built with Python (Flask) and Vue.js, which scrapes product card data from the Croma Televisions & Accessories page, stores the structured data in Redis, and renders it dynamically on the frontend.

🚀 This project was developed as part of a real-world full-stack engineering challenge.


🛠 Tech Stack

  • Backend: Python, Flask, Redis, BeautifulSoup, requests
  • Frontend: Vue.js, Axios, CSS Grid
  • Others: Flask-CORS, Redis CLI, npm, Docker (optional)

📦 Features

  • Scrapes <head> and header HTML elements, along with all product cards from Croma
  • Stores cleaned product data as JSON in Redis (scraped_content)
  • Flask API exposes two endpoints:
    • /scraped-content: Serves all scraped data
    • /products: Serves product list only
  • Vue.js SPA fetches and displays product cards dynamically
  • Reusable Vue components and responsive layout with CSS Grid

🔧 Setup Instructions

✅ Prerequisites

  • Python 3.8+
  • Node.js 14+
  • Redis server running on localhost:6379 (use Docker or local installation)

🧪 Backend Setup

# Create and activate virtual environment
python -m venv venv
source venv/bin/activate   # Linux/macOS
venv\Scripts\activate      # Windows

# Navigate and install dependencies
cd backend
pip install -r requirements.txt

# Run the scraper to populate Redis
python scraper.py

# Start the Flask API
python app.py

🌐 Frontend Setup

# In a new terminal
cd frontend

# Install dependencies
npm install

# Run the development server
npm run serve

📁 Folder Structure

.
├── backend/
│   ├── app.py              # Flask API
│   ├── scraper.py          # BeautifulSoup scraper
│   └── requirements.txt
├── frontend/
│   ├── src/
│   │   ├── components/
│   │   │   └── Product.vue
│   │   └── App.vue
│   └── package.json
└── README.md

✅ Tasks Completed

  • Implemented scraper.py to extract <head> and product details
  • Stored JSON data in Redis with proper serialization
  • Built /scraped-content and /products endpoints using Flask + CORS
  • Created Vue frontend with dynamic product grid
  • Used Axios and reusable components for rendering

🧪 Example Output

JSON stored in Redis under key scraped_content:

{
  "head": "<title>Televisions - Croma</title>",
  "header": "<div class='bs-header'>...</div>",
  "products": [
    {
      "id": "12345",
      "title": "Samsung 43\" UHD Smart TV",
      "link": "https://www.croma.com/...",
      "price": "₹34,999",
      "original_price": "₹42,000",
      "discount": "16%",
      "tags": ["Best Seller", "4K"]
    },
    ...
  ]
}

🧑‍💻 Author

Aman Kumar Bind
📧 [email protected]
🔗 LinkedIn | GitHub


📄 License

This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published