Skip to content

Repository files navigation

Restaurant DBMS

Full-stack restaurant management and analytics app built with Next.js and PostgreSQL. The app lets users browse restaurant branches, explore branch menus, and run prebuilt or custom SQL queries against the database for reporting and insights.

Project Statement

Built a full-stack restaurant DBMS web app using Next.js (App Router), React, and PostgreSQL, delivering REST APIs, branch and menu discovery, and a query console for data analysis.

Features

  • Branch directory with search and location-based filtering
  • Branch menu page with categorized items and availability
  • Query console with multiple predefined reporting queries
  • Custom SQL query runner for ad-hoc exploration
  • Login and signup UI screens (UI-only)

Tech Stack

  • Frontend: Next.js 15, React 19, TypeScript, Tailwind CSS
  • Backend: Next.js API routes
  • Database: PostgreSQL (pg)

API Routes

  • GET /api/branches - list all branches
  • GET /api/branch/:id/menu - menu and items for a branch
  • POST /api/query - run predefined or custom SQL

Project Structure

  • app/ - UI pages and components
  • app/api/ - API routes
  • lib/db.ts - Postgres connection

Getting Started

1) Install dependencies

npm install

2) Configure environment variables

Create a .env.local file in the project root and set your database credentials:

PGHOST=localhost
PGPORT=5432
PGUSER=postgres
PGPASSWORD=your_password
PGDATABASE=db
ALLOW_SQL_QUERY=true

Set ALLOW_SQL_QUERY=true only in trusted environments. When disabled, the /api/query endpoint returns 403.

3) Run the app

npm run dev

Open http://localhost:3000 in your browser.

Notes

  • The login and signup flows are UI-only and do not persist user accounts.
  • The query console executes SQL against the configured database. Use it carefully.

Scripts

  • npm run dev - start the development server
  • npm run build - build for production
  • npm run start - run the production build
  • npm run lint - run ESLint

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages