Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

118 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🍽️ TableTreats

A full-stack database management and booking platform for restaurants. TableTreats supports two user roles: Customer and Restaurant Owner. Owners register their restaurant and maintain details (menus, hours, tables, availability), while customers browse restaurants, filter/search by features, and make bookings.

🌐 Live Demo

Application URL
Customer App https://table-treats-eight.vercel.app/
Restaurant Owner App https://table-treats-d27w.vercel.app/

πŸ“‘ Table of Contents


πŸ“– Project Description

TableTreats is a full-stack application designed to:

  • Let restaurant owners register and manage their restaurant details, menus, and availability
  • Let customers discover restaurants and make table bookings

Goals

  • βœ… Provide a straightforward onboarding flow for restaurant owners
  • βœ… Allow customers to search restaurants by location, cuisine, rating, price range, and special features
  • βœ… Support bookings with time slots, party size, and booking confirmation
  • βœ… Be easy to run locally and simple to deploy

✨ Features

Customer (User)

  • πŸ” Sign up / Sign in (email/password authentication)
  • πŸ” Browse restaurants with photos and details
  • 🎯 Filter and search (location, cuisine, price, rating, availability)
  • πŸ“‹ View menu images and restaurant details (hours, address, contact)
  • πŸ“… Make, view, or cancel bookings
  • πŸ“§ Receive booking confirmation
  • πŸ’³ Pay bills

Restaurant Owner

  • πŸ” Register and claim owner account
  • πŸͺ Create and manage restaurant profile (name, address, opening hours)
  • πŸ• Add menus images, and ambiance images
  • πŸͺ‘ Configure seating arrangements
  • πŸ“ˆ View booking history along with total customers and total revenue
  • 🎁 Create and manage deals/promotions
  • 🧾 Create bills for customers

πŸ—οΈ Architecture Overview

TableTreats/
β”œβ”€β”€ .gitignore
β”œβ”€β”€ README.md
β”œβ”€β”€ package.json
β”œβ”€β”€ requirements.txt
β”‚
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ requirements.txt
β”‚   └── app/
β”‚       β”œβ”€β”€ __init__.py
β”‚       β”œβ”€β”€ config.py
β”‚       β”œβ”€β”€ database.py
β”‚       β”œβ”€β”€ main.py
β”‚       β”œβ”€β”€ routers/
β”‚       β”‚   β”œβ”€β”€ auth_customer.py
β”‚       β”‚   β”œβ”€β”€ customer_restaurant_router.py
β”‚       β”‚   β”œβ”€β”€ deals.py
β”‚       β”‚   └── reservation_router.py
β”‚       β”œβ”€β”€ schemas/
β”‚       β”‚   β”œβ”€β”€ bill_schema.py
β”‚       β”‚   β”œβ”€β”€ customer_restaurant_schema.py
β”‚       β”‚   β”œβ”€β”€ deal_schema.py
β”‚       β”‚   β”œβ”€β”€ reservation_schema.py
β”‚       β”‚   └── user_schema.py
β”‚       β”œβ”€β”€ services/
β”‚       β”‚   β”œβ”€β”€ bill_service.py
β”‚       β”‚   β”œβ”€β”€ customer_restaurant_service.py
β”‚       β”‚   β”œβ”€β”€ deal_service.py
β”‚       β”‚   β”œβ”€β”€ reservation_service.py
β”‚       β”‚   └── user_service.py
β”‚       └── utils/
β”‚           └── auth.py
β”‚
β”œβ”€β”€ docs/
β”‚   β”œβ”€β”€ api-specs.md
β”‚   └── architecture.md
β”‚
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ customer-app/
β”‚   β”‚   β”œβ”€β”€ public/
β”‚   β”‚   β”‚   └── index.html
β”‚   β”‚   └── src/
β”‚   β”‚       β”œβ”€β”€ assets/
β”‚   β”‚       β”œβ”€β”€ pages/
β”‚   β”‚       β”œβ”€β”€ services/
β”‚   β”‚       β”œβ”€β”€ App.js
β”‚   β”‚       β”œβ”€β”€ App.jsx
β”‚   β”‚       β”œβ”€β”€ index.css
β”‚   β”‚       β”œβ”€β”€ index.js
β”‚   β”‚       └── routes.js
β”‚   β”‚   β”œβ”€β”€ package.json
β”‚   β”‚   β”œβ”€β”€ package-lock.json
β”‚   β”‚   β”œβ”€β”€ postcss.config.js
β”‚   β”‚   └── tailwind.config.js
β”‚   β”‚
β”‚   └── restaurant-app/
β”‚       β”œβ”€β”€ public/
β”‚       └── src/
β”‚           β”œβ”€β”€ api/
β”‚           β”œβ”€β”€ assets/
β”‚           β”œβ”€β”€ components/
β”‚           β”œβ”€β”€ pages/
β”‚           β”œβ”€β”€ App.jsx
β”‚           β”œβ”€β”€ App.css
β”‚           β”œβ”€β”€ index.css
β”‚           └── main.jsx
β”‚       β”œβ”€β”€ package.json
β”‚       β”œβ”€β”€ package-lock.json
β”‚       β”œβ”€β”€ tailwind.config.js
β”‚       β”œβ”€β”€ vite.config.js
β”‚       └── vercel.json
β”‚
└── restaurant_backend/
    β”œβ”€β”€ __init__.py
    β”œβ”€β”€ requirements.txt
    └── app/
        β”œβ”€β”€ config.py
        β”œβ”€β”€ connect_test.py
        β”œβ”€β”€ database.py
        β”œβ”€β”€ main.py
        β”œβ”€β”€ models/
        β”œβ”€β”€ routers/
        β”œβ”€β”€ schemas/
        └── services/

