Git Product home page Git Product logo

readingisgood's Introduction

ReadingIsGood

ReadingIsGood is an online books retail firm that operates only on the Internet. Main target of ReadingIsGood is to deliver books from its one centralized warehouse to their customers within the same day. That is why stock consistency is the first priority for their vision operations.

Description

ReadingIsGood is a REST API that provides you can create and manage customers, books and orders. It can also serve statistics of orders by customers.

In this project, Spring Boot, Spring Data JPA with MySQL and Spring Security is used. Also it has OpenAPI Specification for API documentation and Docker to containerize.

Used Technologies

  • Java 11
  • Spring Boot
  • Spring Data JPA
  • Spring Security
  • MySQL
  • Docker
  • JWT (JSON Web Token)
  • OpenAPI (Swagger)
  • Postman
  • Git

Installation and Run (Docker)

Prerequisites

  • Gradle must be installed, if not
  • Docker must be installed, if not

Clone this repository to your local:

$ git clone https://github.com/vlknakkaya/ReadingIsGood.git

Build it using Gradle (skipping tests because of database is not available):

$ ./gradlew clean build -x test

Create Docker environment and start up the application on it:

$ docker-compose build
$ docker-compose up

After successful start of the application, you can access it's OpenAPI UI:

http://localhost:8080/api-doc.html

Installation and Run (STS)

Prerequisites

  • STS must be installed, if not
  • MySQL database is a must for running the application
    • I used XAMPP because of it includes MariaDB and manageable from browser (it makes somethings easier ๐Ÿ™‚)
    • You have to create reading database on it

Clone this repository to your local:

$ git clone https://github.com/vlknakkaya/ReadingIsGood.git

Import the project into STS:

File -> Import -> Gradle -> Existing Gradle Project

Build it from Gradle Tasks (it takes time based on dependencies) and Start!

API Usage

You can use the API using Postman with the collection or it's OpenAPI UI.

AuthController

Because of API has authentication, you need to create token to use it. AuthController provides token creation.

You can create your token by giving credentials to /auth:

http://localhost:8080/auth

NOTE: Application has 3 in-memory users. You can use one of them to create token.

username password
user1 1111
user2 2222
user3 3333

After creating token, you can use it by giving to Header with Authorization key and Bearer (includes whitespace) prefix.

BookController

You can use this controller's methods to manage Book. You can display, create, update or delete a Book or update stocks.

CustomerController

You can use this controller's method to manage Customer. You can display, create, update or delete a Customer or display it's orders.

OrderController

You can use this controller's methods to manage Order. You can display, create, update or delete a Order, search by date or set it's status.

StatisticsController

You can use this controller's methods to display statistics. You can display all or customer based statistics. Statistics value is grouped by months.

readingisgood's People

Contributors

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