How tomlin7/ecommerce-chatbot works
Project type and purpose
• This is a full-stack e-commerce application with a modern Next.js/React frontend (apps/web/) and a Flask-based REST API backend (server/).
• It integrates AI capabilities (Google Gemini via LangChain) and a vector search engine (Pinecone) for semantic product discovery and a conversational shopping assistant.
File structure
• apps/web/
– Next.js “app” directory organizes pages (cart, chat, login, products, profile, register).
– components/ holds reusable UI pieces (chat, products, layout, ui primitives).
– lib/ api.ts and utils.ts wrap REST calls and misc helpers.
– context/ AuthContext manages JWT authentication state.
– next.config.js, tailwind.config.ts, tsconfig.json, postcss.config.js—build & styling setups.
• server/
– app.py / run.py / start.sh bootstrap the Flask app under gunicorn.
– routes/ define REST endpoints (auth, cart, chat, like, product).
– services/ contain business logic (auth_service.py, cart_service.py, chat_service.py, like_service.py, product_service.py, vector_service.py).
– models/ define ORM classes (SQLAlchemy) for User, Product, Cart, ChatSession, Message, UserLike.
– migrations/ hold Alembic scripts for database schema evolution.
– utils/ database seeder and logger configuration.
– config.py holds environment-specific settings (.env.example provided).
• External integration points: Pinecone (vector database), Google AI Studio (Gemini), Sentence Transformers, LangChain orchestration.
README for additional insights
• Tech stack summary confirms React/Next.js, Flask, JWT auth, Pinecone, LangChain, Google Gemini Flash 2.0, SQLite (dev), embedding engines.