A modern, AI-powered marketplace connecting local artisans with customers, featuring robust authentication, cart management, chat and admin controls.
- Modern UI: Built with Tailwind CSS and shadcn/ui components
- Authentication: Login/Signup with Google OAuth support
- Product Management: Browse, search, filter products with categories and tags
- Shopping Cart: Persistent cart with real-time updates
- AI Chat Interface: Interactive assistant for product discovery
- Role-based Access: Protected routes for Admin, Seller, Services, and Customer
- Responsive Design: Mobile-first approach with beautiful animations
- RESTful API: Comprehensive endpoints for all operations
- Authentication: JWT-based auth with 5-minute sessions and refresh tokens
- Database: MongoDB with Mongoose ODM
- Security: Password hashing, CORS, input validation with Zod
- Real-time Features: Cart synchronization across sessions
- React 18 + TypeScript
- Vite (Build tool)
- Tailwind CSS (Styling)
- shadcn/ui (Component library)
- React Router (Navigation)
- React Query (Data fetching)
- Context API (State management)
- Node.js + Express
- MongoDB + Mongoose
- JWT (Authentication)
- bcrypt (Password hashing)
- Zod (Validation)
- CORS (Cross-origin requests)
- Node.js (v18+)
- MongoDB (local or cloud)
- Git
git clone https://github.com/Rogshivam/ArtistBazaar.git
cd ArtistBazaar
Run Container
docker compose up -d
Check Running Docker Containers
docker ps
Look at the PORTS column
0.0.0.0:4000 -> 4000/tcp
-
Navigate to backend directory
cd backend -
Install dependencies
npm install
-
Create environment file
cp env.example .env
-
Start MongoDB (if running locally)
# On macOS with Homebrew brew services start mongodb-community # On Ubuntu/Debian sudo systemctl start mongod # On Windows net start MongoDB
-
Run the backend
npm run dev
-
Navigate to frontend directory
cd frontend -
Install dependencies
npm install
-
Create environment file
cp env.example .env
-
Run the frontend
npm run dev
- Customer: Browse products, add to cart, make purchases
- Seller: Manage products, view sales analytics
- Services: Provide services to customers
- Admin: Full system access, user management
- Email/Password: Traditional authentication
- Google OAuth: One-click sign-in (simulated in demo)
- Access Token: 5-minute expiration for security
- Refresh Token: 7-day expiration for convenience
- Auto-logout: Session expires after 5 minutes of inactivity
- Persistent Storage: Cart saved in MongoDB
- Real-time Updates: Changes sync across browser tabs
- Quantity Management: Add, update, remove items
- Price Snapshots: Prices locked at time of adding to cart
- Guest Protection: Login required for cart operations
GET /api/cart- Get user's cartPOST /api/cart/add- Add item to cartPOST /api/cart/update- Update item quantityPOST /api/cart/clear- Clear entire cart
- Search: Full-text search across name, description, category, tags
- Filtering: By category, price range, tags
- Pagination: Efficient loading of large product catalogs
- Sorting: By price, date, popularity
- Images: Multiple image support
- Tags: Flexible tagging system
- Add Products: Rich product creation form
- Manage Inventory: Update stock, prices, descriptions
- Analytics: View sales performance
- Order Management: Process customer orders
- Product Discovery: Help customers find products
- Artisan Guidance: Assist sellers with listing optimization
- Natural Language: Conversational interface
- Context Awareness: Remembers conversation history
- JWT tokens with short expiration
- Refresh token rotation
- Password hashing with bcrypt
- Role-based access control
- Input validation with Zod schemas
- CORS configuration
- SQL injection prevention (NoSQL)
- XSS protection
POST /api/auth/login
POST /api/auth/google/callback
POST /api/auth/logout
POST /api/customer/set-password (Customer signup)
POST /api/students/set-password (Seller signup)
POST /api/faculty/set-password (Services signup)
GET /api/products?q=&category=&tags=&minPrice=&maxPrice=&page=&limit=
POST /api/products (Seller only)
GET /api/seller/products (Seller only)
GET /api/cart
POST /api/cart/add
POST /api/cart/update
POST /api/cart/clear
GET /api/admin/overview
GET /api/admin/sellers
GET /api/admin/customers
-
Environment Setup
- Set production MongoDB URI
- Configure JWT secrets
- Set CORS origins
-
Build & Deploy
npm run build
-
Build for Production
npm run build
-
Deploy to Vercel/Netlify
- Connect your GitHub repository
- Set build command:
npm run build - Set output directory:
dist
cd backend
npm testcd frontend
npm test{
email: String (unique, required)
passwordHash: String
role: String (Admin|Seller|Services|Customer)
name: String
avatar: String
googleId: String
lastLogin: Date
isActive: Boolean
}{
sellerId: ObjectId (ref: User)
name: String (required)
description: String (required)
category: String (required)
price: Number (required)
sku: String
stock: Number
images: [String]
tags: [String]
}{
userId: ObjectId (ref: User, unique)
items: [{
productId: ObjectId (ref: Product)
quantity: Number
priceSnapshot: Number
}]
}- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
For support, email [email protected] or create an issue in the GitHub repository.
- Payment integration (Stripe/PayPal)
- Real-time notifications
- Advanced analytics dashboard
- Mobile app (React Native)
- Multi-language support
- Advanced AI features
- Video product showcases
- Social media integration
Built with β€οΈ for local artisans and craft enthusiasts