GithubHelp home page GithubHelp logo

warung-makan-bahari-api's Introduction

Warung Makan Bahari API - Spring Boot Application

This is a RestAPI for a restaurant management system. It allows users to manage menus, tables, and transactions. The API is secured with JWT authentication and authorization.

Warung Makan Bahari is a renowned restaurant in Indonesia, with branches spread across several islands. The API provides a comprehensive solution for managing various aspects of the restaurant's operations.

Features

  • User registration.
  • User login.
  • JWT authentication.
  • Menu management.
  • Table management.
  • Transaction management.
  • Exception handling.
  • Email verification.

Technologies Used

  1. Java 17
  2. Spring Boot
  3. Spring IoC
  4. Spring Data JPA
  5. Spring Security
  6. Spring Validation
  7. Java Mail Sender
  8. JWT
  9. AuthO
  10. PostgreSQL
  11. IText PDF
  12. Swagger OpenAPI
  13. Lombok
  14. Maven

Project Structure

The project is structured into several folders:

  • config: Contains the configuration classes for beans.
  • constant: Contains the constant classes for the API.
  • controller: Contains the REST controllers for the API.
  • dto: Contains the data transfer objects for the API.
  • entity: Contains the JPA entities for the database.
  • repository: Contains the JPA repositories for the entities.
  • scheduler: Contains the scheduler classes for manage the schedule task.
  • security: Contains the classes for JWT authentication and authorization.
  • service: Contains the service classes for the API.
  • specification: Contains the specification classes for filter the data.
  • util: Contains the utility classes for helpers function.
  • validation: Contains the validation classes for make a custom annotation.

Setup

  1. Clone the repository.
  2. Create a PostgreSQL database.
  3. Update the application.properties file with your database configuration.
  4. Run the application.
    mvn spring-boot:run
  5. Open your browser and navigate to http://localhost:8080/swagger-ui/index.html to view the API documentation.
  6. You can log in with the default admin account:

Usage

The API exposes the following endpoints:

Auth

  • GET /api/auth/login: Logs in a user and returns a JWT token.
    {
       "email": "string",
       "password": "string"
    }
  • POST /api/auth/register: Registers a new user.
    {
       "name": "string",
       "phone": "string",
       "address": "string"
    }
  • POST /api/auth/register/admin: Registers a new admin user.
    {
       "name": "string",
       "phone": "string",
       "address": "string"
    }
  • GET /api/auth/verify-account: Verify the email account with otp.
  • GET /api/auth/validate-token: Validates a JWT token.
  • GET /api/auth/regenerate-top: Regenerate the otp for verify the email account.

Customer

  • GET /api/customerss: Returns a list of all customers.
  • GET /api/customers/{id}: Returns a customer by ID.
  • PUT /api/customers: Updates a customer.
    {
       "id": "string",
       "customerName": "string",
       "phoneNumber": " string"
    }
  • DELETE /api/customers/{id}: Deletes a customer by ID.

Menu

  • GET /api/menus: Returns a list of all menus.
  • GET /api/menus/{id}: Returns a menu by ID.
  • POST /api/menus: Creates a new menu.
    {
      "menuName": "string",
      "price": "string",
      "image": "multipart/form-data"
    }
  • PUT /api/menus: Updates a menu by ID.
    {
       "id": "string",
       "menuName": "string",
       "price": "string",
       "image": "multipart/form-data"
    }
  • DELETE /api/menus/{id}: Deletes a menu by ID.

Table

  • GET /api/tables: Returns a list of all tables.
  • GET /api/tables/{id}: Returns a table by ID.
  • POST /api/tables: Creates a new table.
    {
       "tableName": "string"
    }
  • PUT /api/tables: Updates a table by ID.
    {
       "id": "string",
       "tableName": "string"
    }
  • DELETE /api/tables/{id}: Deletes a table by ID.

Trans Type

  • GET /api/trans-types: Returns a list of all trans types.
  • GET /api/trans-type/{id}: Return a trans type by id,
  • PUT /api/trans-types: Updates trans type.
    {
       "id": "string",
       "description": "string"
    }

Transaction

  • GET /api/bills: Returns a list of all transactions.
  • POST /api/bills: Creates a new transaction.
    {
      "customerId": "string",
      "tableId": "string",
      "billDetailRequests": [
        {
          "menuId": "string",
          "qty": 1
        }
      ]
    }
  • POST /api/bills/status: Update the status of transaction.

Image

  • GET /api/menus/images/{imageId}: Returns download the image by image id.

warung-makan-bahari-api's People

Contributors

shodiqbasiru avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.