A professional food ordering website with a Node.js backend for managing orders.
HANDS ON - WEB/
├── home.html # Homepage
├── index.html # Menu & Ordering page
├── style.css # All styling
├── script.js # Frontend JavaScript
├── server.js # Backend server (Node.js)
├── package.json # Dependencies
└── data/
├── orders.json # Saved customer orders
└── products.json # Product catalog
Download and install Node.js from https://nodejs.org/
Open terminal in your project folder and run:
npm installThis will install:
- express: Web server framework
- cors: Enable cross-origin requests
- nodemon: Auto-reload during development
npm startYou should see:
🚀 PasTeallas Server running on http://localhost:3000
Open home.html in your browser:
- Click "Order Now" to go to menu
- Add products to cart
- Click "Proceed to Checkout"
- Fill in your details and submit
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/products |
Get all products |
| POST | /api/orders |
Place a new order |
| GET | /api/orders |
Get all orders (admin) |
| GET | /api/orders/:orderId |
Get specific order |
| GET | /api/health |
Server health check |
When you place an order:
- Your order data is sent to the server
- Server generates an Order ID (ORD-timestamp)
- Order is saved to
data/orders.json - You receive confirmation with Order ID
Example order file:
{
"orders": [
{
"id": "ORD-1712760123456",
"items": [
{"name": "Burger", "price": 100, "quantity": 2}
],
"total": 200,
"customerName": "John",
"customerPhone": "09123456789",
"status": "pending",
"createdAt": "2026-04-10T10:30:00.000Z"
}
]
}Error: "Cannot find module"
→ Run npm install again
Error: "Port 3000 already in use" → Change PORT in server.js or close other apps using port 3000
Orders not saving?
→ Check that data/ folder exists and has both JSON files
CORS errors? → Make sure server is running on http://localhost:3000
- ✅ Basic ordering system works!
- 📧 Add email notifications to customers
- 🔐 Add user authentication (login/signup)
- 💳 Add payment integration (Stripe, PayMongo)
- 📱 Build mobile app version
- 📊 Create admin dashboard
- Frontend: HTML, CSS, JavaScript (Vanilla)
- Backend: Node.js + Express
- Database: JSON files (can upgrade to MongoDB)
- API: REST API
Made with ❤️ for PasTeallas