This is a full-stack GenAI e-commerce project with a customer-facing store, an admin panel, and a backend API. The frontend and admin side are built with React, and the backend uses Node.js, Express, and MongoDB.
The project is split into four main folders.
- e-commerce-frontend for the shopping website
- e-commerce-admin for product management
- e-commerce-backend for API routes, authentication, cart logic, image upload, and database access
- e-commerce-genai for the Generative AI logic used by the project
Users can browse products, open product pages, sign up, log in, and manage their cart. On the admin side, products can be added or removed. The backend connects both sides and stores the product and user data.
This project also includes a Generative AI feature for product descriptions.
While adding a product in the admin panel, you can enter the product title, category, and price details, then use the Generate with AI button. The backend sends that information to the model and gets back a short product description. That description is saved with the product and shown later on the product page.
The API route still lives in the backend, but the AI settings, prompt builder, service layer, and example outputs are now kept in the e-commerce-genai folder so that part of the project is easier to understand.
- React
- React Router
- Node.js
- Express
- MongoDB with Mongoose
- Multer for image upload
- OpenAI-compatible API for AI description generation
- e-commerce-frontend
- e-commerce-admin
- e-commerce-backend
- e-commerce-genai
Inside e-commerce-genai there is
- config for AI configuration
- prompts for prompt text
- services for request logic
- examples for sample AI output style
- Backend
Open the e-commerce-backend folder and update the .env file with your own values.
MONGODB_URI=your_mongodb_connection_string OPENAI_API_KEY=your_openai_api_key OPENAI_MODEL=gpt-4.1-mini OPENAI_BASE_URL=https://api.openai.com/v1
You only need it if you are using another OpenAI-compatible provider otherwise, OPENAI_BASE_URL is optional
Then start the backend with this command:
npm start
The backend runs on port 4000.
- Frontend
Open the e-commerce-frontend folder and run:
npm start
- Admin panel
Open the e-commerce-admin folder and run:
npm start
To create a production build for the frontend:
cd e-commerce-frontend npm run build
To create a production build for the admin panel:
cd e-commerce-admin npm run build