Code Monkey home page Code Monkey logo

productmanagement-synthese-microservice's Introduction

Product and Customer Management


Logo

Product and Customer Management

Web App for Product and Customer Management
Explore the docs »

View Demo (Under Construction) · Report Bug · Request Feature

Note This Project is still under construction and continuous improvement, nothing is final.

Table of Contents
  1. About The Project
  2. Built With
  3. Screenshots
  4. Installation and usage
  5. Class Diagrams
  6. Contributing
  7. Contact
  8. Acknowledgments

About The Project

This Project was made as a synthesis for the Microservices Module during my studies.

Contrary to the Monolithic Architecture, Microservices allows us to build Scalable and well Maintainable Software.

Please find below the Technologies used for this Project.

Later the Microservices were secured using Keycloak v20.0.3

(back to top)

Built With

  • Java
  • Spring
  • SpringSecurity
  • Angular
  • Bootstrap
  • Docker
  • Keycloak

This Project is composed of 5 Microservices + The Frontend :

  • Gateway-Service
  • Discovery-Service
  • Customer-Service
  • Inventory-Service
  • Billing-Service
  • Frontend

Screenshots

Screenshots from the Web Application :

Home Page

Products Page

Edit Product Page

Customers List Page

Add Customer Page

Authentication Panel

Bill Page

(back to top)

Installation and Usage

At startup the Backend will generate 4 customers, 40 Products and bills for each customer that have been populated with the given products for demonstration purposes, so no need to access the Database to add or modify anything.

The Frontend was made with Angular. NodeJS and Angular installation is needed as well as Keycloak for Angular.

npm install keycloak-angular keycloak-js

Keycloak on the other hand, was deployed on a docker container and port bound to the Host Machine at port 8080. Then I've configured it with a New Realm named pm-realm and a new client pm-client

docker run -p 8080:8080 \
 -e KEYCLOAK_ADMIN=admin \
  -e KEYCLOAK_ADMIN_PASSWORD=admin \
   quay.io/keycloak/keycloak:20.0.3 start-dev

The KEYCLOAK_ADMIN and KEYCLOAK_ADMIN_PASSWORD are Keycloak native parameters for the admin console, they can be changed later.

As per the users, 3 were made, one Admin and two Users. Admin has access to all the Data on the application, as for users, only limited access is given. This difference of authorization can be seen on the backend, in the CustomerController Class as an example, as per picture below :

Code Snippet example of the authorization :

    @PostMapping("/customers/addCustomer")
    @PreAuthorize("hasAuthority('Admin')")
    public Customer addCustomer(@RequestBody Customer customer) throws CustomerException {
        return customerService.addCustomer(customer);
    }

Only Admins have the possibility to add a customer, as can be seen with annotation @PreAuthorize("hasAuthority('Admin')").

On the other hand, a simple user can only check the customers list :

    @GetMapping("/customers")
    @PreAuthorize("hasAuthority('User')")
    public List<Customer> getCustomerList() {
        return customerService.listCustomers();
    }

Class Diagrams

Customer Microservice

Inventory Service

Billing Service

Gateway Service

Discovery Service

(back to top)

Contributing

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

Contact

Hamza Ouggadi - [email protected]

Project Link: https://github.com/HamzaOuggadi/ProductManagement-synthese-microservice

(back to top)

Acknowledgments

(back to top)

productmanagement-synthese-microservice's People

Contributors

hamzaouggadi avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

hoanglonely

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.