Design and Progress

WaiterBot API

Middlewares

Middlewares permits communication and management for the backend by operating as a hidden translation layer. By using express.js framework we can easily manage middlewares as we need. Types of middlewares we use in our backend design are listed below.

  1. Application layer middlewares

    • Authentication middleware
    • Logging middleware

  2. Application layer middlewares
    • Check authentication middleware
    • This middleware is responsible for Access control of the users.

  3. Global error handling middleware

  4. Third party middleware

    • Cors middleware
    • Body Parser middleware
    • Mult middleware

Design Decisions

Following aspects where considered when designing the API to increase the quality of the API.

  1. Version controlling

    Version control comes in handy when we need to have some changes in our API. Existing clients may not like to update their applications when we change the API. A versioning strategy allows clients to continue using the existing API and migrate their applications to the newer API when they are ready.

  2. Input validation

    Using the joi package validates the input first.

  3. Server jurnal

    Winston / log4js

  4. Security