A modern, full-stack e-commerce platform for handmade crochet products built with React, TypeScript, Express, and MongoDB.
- ποΈ Browse and search products
- π Shopping cart management
- π€ User authentication and profiles
- π¦ Order placement and tracking
- β Product reviews and ratings
- π± Fully responsive design
- π Analytics dashboard
- π·οΈ Product management (CRUD)
- π Order processing and status updates
- βοΈ Store settings configuration
- π₯ User management
bubblycrochet/
βββ backend/ # Express + MongoDB API
β βββ src/
β β βββ config/ # Database configuration
β β βββ models/ # Mongoose schemas
β β βββ controllers/ # Request handlers
β β βββ routes/ # API routes
β β βββ middleware/ # Auth & validation
β β βββ services/ # Business logic
β β βββ server.ts # Entry point
β βββ package.json
β βββ tsconfig.json
β
βββ frontend/ # React + TypeScript
βββ src/
β βββ components/ # UI components
β β βββ client/ # Client-facing
β β βββ admin/ # Admin panel
β βββ services/ # API integration
β βββ App.tsx
β βββ types.ts
βββ package.json
βββ vite.config.ts
- Node.js (v18 or higher)
- MongoDB (local installation or MongoDB Atlas account)
- npm or yarn
- Navigate to backend directory:
cd backend- Install dependencies:
npm install- Create environment file:
cp .env.example .env- Update
.envwith your MongoDB URI and other settings:
MONGODB_URI=mongodb://localhost:27017/bubblycrochet
JWT_SECRET=your_secret_key_here
PORT=5000
FRONTEND_URL=http://localhost:3000- Start the backend server:
npm run devBackend will run on http://localhost:5000
- Navigate to frontend directory:
cd frontend- Install dependencies:
npm install- Create environment file:
cp .env.example .env- Update
.env:
VITE_API_URL=http://localhost:5000/api- Start the frontend development server:
npm run devFrontend will run on http://localhost:3000
POST /api/auth/register- Register new userPOST /api/auth/login- User loginGET /api/auth/me- Get current user
GET /api/products- Get all productsGET /api/products/:id- Get single productPOST /api/products- Create product (Admin)PUT /api/products/:id- Update product (Admin)DELETE /api/products/:id- Delete product (Admin)
POST /api/orders- Create orderGET /api/orders/my-orders- Get user ordersGET /api/orders- Get all orders (Admin)PUT /api/orders/:id/status- Update order status (Admin)
GET /api/reviews/product/:productId- Get product reviewsPOST /api/reviews- Create reviewPUT /api/reviews/:id- Update reviewDELETE /api/reviews/:id- Delete review
GET /api/settings- Get store settingsPUT /api/settings- Update settings (Admin)
- email, password, name, role
- address, phone, bio, interests
- avatar, isActive, timestamps
- name, description, price, category
- images, inStock, discount
- daysToMake, shippingCost
- timestamps
- userId, userName, contactEmail
- shippingAddress, items[]
- totalAmount, shippingTotal
- specialRequest, status
- timestamps
- productId, userId, userName
- rating (1-5), comment
- timestamps
- storeName, ownerName
- contactEmail, contactPhone
- shopLocation, logoUrl
- social media URLs
- copyrightText
- Express.js - Web framework
- TypeScript - Type safety
- MongoDB - Database
- Mongoose - ODM
- JWT - Authentication
- bcryptjs - Password hashing
- React 19 - UI library
- TypeScript - Type safety
- Vite - Build tool
- Axios - HTTP client
- Lucide React - Icons
- Recharts - Analytics charts
- D3.js - Data visualizations
npm run dev # Start development server with hot reload
npm run build # Build for production
npm start # Start production servernpm run dev # Start development server
npm run build # Build for production
npm run preview # Preview production buildNODE_ENV=production
PORT=5000
MONGODB_URI=your_mongodb_atlas_connection_string
JWT_SECRET=your_super_secret_jwt_key_minimum_32_characters
JWT_EXPIRE=7d
FRONTEND_URL=https://your-app.vercel.app
ADMIN_URL=https://your-app.vercel.app/admin.html
ALLOWED_ORIGINS=https://your-app.vercel.appVITE_API_URL=https://your-app.vercel.app/api
GEMINI_API_KEY=your_gemini_api_key_if_using_ai_featuresNote: Never commit .env files to Git. Use .env.example files as templates.
To test the API, you can use:
- Postman or Insomnia
- Thunder Client (VS Code extension)
- curl commands
Health check endpoint:
curl http://localhost:5000/api/healthThis project is configured for seamless deployment to Vercel. See DEPLOYMENT.md for complete deployment guide.
-
Prerequisites
- MongoDB Atlas account with cluster set up
- Vercel account connected to GitHub
- Environment variables prepared
-
Deploy to Vercel
# Install Vercel CLI npm i -g vercel # Login and deploy vercel login vercel
-
Configure Environment Variables in Vercel Dashboard
MONGODB_URI- Your MongoDB Atlas connection stringJWT_SECRET- Strong secret key (min 32 characters)FRONTEND_URL- Your Vercel app URLADMIN_URL- Your Vercel app URL/admin.htmlALLOWED_ORIGINS- Your Vercel app URLVITE_API_URL- Your Vercel app URL/api
-
Access Your Application
- Client:
https://your-app.vercel.app - Admin:
https://your-app.vercel.app/admin.html - API:
https://your-app.vercel.app/api
- Client:
vercel.json- Vercel configuration.env.example- Environment variable templateDEPLOYMENT.md- Detailed deployment guidePRODUCTION_CHECKLIST.md- Pre-deployment checklist
- Railway
- Render
- Heroku
- DigitalOcean App Platform
- AWS Elastic Beanstalk
- Netlify
- AWS S3 + CloudFront
- GitHub Pages
- Firebase Hosting
See DEPLOYMENT.md for detailed instructions.
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Open a Pull Request
This project is licensed under the MIT License.
Built with β€οΈ for Bubbly Crochet
For issues and questions, please open an issue in the GitHub repository.