Before running the application, ensure you have:
- ✅ Node.js installed (check:
node --version) ⚠️ MySQL needs to be installed
- Download from: https://dev.mysql.com/downloads/installer/
- Run the installer and choose "Developer Default"
- Set root password during installation (or leave empty for local dev)
- Complete the installation
- Download XAMPP: https://www.apachefriends.org/
- Install XAMPP (includes MySQL)
- Start MySQL from XAMPP Control Panel
- If using XAMPP: Open XAMPP Control Panel and click "Start" for MySQL
- If using standalone MySQL: MySQL should start automatically
Option A: Using MySQL Command Line
mysql -u root -p
# Enter your MySQL password (or just press Enter if no password)Then run:
source schema.sql
exitOption B: Using phpMyAdmin (with XAMPP)
- Go to http://localhost/phpmyadmin
- Click "Import" tab
- Choose
schema.sqlfile - Click "Go"
Option C: Create manually in MySQL Workbench
- Open MySQL Workbench
- Open
schema.sqlfile - Execute the script
Edit .env and set your MySQL password:
DB_PASSWORD=your_password_hereIf you have no password (local development), leave it empty:
DB_PASSWORD=# Development mode (auto-restart on changes)
npm run dev
# Or production mode
npm startYou should see:
============================================
🍽️ RESTAURANT BACKEND API
============================================
✅ Server running on port 3000
📍 Local: http://localhost:3000
🏥 Health check: http://localhost:3000/health
============================================
Open your browser or use curl:
# Test health endpoint
curl http://localhost:3000/health
# Test menu endpoint
curl http://localhost:3000/api/menu
# Test creating a menu item
curl -X POST http://localhost:3000/api/menu -H "Content-Type: application/json" -d "{\"name\":\"New Dish\",\"description\":\"Delicious food\",\"price\":15.99,\"category\":\"Main Course\"}"Solution: MySQL is not installed. Follow the MySQL installation steps above.
Solution: Update the password in .env file to match your MySQL root password.
Solution: Run the schema.sql file to create the database and tables.
Solution: Change the PORT in .env file:
PORT=3001Once the application runs locally:
- ✅ Test all API endpoints
- ✅ Commit to GitHub
- 🚀 Deploy to AWS EC2 or Elastic Beanstalk
- 🗄️ Use AWS RDS for production MySQL database
Need Help? Check the main README.md for detailed API documentation.