Skip to content

Conversation

@PasinduGunathilake
Copy link

This pull request introduces several new backend utilities for environment configuration, chatbot integration, and database management, as well as improvements to product data and frontend settings. The most significant changes include the addition of a Gemini-powered chatbot backend, scripts for MongoDB user management, a new environment variable template, and updates to product categorization and images.

Backend and Environment Setup:

  • Added .env.example as a template for environment variables, including configuration for Gemini API, Flask, MongoDB, and SMTP, with clear setup instructions.
  • Introduced chatbot_backend.py, integrating Google Gemini via LangChain for a retrieval-augmented chatbot with session-based history and a structured JSON checkout flow.

Database Utilities:

  • Added check_users.py for checking MongoDB connection and listing users, including guidance for creating an admin user.
  • Added create_admin.py to create or update an admin user in MongoDB, securely hashing the password.

Product Data and Categorization:

  • Updated data/products.json to standardize image paths, correct product categories (e.g., "Mobile phone", "Headphone", "Laptops"), and add new laptop products.
  • Added data/mobile_phones.csv with detailed specs and pricing for a wide range of mobile phones.

Frontend and Configuration:

  • Removed .vscode/settings.json to clean up project-specific editor settings.
  • Removed all code from js/index.js, possibly for a future rewrite or deprecation.

PasinduGunathilake and others added 30 commits September 12, 2025 00:20
change file structure and add Flask backend
…ion, product listings, testimonials, and footer
chatbot functionality, session management and API integration
Replaced actual API key with placeholder text.
Implement chatbot functionality with session management and API integ…
Merge pull request #7 from PasinduGunathilake/pasindu_dev
Added Embeded Google map for footer
- Implemented login, registration, and password reset functionality in login.html.
- Enhanced product.html with dynamic product details, stock status, and specifications.
- Created user_dashboard.html for user account management and navigation.
- Added API tests in test_api.py to verify product retrieval and cart functionality.
- Developed connection diagnostics in test_connections.py for MongoDB, SMTP, and Gemini API.
- Introduced end-to-end tests in test_e2e.py for product insertion, user login, and cart operations.
feat: Add user authentication and dashboard features
Updated the README to enhance clarity and add features.
Remove placeholder for GEMINI_API_KEY from .env file
@netlify
Copy link

netlify bot commented Oct 11, 2025

Deploy Preview for edem-phone failed.

Name Link
🔨 Latest commit 5fc1751
🔍 Latest deploy log https://app.netlify.com/projects/edem-phone/deploys/68ea99a286884a000881c217

@PasinduGunathilake
Copy link
Author

This pull request introduces several significant improvements and additions across the backend and data layers of the project, focusing on chatbot integration, database management utilities, data consistency, and environment configuration. The most important changes are summarized below:

Backend & Chatbot Integration:

  • Added a new chatbot_backend.py module implementing a conversational retrieval-augmented generation (RAG) chatbot using Google Gemini via the LangChain framework. The chatbot is context-aware, supports multi-turn conversations, and enforces structured purchase flows with JSON output. It is configurable via environment variables and includes robust error handling.

Database Utilities:

  • Introduced create_admin.py, a script to create or update an admin user in MongoDB, ensuring secure password handling and idempotent user creation.
  • Added check_users.py, a utility script to verify MongoDB connectivity and list users in the database, providing clear diagnostics and guidance for setup.

Data & Static Assets Consistency:

  • Updated data/products.json to fix image paths (now under ./static/images/...) and standardized product categories (e.g., "Mobile phone", "Headphone", "Laptops"). Also added several new laptop products.
  • Added a comprehensive data/mobile_phones.csv file listing detailed specs and prices for a wide range of mobile phones, to support chatbot context and other features.

Environment & Project Configuration:

  • Added a detailed .env.example template with documentation for all required environment variables, including API keys, Flask, MongoDB, and SMTP settings, to streamline local development and deployment.
  • Removed the .vscode/settings.json file, likely to avoid editor-specific configuration in version control.

Frontend JavaScript:

  • Removed the entire contents of js/index.js, which included navigation, popup, and UI interaction logic. This may be in preparation for a refactor or migration to a new frontend framework.

These changes collectively enhance the backend chatbot capabilities, improve developer experience with better environment and database management, ensure data consistency, and prepare the codebase for further frontend or backend evolution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants