feat: added AI assistant widget, fixed OAuth placeholders, and resolv… - #584
Open
JayRaut123 wants to merge 1 commit into
Open
feat: added AI assistant widget, fixed OAuth placeholders, and resolv…#584JayRaut123 wants to merge 1 commit into
JayRaut123 wants to merge 1 commit into
Conversation
…ed product upload API bugs
|
@JayRaut123 is attempting to deploy a commit to the niharika-mente's projects Team on Vercel. A member of the Team first needs to authorize it. |
Author
|
@niharika-mente please check with my request |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
✨ Key Features added:
Customer Reward System (Store Coins): Implemented a fully functional loyalty points system to boost user retention.
Users receive a 500-coin Welcome Bonus upon signup (including Google/GitHub OAuth).
Users earn 50 coins for leaving product reviews.
Coins can be redeemed for discounts during checkout, and the coin balance is beautifully displayed on the user's Profile Page.
Interactive AI Assistant Widget: Added a dynamic chatbot component on the frontend that allows users to ask product-related questions (e.g. "Help me find a mouse").
Gemini AI Backend Controller: Integrated the @google/generative-ai SDK (using the gemini-2.5-flash model) in the backend to securely parse store context and return smart product recommendations to the user without exposing API keys on the client-side.
🐛 Bug Fixes & Improvements:
Fixed Authorization token headers: Updated store/product.js to properly append the Authorization: Bearer header to standard fetch() API calls, fixing a bug where authenticated product operations (like Create/Update/Delete) were immediately rejected by the backend.
Database Bootstrapping (Admin Role): Fixed the logic in auth.controller.js so the very first user registered in the database is automatically granted the admin role, preventing lock-outs in fresh development environments.
Developer Experience (Graceful Configurations):
Hardened config/passport.js to explicitly detect and ignore default placeholder strings (e.g., 'your-google-client-id'). If OAuth isn't configured, it gracefully redirects users with an error message instead of crashing the backend on startup.
Hardened the Cloudinary initialization in product.controller.js to ensure the server gracefully falls back to URL-based uploads instead of crashing if default image upload credentials are left in the .env file.