Skip to content

opeblow/NEXUS_RESTAURANT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NEXUS Restaurant - Full-Stack AI Application

A modern full-stack web application for restaurant management powered by AI. Converted from a terminal-based assistant to a production-ready web application.

Features

  • AI Chat Interface: Conversational interface powered by LangChain + GPT-4 with streaming responses
  • Table Reservations: Book tables with real-time availability checking
  • Menu Browsing: View and search menu items by category with dietary filters
  • Order Management: Place orders for delivery/pickup and track status
  • JWT Authentication: Secure user authentication system
  • Modern Premium UI: Dark theme with glassmorphism effects

Project Structure

nexus/
├── backend/                     # FastAPI Backend
│   ├── app/
│   │   ├── api/routes/         # API endpoints
│   │   │   ├── auth.py         # Authentication routes
│   │   │   ├── tables.py       # Table management
│   │   │   ├── reservations.py # Reservation endpoints
│   │   │   ├── orders.py       # Order & Menu endpoints
│   │   │   └── chat.py         # AI chat with streaming
│   │   ├── core/               # Config & Security (JWT)
│   │   ├── db/                 # Database session
│   │   ├── models/             # SQLAlchemy ORM models
│   │   ├── schemas/            # Pydantic request/response schemas
│   │   ├── services/           # Business logic layer
│   │   └── main.py             # FastAPI application entry
│   ├── requirements.txt
│   └── .env.example
├── frontend/                    # Next.js Frontend
│   ├── app/
│   │   ├── chat/               # AI Chat page with streaming
│   │   ├── menu/               # Menu browsing
│   │   ├── reservations/       # Reservation management
│   │   ├── orders/             # Order tracking
│   │   └── login/              # Authentication
│   ├── components/              # Reusable UI components
│   └── lib/                     # API client & state management
└── README.md

Quick Start

Backend Setup

cd backend
python -m venv venv
source venv/bin/activate  # Windows: venv\Scripts\activate
pip install -r requirements.txt

# Configure environment
cp .env.example .env
# Edit .env and add your OPENAI_API_KEY

# Run server
uvicorn app.main:app --reload --port 8000

Frontend Setup

cd frontend
npm install
npm run dev

Access the app at http://localhost:3000

API Endpoints

Authentication

Method Endpoint Description
POST /api/v1/auth/register Register new user
POST /api/v1/auth/login Login (returns JWT)
GET /api/v1/auth/me Get current user

Menu

Method Endpoint Description
GET /api/v1/menu List all menu items
GET /api/v1/menu/categories Get all categories
GET /api/v1/menu/search?q= Search items

Reservations

Method Endpoint Description
GET /api/v1/reservations List user reservations
POST /api/v1/reservations Create reservation
PATCH /api/v1/reservations/{id} Update reservation
POST /api/v1/reservations/{id}/cancel Cancel reservation

Orders

Method Endpoint Description
GET /api/v1/orders List user orders
POST /api/v1/orders Create order
POST /api/v1/orders/{id}/cancel Cancel order

Chat (Streaming)

Method Endpoint Description
POST /api/v1/chat/message Send message (non-streaming)
POST /api/v1/chat/stream Send message (SSE streaming)

Tech Stack

Backend

  • FastAPI - Modern Python web framework
  • SQLAlchemy - ORM with SQLite database
  • Pydantic - Data validation
  • python-jose - JWT token handling
  • LangChain + OpenAI - AI/LLM integration

Frontend

  • Next.js 14 - React framework
  • TailwindCSS - Utility-first styling
  • Zustand - State management
  • Lucide React - Icon library

Database Schema

Users

  • id, email, username, hashed_password, full_name, phone, is_admin, created_at

Tables

  • id, table_number, capacity, status, description

Reservations

  • id, user_id, table_id, party_size, reservation_date, status, event_id, created_at

MenuItems

  • id, name, description, category, price, is_available, is_vegetarian, is_vegan, is_gluten_free

Orders

  • id, user_id, order_number, status, order_type, subtotal, delivery_fee, tax, total, payment_status

OrderItems

  • id, order_id, menu_item_id, quantity, unit_price, subtotal

ChatSessions & ChatMessages

  • Session tracking and message history

Original Terminal Version

This project was converted from a terminal-based AI assistant. The original main.py and mcp.py files are preserved in the root directory for reference.

License

MIT

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors