Skip to content

jayanth-programmer/ordering_system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Mini Ordering System with Cart Functionality

A complete MERN stack application for food ordering with cart functionality, built using MongoDB, Express, React, and Node.js.

πŸš€ Features

  • Menu Display: Beautiful grid layout showing food items with images, names, and prices
  • Shopping Cart: Add/remove items, update quantities, and view total
  • Order Processing: Server-side validation and order placement
  • Responsive Design: Modern UI built with Tailwind CSS
  • State Management: React Context API for cart state
  • Real-time Updates: Dynamic cart calculations and updates

πŸ› οΈ Tech Stack

Backend

  • Node.js + Express
  • MongoDB + Mongoose
  • CORS middleware
  • Error handling

Frontend

  • React 19
  • React Router DOM
  • Tailwind CSS
  • Axios for API calls
  • Context API for state management

πŸ“ Project Structure

β”œβ”€β”€ server/                 # Backend
β”‚   β”œβ”€β”€ models/            # MongoDB schemas
β”‚   β”œβ”€β”€ routes/            # API endpoints
β”‚   β”œβ”€β”€ server.js          # Main server file
β”‚   β”œβ”€β”€ seed.js            # Database seeding
β”‚   └── package.json       # Backend dependencies
β”œβ”€β”€ client/                # Frontend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/    # Reusable components
β”‚   β”‚   β”œβ”€β”€ contexts/      # React contexts
β”‚   β”‚   β”œβ”€β”€ pages/         # Page components
β”‚   β”‚   β”œβ”€β”€ services/      # API services
β”‚   β”‚   β”œβ”€β”€ App.jsx        # Main app component
β”‚   β”‚   └── main.jsx       # Entry point
β”‚   β”œβ”€β”€ tailwind.config.js # Tailwind configuration
β”‚   └── package.json       # Frontend dependencies
└── README.md

πŸš€ Getting Started

Prerequisites

  • Node.js (v16 or higher)
  • MongoDB (local or Atlas)
  • npm or yarn

Backend Setup

  1. Navigate to server directory:

    cd server
  2. Install dependencies:

    npm install
  3. Set up environment variables: Create a .env file in the server directory:

    MONGODB_URI=mongodb://localhost:27017/ordering-system
    PORT=5000
    
  4. Start MongoDB: Make sure MongoDB is running on your system or update the MONGODB_URI in .env

  5. Seed the database:

    npm run seed
  6. Start the server:

    npm run dev

    The backend will run on http://localhost:5000

Frontend Setup

  1. Navigate to client directory:

    cd client
  2. Install dependencies:

    npm install
  3. Start the development server:

    npm run dev

    The frontend will run on http://localhost:5173

πŸ“± API Endpoints

Menu

  • GET /api/menu - Get all menu items

Cart/Orders

  • POST /api/cart - Place order (accepts cart items)

Admin

  • GET /api/orders - Get all orders

🎨 UI Features

  • Gradient Backgrounds: Beautiful blue to purple gradients
  • Card Design: Modern cards with hover effects and shadows
  • Responsive Grid: Mobile-friendly layout that adapts to screen size
  • Interactive Elements: Hover effects, transitions, and animations
  • Clean Typography: Consistent font hierarchy and spacing

πŸ”§ Customization

Adding New Menu Items

  1. Add items to server/seed.js
  2. Run npm run seed to update the database

Styling Changes

  • Modify client/src/index.css for custom CSS
  • Update client/tailwind.config.js for theme changes

API Modifications

  • Edit route files in server/routes/
  • Update models in server/models/

#Screen Shots WhatsApp Image 2025-08-29 at 18 05 48_481bb85a WhatsApp Image 2025-08-29 at 18 02 56_9a78dfe6 WhatsApp Image 2025-08-29 at 18 03 21_a2bd1abe image WhatsApp Image 2025-08-29 at 18 06 18_75d5c083 image WhatsApp Image 2025-08-29 at 18 07 29_e6ab2ff6 WhatsApp Image 2025-08-29 at 18 08 33_ec3a5b0a

πŸ†˜ Support

If you encounter any issues:

  1. Check the console for error messages
  2. Verify MongoDB connection
  3. Ensure all dependencies are installed
  4. Check API endpoints are accessible

Happy Coding! πŸŽ‰

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published