Complete guide to get the entire E-Commerce platform running on your local machine in under 10 minutes!
The project comes with pre-configured sample.env files. You only need to:
- Update MySQL and other sample.env credentials
- Add your Firebase
google-services.jsonfile - That's it! Ready to run.
# Extract the ZIP file
# Navigate to the extracted folder
cd E-Commerce
# Install backend dependencies
cd backend
npm install
# Install admin dependencies
cd ../Admin
npm install
# Install mobile app dependencies
cd ../frontend
npm install
cd ..# Login to MySQL
mysql -u root -p
# Create database
CREATE DATABASE ecommerce;
exit;cd backend
```env
# Find this line in sample.env and update YOUR_MYSQL_PASSWORD
DATABASE_URL="mysql://root:YOUR_MYSQL_PASSWORD@localhost:3306/ecommerce"Save and exit (Ctrl+X, then Y, then Enter)
# Still in backend directory
npx prisma migrate deploy
npx prisma generate- Go to Firebase Console
- Select the project: fir-auth01-10f58 (or create if needed)
- Download google-services.json:
- Go to Project Settings → Your apps → Android app
- Click "Download google-services.json"
- Copy to project:
# Replace /path/to/downloaded/ with actual path cp /path/to/downloaded/google-services.json ./google-services.json
cd ../frontend
# Get your computer's local IP address
# macOS/Linux:
ipconfig getifaddr en0
# Windows (PowerShell):
# (Get-NetIPAddress -AddressFamily IPv4 -InterfaceAlias Wi-Fi).IPAddress
# Open .env file and update YOUR_LOCAL_IP
nano .envUpdate this line with your actual IP:
EXPO_PUBLIC_API_BASE_URL=http://YOUR_LOCAL_IP:8080/api
# Example: EXPO_PUBLIC_API_BASE_URL=http://192.168.1.100:8080/apiSave and exit (Ctrl+X, then Y, then Enter)
Terminal 1 - Backend:
cd E-Commerce/backend
npm run dev✅ Backend running at http://localhost:8080
Terminal 2 - Admin Dashboard:
cd E-Commerce/Admin
npm run dev✅ Admin at http://localhost:5173
Terminal 3 - Mobile App:
cd E-Commerce/frontend
npm run dev✅ Scan QR code with Expo Go app
- Install Expo Go on your phone (iOS | Android)
- Scan QR code from Terminal 3
⚠️ Note: Google Sign-In and Stripe won't work in Expo Go
# Install EAS CLI globally
npm install -g eas-cli
# Login to Expo (create account if needed)
eas login
# Build for Android cloud based on expo eas dashboard
cd E-Commerce/frontend
eas build --profile development --platform android
After build completes, download and install the APK/IPA on your device.
# Build for Android locally
cd E-Commerce/frontend
eas build --local --platform android --profile preview
## ✅ Verify Everything Works
### Test Backend:
```bash
curl http://localhost:8080/api/productsShould return product list (or empty array)
- Open
http://localhost:3001in browser - You should see the admin dashboard
- Open app on phone
- Browse products
- Test Google Sign-In (requires development build)
| Issue | Solution |
|---|---|
| "Cannot connect to database" | 1. Check MySQL is running: mysql -u root -p2. Verify DATABASE_URL in backend/config/config.env3. Ensure database exists: CREATE DATABASE ecommerce; |
| "Mobile can't reach API" | 1. Use local IP (not localhost) in frontend/.env2. Ensure phone and computer on same WiFi 3. Check firewall allows port 8080 |
| "Prisma Client not found" | Run: cd backend && npx prisma generate |
| "Google Sign-In error" | 1. Ensure google-services.json is in frontend/ folder2. Build development build with EAS (won't work in Expo Go) 3. Use the correct Firebase project |
| "Module not found" | Delete node_modules folder and run npm install again |
| "Port already in use" | Kill the process: lsof -ti:8080 | xargs kill -9 (or change PORT in config/config.env) |
- ✅ Add Products: Use Admin Dashboard (
http://localhost:5173) to add products - ✅ Test Payments: Use Stripe test card:
4242 4242 4242 4242(any future date, any CVC) - ✅ Explore Features: Try cart, wishlist, AR preview, and order tracking
- ✅ Customize: Update colors, branding, and features to match your brand
- ✅ Deploy: Follow deployment guides for production when ready
The project includes pre-configured credentials for:
- ✅ Firebase Authentication (Google Sign-In)
- ✅ Stripe Payments (Test Mode)
- ✅ Cloudinary (Image Storage)
- ✅ JWT Authentication
You only need to:
- Update MySQL password
- Add
google-services.jsonfor mobile app
# View database in browser
cd backend
npx prisma studio
# Reset database (⚠️ Deletes all data)
cd backend
npx prisma migrate reset
# Check backend logs
cd backend
npm run dev
- Check the Common Issues section
- Verify all prerequisites are installed
- Ensure all environment variables are set correctly
- Check terminal logs for specific error messages
Authors:
Muhammad Yaafay SE-23023
Adil Javed SE-23025