Skip to content
All projectsA · Case study · Full-stack restaurant e-commerce & reservations

Bistro Boss

A full-stack restaurant web application featuring Firebase authentication, interactive category menus, Stripe checkout, automated email receipts, and a Recharts analytics admin dashboard.

LiveLearning project2025

React 19 · Express 5 · MongoDB · Firebase Auth · Stripe · TanStack Query · Tailwind CSS 4

Bistro Boss restaurant ordering screens: 30% off offer banner, order-online categories, dessert menu and contact form.
B

Overview

What it is
A complete restaurant ordering, table reservation, and back-office management system.
Why it exists
To engineer an end-to-end culinary commerce application handling dynamic category menus, secure multi-role access (Admin vs. Customer), online card transactions, and real-time sales reporting.
The problem
Online food ordering demands real-time cart synchronization, secure transactional card processing with immediate receipt delivery, and strict role guards so regular diners cannot access kitchen or revenue dashboards.
Who uses it
Diners ordering food online or reserving tables, restaurant managers updating menus, and administrative owners auditing sales.
C

Given / Find

Given

  1. a)Multi-category culinary menus (Salad, Pizza, Soup, Dessert, Drinks, Today’s Special)
  2. b)Customer authentication with Firebase (Email/Password & Google OAuth) backed by MongoDB profiles
  3. c)Card payments that must securely trigger order persistence and inventory tracking without double billing
  4. d)Administrative analytics requiring visual charts for sales trends, item demand, and customer counts

Find

  1. a)A responsive customer cart with optimistic TanStack Query cache updates
  2. b)A robust two-tier authorization system: Firebase Auth on the client paired with verifyJWT and verifyAdmin on Express
  3. c)Stripe PaymentIntent flow with server-side validation and automated Nodemailer order receipt dispatch
  4. d)A Recharts-powered analytics dashboard calculating monthly gross revenue and category-wise sales distribution

Approach

A React 19 single-page application built on Vite and Tailwind CSS v4, communicating with an Express 5 and Mongoose 8 backend. Authentication combines Firebase client SDK with server-side JWT verification and role middleware. Payments run via Stripe Elements and server PaymentIntents, with TanStack Query managing cached menu and cart states.

D

My role

Full-stack developer · all commits across client and server repositories

  • FrontendOwnedArchitected React 19 client with 14 modular routes, TanStack Query hooks, DaisyUI 5, Framer Motion transitions, and Recharts analytics.
  • BackendOwnedBuilt Express 5 REST API with verifyJWT and verifyAdmin middlewares, Stripe payment processing, and Nodemailer email dispatch.
  • Data modelOwnedDesigned 6 Mongoose models (Cart, Category, Menu, Order, Review, User) with indexing on user email and category keys.
E

Stack

Frontend
React 19Vite 7Tailwind CSS 4DaisyUI 5TanStack Query 5Recharts 3Framer Motion 12React Router 7
Backend
Node.jsExpress 5Mongoose 8Firebase Admin SDKJWTNodemailer
Database
MongoDB 6+Mongoose schemas (6 collections)
Auth & security
Firebase Auth (Google & Email/Password)JWT Bearer token verificationRole guards (Admin / User)
Third-party services
Stripe payment gatewayCloudinary CDNGoogle reCAPTCHA v2
Infrastructure
Firebase Hosting (Client)Vercel / Render (API)
F

Key features

  1. F.01

    Interactive culinary menu & category filtering

    Diners explore specialized food categories (Salads, Pizzas, Soups, Desserts, Beverages) with live price tags, ratings, and ingredient descriptions.

  2. F.02

    Stripe card checkout & automated receipts

    Seamless credit card checkout using Stripe Elements; successful payments automatically generate database order records and trigger itemized Nodemailer receipts.

  3. F.03

    Two-tier role-based security

    Client routes and Express endpoints are guarded by JWT tokens and verifyAdmin database checks; unauthorized attempts trigger automatic Axios session invalidation.

  4. F.04

    Recharts visual revenue analytics

    Visualizes historical sales revenue, order volumes, menu item popularity, and user registration velocity through interactive bar and pie charts.

  5. F.05

    Optimistic cart state management

    TanStack Query cache synchronization ensures instant cart badge count updates, deletion animations, and total price re-computations without page refreshes.

  6. F.06

    User reviews & star rating submissions

    Authenticated diners submit verified reviews and star ratings using @smastrom/react-rating, feeding directly into the public testimonial swiper.

G

Architecture

  1. Browser · React 19 Client

    TanStack Query · React Router 7 · Stripe Elements · Recharts

    REST API (JSON with Bearer JWT)
  2. Express 5 REST API

    Middlewares: verifyJWT · verifyAdminRoutes: menu, cart, orders, reviews, users, admin analytics

    Mongoose 8 ODM
  3. MongoDB

    6 collections: users, menu, carts, orders, reviews, categories

Called by the API

Stripe

PaymentIntent processing & card charging

Firebase Auth

user registration & social sign-in

Cloudinary

dish photo uploads via Multer

Nodemailer

automated HTML order invoice delivery

Fig. 1 · Bistro Boss data path: React 19 client, Express 5 API with dual-guard security, Stripe gateway, and MongoDB.
H

Challenges

  1. Problem 01

    Given

    Client-side role spoofing could allow malicious actors to invoke administrative endpoints like deleting menu items or viewing revenue.

    Approach

    Implemented two-phase authorization: the client passes a signed JWT token on every Axios request; the Express server validates the signature and subsequently queries the database to confirm the user’s role equals admin.

    Result

    Administrative actions are completely locked down on both the frontend navigation guards and the API transport layer.
  2. Problem 02

    Given

    Cart state desynchronization when diners add or remove dishes across multiple browser tabs.

    Approach

    Utilized TanStack Query query keys with automatic invalidation (invalidateQueries) on cart mutations and Axios interceptors handling unauthorized token expiry.

    Result

    Real-time cart counts and price calculations stay consistent without full-page reloads.
  3. Problem 03

    Given

    Stripe payment confirmation needs to reliably clear active cart items and create an immutable order history entry.

    Approach

    Engineered a transactional order creation handler that consumes the Stripe transaction ID, persists the order item details, and deletes the matching cart documents in a single atomic sequence.

    Result

    Zero duplicate charges or orphaned cart states following checkout.
I

Results

Outcome

Live at e-commerce-restaurant-79e13.web.app with 109 total commits across client and server repositories.

What I learned

  • Decoupling authentication (Firebase) from business data access (JWT + Mongoose) provides robust flexibility without vendor lock-in.
  • TanStack Query drastically simplifies asynchronous server state and cache synchronization compared to traditional global stores.