Skip to content

yahia-mosa/Bites

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ” Bites - Real-Time Food Ordering System

A modern, full-stack food ordering web application with real-time order tracking, built with .NET 10, React 19, and SignalR.

Bites Logo

✨ Features

Customer Features

  • Browse Menu - Explore categories (Pizza, Burgers, Appetizers, Desserts, Drinks)
  • Real-Time Order Tracking - Live order status updates via SignalR WebSockets
  • Secure Authentication - JWT-based user authentication
  • Shopping Cart - Add/remove items with quantity management
  • Multiple Payment Options - Stripe integration and Cash on Delivery
  • Order History - View past orders and their status
  • Bilingual Support - English and Arabic (RTL support)
  • Responsive Design - Works seamlessly on desktop and mobile

Admin Features

  • Dashboard - Overview of orders, revenue, and statistics
  • Order Management - View and update order status in real-time
  • Product Management - Add, edit, and delete products
  • Category Management - Organize products by categories
  • Real-Time Notifications - Instant alerts for new orders
  • User Management - View customer information

πŸ›  Tech Stack

Backend

  • .NET 10 - Web API framework
  • Entity Framework Core - ORM for database operations
  • SQL Server - Database (LocalDB)
  • ASP.NET Identity - User authentication and authorization
  • JWT Authentication - Token-based security
  • SignalR - Real-time WebSocket communication
  • Stripe API - Payment processing

Frontend

  • React 19 - UI library
  • Vite - Build tool and dev server
  • Redux Toolkit - State management
  • React Router - Client-side routing
  • TailwindCSS 4 - Styling
  • Lucide React - Icon library
  • i18next - Internationalization (i18n)
  • @microsoft/signalr - SignalR client for React

πŸ“‹ Prerequisites

πŸš€ Installation

1. Clone the Repository

git clone <repository-url>
cd Online-Food-Ordering-Web-Application

2. Backend Setup

Navigate to the backend directory:

cd backend/FoodOrdering.Api

Restore NuGet packages:

dotnet restore

Configure the database connection in appsettings.json:

{
  "ConnectionStrings": {
    "DefaultConnection": "Server=(localdb)\\MSSQLLocalDB;Database=FoodOrderingDb;Trusted_Connection=True;MultipleActiveResultSets=true;TrustServerCertificate=True"
  }
}

Configure JWT settings:

{
  "Jwt": {
    "Key": "Your-Secret-Key-Here",
    "Issuer": "YourIssuer",
    "Audience": "YourAudience"
  }
}

Configure Stripe (optional):

{
  "Stripe": {
    "SecretKey": "sk_test_your_stripe_secret_key",
    "PublishableKey": "pk_test_your_stripe_publishable_key"
  }
}

3. Frontend Setup

Navigate to the frontend directory:

cd frontend

Install dependencies:

npm install

πŸƒ Running the Application

Start the Backend

cd backend/FoodOrdering.Api
dotnet run

The API will be available at:

  • HTTP: http://localhost:5157
  • HTTPS: https://localhost:7056
  • Swagger UI: http://localhost:5157/swagger

Start the Frontend

cd frontend
npm run dev

The frontend will be available at:

  • http://localhost:5173

πŸ“ Project Structure

Online-Food-Ordering-Web-Application/
β”œβ”€β”€ backend/
β”‚   └── FoodOrdering.Api/
β”‚       β”œβ”€β”€ Controllers/          # API endpoints
β”‚       β”œβ”€β”€ Data/                 # Database context and seeding
β”‚       β”œβ”€β”€ Dtos/                 # Data transfer objects
β”‚       β”œβ”€β”€ Hubs/                 # SignalR hubs for real-time
β”‚       β”œβ”€β”€ Models/               # Entity models
β”‚       β”œβ”€β”€ Migrations/           # Database migrations
β”‚       β”œβ”€β”€ Services/             # Business logic services
β”‚       └── Program.cs            # Application entry point
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ public/                   # Static assets
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/           # Reusable components
β”‚   β”‚   β”œβ”€β”€ pages/                # Page components
β”‚   β”‚   β”œβ”€β”€ services/             # API and SignalR services
β”‚   β”‚   β”œβ”€β”€ store/                # Redux state management
β”‚   β”‚   β”œβ”€β”€ App.jsx              # Main app component
β”‚   β”‚   └── main.jsx             # Entry point
β”‚   └── package.json
└── README.md

πŸ” Default Accounts

Admin Account

Customer Account

🌐 API Endpoints

Authentication

  • POST /api/auth/register - Register new user
  • POST /api/auth/login - Login user
  • GET /api/auth/profile - Get user profile

Products

  • GET /api/categories - Get all categories
  • GET /api/products - Get all products
  • POST /api/products - Create product (Admin)
  • PUT /api/products/{id} - Update product (Admin)
  • DELETE /api/products/{id} - Delete product (Admin)

Orders

  • POST /api/orders - Place order
  • GET /api/orders/my-orders - Get user orders
  • GET /api/orders/admin-orders - Get all orders (Admin)
  • GET /api/orders/{id} - Get order by ID
  • PUT /api/orders/{id}/status - Update order status (Admin)

Payments

  • POST /api/payments/create-intent - Create Stripe payment intent

SignalR Hub

  • /hubs/order - Real-time order updates

πŸ—„οΈ Database

The application uses Entity Framework Core with Code First migrations. The database is automatically created and seeded with:

  • 5 food categories
  • 20 products (4 per category)
  • Admin and customer demo users

🌍 Internationalization

The application supports English and Arabic languages. Language switching is available in the navigation bar.

πŸ“± Real-Time Features

Using SignalR WebSockets, the application provides:

  • Instant order status updates - Customers see status changes immediately
  • Live admin notifications - Admins receive new orders instantly
  • Automatic reconnection - Handles connection drops gracefully

πŸ”§ Configuration

CORS

The backend is configured to allow requests from:

  • http://localhost:5173
  • http://localhost:5174
  • https://localhost:5173
  • https://localhost:5174

Environment Variables

Key configuration is in appsettings.json:

  • Database connection string
  • JWT secret key
  • Stripe API keys

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“ License

This project is licensed under the MIT License.

πŸ‘₯ Authors

  • Development Team

πŸ™ Acknowledgments

  • Food images from Unsplash
  • Icons from Lucide
  • UI components inspired by modern food delivery platforms

πŸ“ž Support

For support, email support@bites.com or open an issue in the repository.


Built with ❀️ using .NET and React

About

πŸ” Bites - Real-Time Food Ordering System Full-stack food ordering app with real-time tracking, admin dashboard, and payments. Built with .NET 10, React 19, SignalR, and TailwindCSS.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors