Welcome to Searchly, your go-to AI-powered e-commerce assistant! Searchly is a cutting-edge product recommendation system designed to deliver highly personalized shopping experiences. Powered by AI-driven algorithms, real-time data scraping, and a modern frontend, Searchly bridges the gap between user intent and the perfect product match.
- Features
- Project Structure
- Architecture Diagram
- Tech Stack
- Workflow Diagram
- Setup Instructions
- Detailed Component Overview
- Usage
- API Endpoints
- Screenshots
- Contributing
- AI Chat Assistant: "Aivy" guides users through product discovery with natural language queries.
- Personalized Recommendations: Provides tailored suggestions based on user preferences.
- Favorites Management: Add and remove products from a personal favorites list.
- Search Filters: Sort and filter products by price, ratings, and relevance.
- Real-Time Product Scraping: Fetch live product data for up-to-date recommendations.
- Secure Authentication: Secure user registration and login with JWT tokens.
- Responsive Design: Works seamlessly across devices.
📁 Searchly
├── 📁 client (Frontend)
│ ├── 📁 public
│ ├── 📁 src
│ │ ├── 📁 components
│ │ ├── 📁 data
│ │ ├── App.js
│ │ ├── index.js
│ │ └── Tailwind CSS config files
│ └── package.json
├── 📁 server (Backend)
│ ├── app.py
│ ├── scrape_web.py
│ ├── 📁 .env (Configuration variables)
│ └── requirements.txt
├── README.md
- Python (Flask)
- MongoDB for data persistence
- Pinecone for vector similarity search
- HuggingFace Embeddings for query-product matching
- Groq API for AI-based query understanding
- BeautifulSoup/Requests for web scraping
- React for UI
- Framer Motion for animations
- Tailwind CSS for styling
- Lucide Icons for vector icons
- Node.js (v14+)
- Python (v3.9+)
- MongoDB installed locally or hosted
- Pinecone API Key
- Groq API Key
-
Clone the repository:
git clone https://github.com/SrikarVeluvali/Searchly cd Searchly/server
-
Create a virtual environment and activate it:
python -m venv venv source venv/bin/activate # For Windows: venv\Scripts\activate
-
Install the dependencies:
pip install -r requirements.txt
-
Create a
.env
file with the following variables:GROQ_API_KEY=your_groq_api_key PINECONE_API_KEY=your_pinecone_api_key
-
Run the server:
python app.py
-
The server will run on
http://localhost:5000
.
-
Navigate to the client folder:
cd Searchly/client
-
Install dependencies:
npm install
-
Run the development server:
npm start
-
Access the application at
http://localhost:3000
.
- Ensure MongoDB is running locally or connect to a hosted instance.
- Update the database connection string in
app.py
if necessary.
-
AI Recommendations:
- Processes user queries with the Groq API.
- Embeds and indexes product data using HuggingFace and Pinecone.
-
Data Management:
- MongoDB manages user data, tags, and favorites.
- Handles CRUD operations for favorites and tags.
-
Web Scraping:
- Dynamically fetches product details using
scrape_web.py
.
- Dynamically fetches product details using
-
Landing Page:
- Introduces users to Searchly's capabilities.
-
Authentication:
- Secure login and registration via React.
-
AI Chatbot:
- Interactive UI to converse with "Aivy" for product suggestions.
-
Product Recommendations:
- Displays personalized product lists with sorting/filtering.
-
Favorites:
- Displays saved products for quick access.
- AuthScreen:
- Handles login and registration flows.
- ChatbotPage:
- Implements the AI assistant.
- FavouritesPage:
- Manages user favorites.
- Products:
- Renders the recommendation grid with search and filters.
- Launch both the backend (
http://localhost:5000
) and frontend (http://localhost:3000
). - Navigate to
http://localhost:3000
to use the application. - Key User Actions:
- Register/Login to create an account.
- Interact with the chatbot to get product suggestions.
- Add/remove products to/from your favorites.
Here is a comprehensive list of all API endpoints in the provided code:
/userregister
(POST): Registers a new user. Requiresname
,email
, andpassword
in the request body./userlogin
(POST): Logs in an existing user. Requiresemail
andpassword
in the request body.
/recommend
(POST): Handles user queries to generate AI-based product recommendations using Groq. Requiresquery
andemail
in the request body./recommend_from_db
(POST): Similar to/recommend
but focuses on finding recommendations based on previously indexed products. Requiresquery
andemail
in the request body.
/add_favourite
(POST): Adds a product to the user's favorites list. Requiresemail
andproduct
(product details) in the request body./get_favourites
(POST): Retrieves the list of favorited products for a user. Requiresemail
in the request body./remove_favourite
(POST): Removes a product from the user's favorites list. Requiresemail
andproduct_url
(unique product URL) in the request body.
/get_recommendations
(POST): Retrieves product recommendations based on a user's stored tags. Requiresemail
in the request body.
search_product(query)
(Function): Helper function to scrape e-commerce websites (e.g., Amazon and Flipkart) for products based on a search query. This is not exposed as an endpoint but is used within/recommend
and/recommend_from_db
.
- Fork the repository.
- Create a feature branch:
git checkout -b feature-name
- Commit changes and push to your fork:
git push origin feature-name
- Open a pull request.