Skip to content

rafael-vaz/restaurant-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

👨‍🍳 Restaurant API

A REST API for managing restaurant orders, including table sessions, order flow, and related entities such as products and tables.

💻 Technologies

  • Express
  • Knex.js
  • Node.js
  • SQLite
  • TypeScript

🚀 Getting started

Follow the steps below to run the project locally in a development environment.

Cloning

Clone the repository.

git clone https://github.com/rafael-vaz/restaurant-api

Starting

Run the project.

# 1. Navigate to the project directory
cd restaurant-api

# 2. Install dependencies
npm install

# 3. Run database migrations (Knex)
npm run knex migrate:latest

# 4. Start the development server
npm run dev

📍 API Endpoints

This section lists the main API routes and describes their expected request bodies.

📦 Products

Method Endpoint Description Request Body
GET /products List all products
POST /products Create a new product { name, price }
PUT /products/:id Update a product { name, price }
DELETE /products/:id Delete a product

🍽️ Tables

Method Endpoint Description Request Body
GET /tables List all tables

🪑 Table Sessions

Method Endpoint Description Request Body
POST /tables-sessions Open a table session { table_id }
GET /tables-sessions List table sessions
PATCH /tables-sessions/:id Close a table session

🧾 Orders

Method Endpoint Description Request Body
POST /orders Create a new order { table_session_id, product_id, quantity }
GET /orders/table-session/:tableSessionId List orders by table session
GET /orders/table-session/:tableSessionId/total Show total for a table session

About

REST API for restaurant order management with table sessions, order flow, and product tracking, built with Express, Knex.js, and SQLite.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors