Skip to content

Jujbraga/api-restaurant

Repository files navigation

🍽️ Restaurant Management API

A RESTful API for restaurant management built with Node.js.

This project was developed to practice backend development concepts and provide a complete API structure for managing restaurants, menu items, orders, customers, and related operations.

The API follows REST principles and focuses on clean architecture, scalability, and maintainable code organization.


🚀 Features

This API allows you to:

  • Manage restaurants
  • Create and update menu items
  • Register customers
  • Create and manage orders
  • Update order status
  • Filter and list resources
  • Handle JSON request bodies
  • Work with route parameters and query strings
  • Organize backend logic using modular architecture
  • Persist and manipulate restaurant-related data

📚 Learning Objectives

During this project, the following backend development concepts were explored:

  • REST API architecture
  • HTTP methods (GET, POST, PUT, PATCH, DELETE)
  • Request and response handling
  • JSON data manipulation
  • Route and query parameter handling
  • CRUD operations
  • Error handling and validation
  • Node.js server structure
  • Modular code organization
  • Backend best practices

🛠️ Technologies Used

  • Node.js
  • JavaScript (ES6+)
  • Native Node.js modules
  • REST API concepts

🌀 Application Flow

The diagram below shows the basic workflow of the restaurant application.

flowchart LR

    %% Nodes
    START((Start))
    OPEN[Open table]
    ORDER[Orders]
    BILL[Close Bill]
    CLOSE[Closes Table]
    END((End))

    %% Flow
    START -->|Client arrives| OPEN
    OPEN -->|Client make| ORDER
    ORDER -->|Client| BILL
    BILL -->|Restaurant| CLOSE
    CLOSE --> END
    END -.->|Return for a new customer| START

    %% Styles
    classDef process fill:#0d6efd,color:#fff,stroke:#0b5ed7,stroke-width:2px;
    classDef terminal fill:#dbeafe,color:#000,stroke:#6c8ebf,stroke-width:2px;

    class OPEN,ORDER,BILL,CLOSE process;
    class START,END terminal;
Loading

📂 Project Structure

api-restaurant/
│
├── src/
│   ├── controllers/
│   ├── routes/
│   ├── services/
│   ├── database/
│   ├── utils/
│   └── server.js
│
├── package.json
└── README.md

⚙️ Installation

Clone the repository:

git clone https://github.com/Jujbraga/api-restaurant.git

Access the project folder:

cd api-restaurant

Install dependencies:

npm install

Start the development server:

npm run dev

Or start the production server:

npm start

🔥 API Endpoints

Restaurants

Create Restaurant

POST /restaurants

List Restaurants

GET /restaurants

Get Restaurant By ID

GET /restaurants/:id

Update Restaurant

PUT /restaurants/:id

Delete Restaurant

DELETE /restaurants/:id

Menu

Create Menu Item

POST /menu

List Menu Items

GET /menu

Update Menu Item

PUT /menu/:id

Delete Menu Item

DELETE /menu/:id

Orders

Create Order

POST /orders

List Orders

GET /orders

Update Order Status

PATCH /orders/:id/status

🤝 Contributing

Contributions are welcome!

Feel free to fork the project, open issues, and submit pull requests.


📄 License

This project is licensed under the MIT License.

About

This project was developed to practice backend development concepts and provide a complete API structure for managing restaurants, menu items, orders, customers, and related operations.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors