Giter Club home page Giter Club logo

cart-backend's Introduction

Retail Backend Spring Boot Application

The app is the multi module spring boot application based on gRPC. The app has two modules namely:

  • Server module contains all the service implementation.
  • Proto module contains the proto definition files

Requirements

For building and running the application you need:

API Documentation(Postman Collection)

To view the API documentation add the API definition in your postman

Running the application locally

There are several ways to run this application locally you need

  • Maven
  • Docker
  • Java
  • Protoc
  • Postman

The steps for running the app are:

  • Clone
  • Install the app dependencies using maven
mvn install
  • Package the app using maven
mvn package
  • You can also use build image for this project troy12/app-retail-backend
  • The project has docker-compose setup with the application and MYSQL database. To start the app on the local environment run the command
docker-compose up --build
  • The app will start on port 9090 add the postman collection, import the api definition and test the app on localhost:9090.
  • Change the SERVER_URL to reflect the your set port and host
  • Use the use example message button to generate sample message and replace the generate values with relevant values for given fields.
  • All the methods in the CartService are limited to authorized users.
  • To use them first register the user using the AuthService createUser method.
  • Use the register credential to get the token using AuthService authorizeUser method.
  • Set the editor environment to Test Environment
  • Edit the TOKEN set it to the value returned by authorizeUser method
  • The rest of the methods are not authorized were meant for admin are meant to be deployed as internal APIs.

Running the test

To run the test run the command

mvn test

Deploying the application to kubernetes

The projects includes the kubernetes manifests in the k8s folder. It contains:

  • The MYSQL setup service, deployment, persistent volume and persistent volume claim manifests
  • The Application deployment and services manifests
  • The secrets manifest for database password and jwt secrets.

To deploy the app on the kubernetes cluster run the command:

kubectl apply -f k8s

cart-backend's People

Contributors

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