GithubHelp home page GithubHelp logo

liliccc / wholesale Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kingtigerwin/wholesale

0.0 0.0 0.0 121 KB

anz wholesale sample restful api backend project

Dockerfile 1.46% Java 96.61% Shell 1.93%

wholesale's Introduction

ANZ Wholesale RESTful Backend Sample application

Tech Stack:

  • SpringBoot
  • Spring Security + JWT
  • Docker
  • Docker compose
  • PostgreSQL
  • Lombok
  • Mapstruct
  • Spring Data JPA
  • H2 in-memory DB
  • Mockito
  • MockMvc
  • Flyway

Topics

  1. How to run this application
  2. How to access the spring boot restful application
  3. PostgreSQL version based Wholesale Application
  4. Advantages of this application

This is the springBoot based RESTful API. It supports the below functions:

  • Application support H2 in-mem DB and Postgres DB, by default postgres DB is being used. If you want to use H2 in-mem DB, application-h2.properties shall be used.
  • List all accounts
  • List all transactions by account id

How to run this application

  • Navigate the the root folder /wholesale under the command line
  • Run the command to build the whole project: gradle clean build
  • Either run the command to start the application: java -jar ./build/libs/wholesale-0.0.1-SNAPSHOT.jar
  • Or run docker-compose up, then application and postgres DB are both up and running.

How to access the spring boot restful application

Application by default provide the below 3 users:

username/password : tiger/password (normal user without any admin role). this user can login successfully but not allowed to get account list nor transaction list

username/password : sisi/password (admin with role admin and read/write permission). This use can login successfully and be able to access all the endpoints.

username/password : cathy/password (group admin with role group admin and only read permission) This user can login successfully and allowed to get account list but not allowed to get transaction list.

Please find the postman collection file in postman folder and import into your postman to check more details.

Advantages of this application

  • Hibernate builds the entity layer to connect PostgreSQL database server
  • Flyway prepared the initial data.
  • Spring Data JPA builds the repository layer (DAO) & H2 in-mem database used as Unit Test to test this layer
  • Mapstruct used to map data between entities and dtos
  • Mockito and MockMvc unit test service and controller layer
  • All the exceptions can be centrally handled in one place (ControllerExceptionHandler.java)
  • Lombok makes our life easierIt automatically generates getter,setter, constructor, hashcode, log etc.
  • Dockerfile utilize multi stage and put application files into docker instead of using fat jar.
  • Utilize Spring security to implement authentication and authorization.
  • Docker compose has been used in local to easily set up the local environment.

wholesale's People

Contributors

kingtigerwin 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.