Git Product home page Git Product logo

tatanka's Introduction

alt text

Tatanka Project

Simple restful API as an example, with some CRUD operations and data storage logic:

Table of Contents

  1. Context
  2. Getting Started
    a.Prerequisites
    b.Installing
  3. Checking code coverage
  4. Running the Tatanka
  5. API Reference
  6. Built With
  7. Author

Context

  1. Rental by hour, charging $5 per hour
  2. Rental by day, charging $20 a day
  3. Rental by week, charging $60 a week
  4. Family Rental, is a promotion that can include from 3 to 5 Rentals (of any type) with a discount of 30% of the total price

Getting Started

The source code was build in IntelliJ IDEA community edition as a maven project. Download or clone the repository into the desired path and import in IntelliJ. To export the project to Eclipse please read the following export to eclipse guide, however intelliJ is required in order to test for code coverage, since it was tested in that IDE.

Prerequisites

In order to build the project, the following programas will have to be installed:

Java jdk 1.8
Maven 3.x
IntelliJ IDEA Not required for maven testing

Installing

Open a terminal or prompt and navigate to the desired folder and clone the repository

c:\Users\hiessy> cd IdeaProjects
c:\Users\hiessy\IdeaProjects> git clone https://github.com/Hiessy/Tatanka.git

Navigate into the cloned folder and run the maven test suite

c:\Users\hiessy\IdeaProjects> cd Tatanka
c:\Users\hiessy\IdeaProjects\Tatanka>mvn test

Once complete you should be able to see the BUILD SUCCESS.

Checking code coverage

It is recommended that code coverage be checked with the IntelliJ IDE. In order to do this, open up the IDE and import the project. Once complete click on Viewing Code Coverage Results for a guide on how to achieve this.

Running the Tatanka

Once the tests have cleared you can run the spring boot project by packaging it with maven compiler plugin defined in the pom file. This will rerun the test suite again, so you could probably skip running the tests with maven if you plan on building

c:\Users\hiessy\IdeaProjects\Tatanka>mvn package

When the build is complete, you should see the BUILD SUCCESS message. Navigate to the target directory and run the jar package

c:\Users\hiessy\IdeaProjects\Tatanka>cd target
c:\Users\hiessy\IdeaProjects\Tatanka\target>java -jar rental-1.0-SNAPSHOT.jar

This is a self contained spring boot project with an embedded database H2 so it should start fine. Tatanka logs folder on the path where it is running and write to the rental.log file inside. Make sure there are no other programs listening on port 8080 when running Tatanka.

There is also a doc folder with the auto generated Javadoc from IntelliJ IDE.

API Reference

The following show how to consume the exposed API. Data Params should be placed in json object and the Content-Type should have the application/json when required.

URL Method URL Params Data Params Success Response Error Response
/v1/rental GET 200 404
/v1/rental/{rentalId} DELETE rentalId 200 404
/v1/rental PUT time
numberOfBikes
200 400
/v1/user/{userId}/rental POST userId time
numberOfBikes
rentalDateRequested
201 404
400
/v1/user POST name
password
201 409
400
/v1/user/{name} GET name 200 409
400

Built With

Author

  • Martin Diaz - Initial work - Hiessy

tatanka's People

Contributors

hiessy avatar

Watchers

James Cloos avatar  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.