Skip to content

Andrizzzz/Pasteallas

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PasTeallas Food Ordering System

A professional food ordering website with a Node.js backend for managing orders.

📁 Project Structure

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

🚀 Setup Instructions

Step 1: Install Node.js

Download and install Node.js from https://nodejs.org/

Step 2: Install Dependencies

Open terminal in your project folder and run:

npm install

This will install:

  • express: Web server framework
  • cors: Enable cross-origin requests
  • nodemon: Auto-reload during development

Step 3: Start the Server

npm start

You should see:

🚀 PasTeallas Server running on http://localhost:3000

Step 4: Open Your Website

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

📡 API Endpoints

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

💾 How Orders Are Saved

When you place an order:

  1. Your order data is sent to the server
  2. Server generates an Order ID (ORD-timestamp)
  3. Order is saved to data/orders.json
  4. 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"
    }
  ]
}

🛠️ Troubleshooting

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

📝 Next Steps

  1. ✅ Basic ordering system works!
  2. 📧 Add email notifications to customers
  3. 🔐 Add user authentication (login/signup)
  4. 💳 Add payment integration (Stripe, PayMongo)
  5. 📱 Build mobile app version
  6. 📊 Create admin dashboard

🔧 Technology Stack

  • Frontend: HTML, CSS, JavaScript (Vanilla)
  • Backend: Node.js + Express
  • Database: JSON files (can upgrade to MongoDB)
  • API: REST API

Made with ❤️ for PasTeallas

Releases

Packages

Contributors

Languages