πŸ› οΈ Tech Stack

Frontend

  • React - UI Framework
  • Vite - Build tool (Restaurant App)
  • Create React App - Build tool (Customer App)
  • Tailwind CSS - Styling

Backend

  • FastAPI - Web Framework
  • Uvicorn - ASGI Server
  • Motor - MongoDB Async Driver
  • python-jose - JWT Encoding/Decoding
  • Passlib - Password Hashing

Database

  • MongoDB Atlas - Cloud Database

Deployment

  • Vercel - Frontend Hosting
  • Render - Backend Hosting

πŸ“‹ Prerequisites

  • Git
  • Node.js (v16 or higher)
  • Python 3.10+
  • MongoDB Atlas Account
  • Vercel Account (for frontend deployment)
  • Render Account (for backend deployment)

πŸš€ Setup Guide

1. Clone the Repository

git clone https://github.com/chirag1902/TableTreats.git
cd TableTreats

2. Customer Side Setup

2.1 Customer Backend (Port 8000)

cd backend
python -m venv venv

# Activate virtual environment
# Windows:
venv\Scripts\activate
# macOS/Linux:
source venv/bin/activate

pip install -r requirements.txt

# Create and configure .env file
cp .env.example .env

# Start the server
uvicorn app.main:app --reload --port 8000

βœ… Customer Backend API: http://127.0.0.1:8000

2.2 Customer Frontend (Port 3000)

cd frontend/customer-app
npm install
npm start

βœ… Customer Frontend: http://localhost:3000

3. Restaurant Owner Side Setup

3.1 Restaurant Backend (Port 8001)

cd restaurant_backend
python -m venv venv

# Activate virtual environment
# Windows:
venv\Scripts\activate
# macOS/Linux:
source venv/bin/activate

pip install -r requirements.txt

# Create and configure .env file
cp .env.example .env

# Start the server
uvicorn app.main:app --reload --port 8001

βœ… Restaurant Backend API: http://127.0.0.1:8001

3.2 Restaurant Frontend (Port 5173)

cd frontend/restaurant-app
npm install
npm run dev

βœ… Restaurant Frontend: http://localhost:5173


πŸ” Environment Variables

Create a .env file in both backend/ and restaurant_backend/ directories:

# MongoDB Connection
MONGO_URI=mongodb+srv://<username>:<password>@<cluster>.mongodb.net/?retryWrites=true&w=majority

# JWT Configuration
JWT_SECRET=your_super_secret_key_here
JWT_ALGORITHM=HS256
JWT_EXPIRATION_HOURS=24

⚠️ Security Note: Never commit .env files to version control.


πŸš€ Deployment

Deploying Your Own Instance

Frontend (Vercel)

  1. Fork this repository
  2. Connect your GitHub to Vercel
  3. Import the project
  4. Set the root directory to frontend/customer-app or frontend/restaurant-app
  5. Configure environment variables
  6. Deploy

Backend (Render)

  1. Create a new Web Service on Render
  2. Connect your GitHub repository
  3. Set the root directory to backend or restaurant_backend
  4. Build Command: pip install -r requirements.txt
  5. Start Command: uvicorn app.main:app --host 0.0.0.0 --port $PORT
  6. Add environment variables
  7. Deploy

About

TableTreats is a full-stack restaurant booking and management platform that enables customers to discover restaurants and make reservations, while restaurant owners manage menus, tables, deals, and bookings through dedicated dashboards

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages