jucron / restaurant-backend

>My Creation< A REST API simulating a backend of a Restaurant System. It includes a layer of JWT Security.
2 stars 0 forks source link
java jwt-token maven mvc-architecture rest-api springframework test-driven-development

CircleCI

codecov

Restaurant Backend Rest Application

A restaurant application in which clients, waiters and kitchen staff can interact together. Tables are checked-in, orders can be processed and communicated to the cooks. This is the backend piece, used to provide endpoints and send REST response to the frontend. This application was created entirely by Test-Driven-Development technique.

It is more properly to Test using the Postman with Authorization Header: Postman api-rest-security Workspace

Motivation:

This project is a great opportunity to practice complex database modeling and object-oriented design. A restaurant management app is a real-world challenge worth solving.

Website of the App:

todo: link (work in progress)

Documentation

Check the Swagger Api Documentation: [work in progress]

Features of this API

Client management

Note about Status: OPEN is the same as Active/In_Use. CLOSED is the same as Deactivated/Not_In_Use.

Order management

Note: Table status is managed by Client check-in/out

Menu management

Note: Menu will hold the time registry in which the last Meal/Beverage was created

Consumption management

Database Diagram

For the database modeling, a diagram with each table and relationships was created for the SportsBuddy application:

Getting Started

Data Initialization work in progress

Via Docker work in progress

  1. After changes run docker build -t restaurantbackend . in a project root directory to build application image.
  2. After image is fully built, run docker run -d -p 8080:8080 restaurantbackend to start the image
  3. With a browser, access the app via http://localhost:8080/
  4. (Optional) run docker logs -t <container> to see the logs

    Notes:

    Database for testing is in-memory type, for fast and convenient usage.

    Conceptual Design

    Object Oriented Programming

Dependency Injection (Design pattern)

MVC Structure (Model, View, Controller)

Test-Driven-Development

CI/CD

REST API

Technology

  • Java
  • Spring-Boot
  • Java Persistence API (JPA)
  • Hibernate (object relational mapping)
  • Maven (build, dependencies)
  • JUnit
  • Mockito
  • Spring Security (JWT Token)
  • Rest Controller
  • Code coverage
  • CircleCI