# SMART FOOD ORDERING SYSTEM
## Quick Start Guide
---
## 🚀 GET STARTED IN 5 MINUTES
### Step 1: Setup Backend (2 minutes)
1. **Start XAMPP**
```
- Open XAMPP Control Panel
- Start Apache
- Start MySQL
```
2. **Create Database**
```
- Open browser: http://localhost/phpmyadmin
- Click "New" to create database
- Database name: smart_food_ordering
- Collation: utf8mb4_general_ci
- Click "Create"
```
3. **Import Database**
```
- Select "smart_food_ordering" database
- Click "Import" tab
- Choose file: C:\xampp\htdocs\food\database\schema.sql
- Click "Go"
- Wait for success message
```
4. **Verify Installation**
```
- Open: http://localhost/food/admin/
- You should see the login page
```
### Step 2: Login to Admin Panel (1 minute)
1. **Access Admin Panel**
```
URL: http://localhost/food/admin/
Username: admin
Password: admin123
```
2. **Explore Dashboard**
- View statistics
- Check sample data
- Navigate through menu
### Step 3: Setup Flutter App (2 minutes)
1. **Install Dependencies**
```bash
cd C:\xampp\htdocs\food\flutter_app
flutter pub get
```
2. **Configure API URL**
- Open: `lib/constants/app_constants.dart`
- For Android Emulator: Keep `http://10.0.2.2/food/`
- For Physical Device: Change to `http://YOUR_IP/food/`
3. **Run App**
```bash
flutter run
```
---
## 📱 TEST THE SYSTEM
### Test Admin Panel
1. **Dashboard**
- View statistics
- Check recent orders
- See best-selling foods
2. **Categories**
- Navigate to Categories page
- View 6 sample categories
- Try adding a new category
3. **Foods**
- Navigate to Foods page
- View 12 sample foods
- Try adding a new food item
4. **Orders**
- Navigate to Orders page
- Will be empty initially
- Orders will appear after mobile app usage
### Test Mobile App
1. **Register New User**
- Open app
- Click "Sign Up"
- Fill registration form
- Submit
2. **Browse Foods**
- View categories
- Browse featured foods
- Search for foods
3. **Add to Cart**
- Click on any food
- Select quantity
- Add to cart
- View cart badge
4. **Place Order**
- Go to cart
- Proceed to checkout
- Enter delivery details
- Select payment method
- Place order
5. **Track Order**
- Go to Orders tab
- View your order
- Check order status
6. **Admin Verification**
- Go back to admin panel
- Refresh Orders page
- See the new order
- Update order status
---
## 🎯 DEFAULT CREDENTIALS
### Admin Panel
```
URL: http://localhost/food/admin/
Username: admin
Password: admin123
```
### Database
```
Host: localhost
Username: root
Password: (empty)
Database: smart_food_ordering
```
---
## 📂 IMPORTANT FILES
### Configuration Files
```
config/config.php - Application settings
config/database.php - Database connection
```
### Admin Files
```
admin/login.php - Admin login
admin/index.php - Dashboard
admin/pages/ - All admin pages
```
### API Files
```
api/login.php - User login
api/register.php - User registration
api/foods.php - Foods API
api/cart.php - Cart API
api/place_order.php - Order API
```
### Flutter Files
```
lib/main.dart - App entry
lib/constants/app_constants.dart - Configuration
lib/screens/ - All screens
lib/services/api_service.dart - API calls
```
---
## 🔧 CONFIGURATION
### Change Base URL (Flutter App)
Edit: `flutter_app/lib/constants/app_constants.dart`
```dart
// For localhost (Android Emulator)
static const String baseUrl = 'http://10.0.2.2/food/';
// For localhost (iOS Simulator)
static const String baseUrl = 'http://localhost/food/';
// For physical device (replace with your IP)
static const String baseUrl = 'http://192.168.1.100/food/';
// For production
static const String baseUrl = 'https://yourdomain.com/food/';
```
### Change Database Credentials
Edit: `config/database.php`
```php
define('DB_HOST', 'localhost');
define('DB_USER', 'root');
define('DB_PASS', '');
define('DB_NAME', 'smart_food_ordering');
```
---
## 🎨 CUSTOMIZE
### Change Colors (Admin)
Edit: `admin/includes/sidebar.php` and other files
```html
```
### Change Colors (Flutter)
Edit: `flutter_app/lib/constants/app_constants.dart`
```dart
static const Color primaryColor = Color(0xFFFF6B35);
static const Color secondaryColor = Color(0xFFF7931E);
```
### Change Restaurant Name
**Admin Panel:**
- Login to admin
- Go to Settings
- Update restaurant name
**Database:**
```sql
UPDATE settings SET setting_value = 'Your Restaurant Name'
WHERE setting_key = 'restaurant_name';
```
---
## 📊 SAMPLE DATA
The system comes with:
- ✅ 1 Admin user
- ✅ 6 Categories (Burgers, Pizza, Pasta, Chicken, Desserts, Beverages)
- ✅ 12 Food items
- ✅ 12 Settings
---
## 🐛 TROUBLESHOOTING
### Issue: Can't access admin panel
**Solution:**
```
1. Check if Apache is running in XAMPP
2. Verify URL: http://localhost/food/admin/
3. Check if files are in C:\xampp\htdocs\food\
```
### Issue: Database connection error
**Solution:**
```
1. Check if MySQL is running in XAMPP
2. Verify database exists: smart_food_ordering
3. Check credentials in config/database.php
```
### Issue: Flutter app can't connect to API
**Solution:**
```
1. Check if Apache is running
2. Verify API URL in app_constants.dart
3. For emulator: use http://10.0.2.2/food/
4. For device: use http://YOUR_IP/food/
5. Check firewall settings
```
### Issue: Images not uploading
**Solution:**
```
1. Check folder permissions for uploads/
2. Verify folder exists: uploads/foods/, uploads/categories/
3. Check file size (max 5MB)
4. Check file type (jpg, jpeg, png, gif)
```
### Issue: Flutter build errors
**Solution:**
```bash
flutter clean
flutter pub get
flutter run
```
---
## 📱 FIND YOUR IP ADDRESS
### Windows
```cmd
ipconfig
# Look for IPv4 Address
```
### Mac/Linux
```bash
ifconfig
# Look for inet address
```
### Use in Flutter App
```dart
static const String baseUrl = 'http://YOUR_IP/food/';
// Example: 'http://192.168.1.100/food/'
```
---
## ✅ VERIFICATION CHECKLIST
### Backend
- [ ] XAMPP Apache running
- [ ] XAMPP MySQL running
- [ ] Database created
- [ ] Schema imported
- [ ] Admin panel accessible
- [ ] Can login to admin
### Flutter App
- [ ] Dependencies installed
- [ ] API URL configured
- [ ] App builds successfully
- [ ] App runs on device/emulator
- [ ] Can register user
- [ ] Can login
- [ ] Can browse foods
- [ ] Can add to cart
- [ ] Can place order
---
## 🎓 LEARNING PATH
### For Beginners
1. **Explore Admin Panel**
- Login and navigate
- Add categories
- Add foods
- View dashboard
2. **Test Mobile App**
- Register account
- Browse foods
- Place test order
3. **Understand Flow**
- Customer places order
- Admin receives order
- Admin updates status
- Customer sees updates
### For Developers
1. **Study Code Structure**
- Review folder structure
- Understand MVC pattern
- Check API endpoints
2. **Database Schema**
- Review tables
- Understand relationships
- Check indexes
3. **Customize**
- Change colors
- Add features
- Modify UI
---
## 📚 NEXT STEPS
1. **Add Your Data**
- Add real categories
- Add real food items
- Upload real images
2. **Customize Design**
- Change colors
- Update logo
- Modify layouts
3. **Configure Settings**
- Set delivery fee
- Set operating hours
- Update contact info
4. **Test Thoroughly**
- Place test orders
- Update order status
- Check notifications
5. **Deploy**
- Get hosting
- Upload files
- Configure domain
- Update API URLs
---
## 🆘 NEED HELP?
### Documentation
- README.md - Complete documentation
- API_DOCUMENTATION.md - API reference
- SYSTEM_OVERVIEW.md - Feature list
### Common Tasks
- Adding food: Admin → Foods → Add New
- Managing orders: Admin → Orders
- Viewing reports: Admin → Reports
- Changing settings: Admin → Settings
---
## 🎉 YOU'RE READY!
Your Smart Food Ordering System is now set up and ready to use!
**Admin Panel**: http://localhost/food/admin/
**Mobile App**: Running on your device/emulator
Start exploring and customizing your system!
---
**Quick Start Version**: 1.0.0
**Last Updated**: 2024