Giter Site home page Giter Site logo

starmoto's Introduction

StarMoto

Used car marketplace RESTful API made in Java Spring Boot. Users can add their adverts with images and search for existing ones.

Tech stack

  • Java
  • Spring Boot
  • Spring Security
  • JWT
  • Hibernate
  • PostgreSQL
  • Swagger

How to add a new advert?

  1. Create a new account using /api/v1/auth/register endpoint.
  2. Retrieve your JWT token from /api/v1/auth/authenticate endpoint using your credentials from the previous step.
  3. Send your advert in a json format using /api/v1/adverts endpoint attaching your JWT token in the header.

How to add images to my advert?

Retrieve the advert ID from the advert POST request and use it to post a pictures of your car to /api/v1/imageCollections/{your_adverts_id}/images endpoint

How to delete images?

Send the image URL in a DELETE request to /api/v1/image-collections/{your_adverts_id}/images

How to update my advert?

Send a PUT request to this endpoint /api/v1/adverts/{your_adverts_id}

How to delete my advert?

Send a DELETE request to this endpoint /api/v1/adverts/{your_adverts_id}

How to retrieve adverts?

  • Without filtering (newest)
    Send a GET request to /api/v1/adverts with optional page and size parameters.

  • With filtering
    Send a GET request to /api/v1/adverts with optional parameters (and their dictionary GET endpoints):

    • make
    • model
    • bodyType
    • color
    • fuelType
    • transmissionType
    • drivetrainType
    • doors
    • seats
    • minYear
    • maxYear
    • minMileage
    • maxMileage
    • minEnginePower
    • maxEnginePower
    • minEngineCapacity
    • maxEngineCapacity
    • isDamaged
    • features
    • page
    • size


Following attributes and their dictionary endpoints:

Attribute Get endpoint
make /api/v1/car-references/makes
model /api/v1/car-references/{make_name}/models
bodyType /api/v1/car-references/body-types
color /api/v1/car-references/colors
fuelType /api/v1/car-references/fuel-types
transmissionType /api/v1/car-references/transmission-types
drivetrainType /api/v1/car-references/drivetrain-types
doors /api/v1/car-references/door-counts
seats /api/v1/car-references/seat-counts


To receive adverts images send a GET request /api/v1/image-collections/{advert_id}/images

Swagger url and example requests with responses location

Swagger url: /swagger-ui/index.html

Example request are located at /httpRequests
and their responses at /httpRequests/{requestType}/responses

Example GET adverts request with filtering

Example Filter Request

Response

Example Filter Request Response

Database schema diagram

Database Diagram

starmoto's People

Contributors

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