GithubHelp home page GithubHelp logo

ruslanyapparov / java-shareit Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 660 KB

Backend of service for sharing or renting things

Java 99.91% Dockerfile 0.09%
docker hibernate java lombok mapstruct maven posgresql rest-api spring-boot

java-shareit's Introduction

По-русски

ShareIt


Backend service for renting or sharing* any item, tool, device, etc. with the ability to book and create a request.


How often does it happen that some item you need so much here and now is not available? You can try to solve the problem by buying a new item, repairing a broken one or searching for analogues from friends - but often this is bad idea. How great it would be if there was a service where users share things! shareit-use.jpg


This application provides to users the abilities to:

  1. Show what things they are willing to share;
  2. Find the right thing and rent it (or may be get it for free) for some time;
  3. Leave requests for the thing they need;
  4. Book an item for certain dates, while blocking access to it from others during the booking period;
  5. Send requests for an item, if the required item is not available on the service;
  6. Add new things for sharing by the request of another user;
  7. View a list of your items saved in the service, as well as the last and next bookings for them;
  8. View the list of bookings they have made for items;
  9. View a list of bookings for their items with various selection options:
  • ALL - all bookings;
  • CURRENT - current bookings;
  • PAST - past bookings;
  • FUTURE - upcoming bookings;
  • WAITING - waiting for a response;
  • REJECTED - rejected bookings;
  1. Leave a comment about the item after use.

Java version - 11;

The application is based on the Spring Boot v. 2.7.9;

Build system - Apache Maven;

Database - PostgreSQL;

Accessing the database and mapping entities - spring-boot-starter-data-jpa, hibernate;

Testing - JUnit, Mockito;

Containerization system - Docker + docker-compose.

The service is divided into 2 modules:

gateway - accepts requests from user, carries out preliminary validation of input data, sends valid requests to the server and then broadcasts the response.

server - accepts requests from gateway, performs logical validation, and performs CRUD operations in the database.


Instructions for running the application locally:

  1. Software is required to run the application
  1. Once launched, the application will accept http requests in accordance with the API (see below) to port 8080 (http://localhost:8080/), make sure it is free, otherwise you will need to change the corresponding settings in the files application.properties and docker-compose.yml.
  2. Launch terminal/command line/PowerShell, execute the commands one by one, waiting for each one to complete:
cd {destination directory to download the project}

git clone [email protected]:RuslanYapparov/java-shareit.git

cd java-shareit/

mvn package

docker-compose up
  1. To run a test script, you can use the test collection (see below). Tests are sensitive to time zone - if your time zone differs from UTC+0, then to pass some tests you will need to transfer the server module to the container TZ variable with your time zone.

API Description (OpenAPI):

shareit-server&gateway-API.json

to view you need to copy and open the content in Swagger editor


Test collection (Postman):

shareIt.postman_collection.json

import a collection by copying the contents into the field as Raw text


The application database is designed in accordance with the ER diagram (light version, created using dbdiagram.io):

shareit-er-diagram.jpg


The application is written in Java. Sample code:

public class ShareIt { 

    public static void main(String[] args) { 
        System.out.println("Let's start sharing items!"); 
    }
    
}

java-shareit's People

Contributors

ruslanyapparov avatar

Stargazers

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