Git Product home page Git Product logo

lpgdemo's Introduction

LPG Home exercise

The Exercise

The aim of this exercise is to write a tourism pass management solution. The system should allow customers to add, cancel, and renew a pass; it should also allow tourist attractions to verify if a pass is active. There is no need to worry about payment of passes. The system will be a RESTful application written in Java 8 (or later), using Spring or some other framework of your choice. Usage of Maven and other build tools are permitted.

Getting Started

The repository has a generic Spring boot RESTApi application with Mysql at the backend. API specification for the RESTApi's can be found here Docs

Assumtions Made

Some assumtions that were made on the business logic are:

  • The Vendor will register using POST /v1/vendor
  • The Customer will register using POST /v1/customer
  • Vendor will create passes, for customers to add with pass_length and pass_city. Vendor can also delete a pass and validate a pass.
  • Customer can get all valid passes and send a post to add passes to their account
  • Customers have the option to renew passes by providing a pass length and cancel a given pass(Removes the pass from customers account)
  • Passes become available when vendors add them and are not expired, expired pass dont show up in /allpasses

Requirements

For building and running the application you need:

For database, you will need a mysql database with an empty Schema "lpgdemo" (This can be configured in application.properties)

Build Instructions

  1. Clone repository
  2. Import maven project in IDE
  3. Run mvn build command to compile the project

Deploy Instructions Using Docker

Make sure docker is installed in the system

  1. Go to project base directory (/lpgdemo)
  2. Run the following command to build a docker image: docker build -t 'repo:imageTag' .
  3. Run the built docker image with the following command and use local database docker run -d --network host 'repo:imageTag'

Running the application locally in IDE

There are several ways to run a Spring Boot application on your local machine. One way is to execute the main method in the com.lpgdemo.demo.DemoApplication class from your IDE.

Alternatively you can use the Spring Boot Maven plugin like so:

mvn spring-boot:run

To change the database values refer application.properties under resources used with executing the jar files as command line parameters

Design & Considerations

  • The application is modelled so as to be scalable and modular with testing examples
  • Its dockerized and can be depolyed as a container on any containerized platform

Thank you for your consideration and time in reviewing this application.

lpgdemo's People

Contributors

ashushuk avatar ashutosh-shukla-zz 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.