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.
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.
- 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)
- Frontend: Next.js 15, React 19, TypeScript, Tailwind CSS
- Backend: Next.js API routes
- Database: PostgreSQL (pg)
GET /api/branches- list all branchesGET /api/branch/:id/menu- menu and items for a branchPOST /api/query- run predefined or custom SQL
app/- UI pages and componentsapp/api/- API routeslib/db.ts- Postgres connection
npm installCreate 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=trueSet ALLOW_SQL_QUERY=true only in trusted environments. When disabled, the /api/query endpoint returns 403.
npm run devOpen http://localhost:3000 in your browser.
- 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.
npm run dev- start the development servernpm run build- build for productionnpm run start- run the production buildnpm run lint- run ESLint