Git Product home page Git Product logo

clevertec-test-task's Introduction

CLEVERTEC

๐Ÿš€ Test task - Receipt API

Project Status: WIP โ€“ Initial development is in progress, but there has not yet been a stable, usable release suitable for the public. GitHub HitCount GitHub

Table of Contents
  1. Task Description
  2. Getting Started
  3. API Usage
  4. Demo

๐Ÿ“„ Task Description

๐Ÿ“ Main Technologies

Database Postgresql
Backend Java Spring
Build Tool Gradle
PaaS Docker Heroku

โš™๏ธ Getting Started

โฉ The Easiest Way โฉ

API already deployed on PaaS Heroku:

๐Ÿš€ Heroku link

https://clevertec-test-task.herokuapp.com

๐Ÿ‹ Start with Docker

  • Clone the repository
git clone https://github.com/IvanHayel/clevertec-test-task.git
  • Use docker-compose
docker-compose up

๐Ÿฆ– Local Startup with Gradle

Java version 17+ is required.

  • Clone the repository
git clone https://github.com/IvanHayel/clevertec-test-task.git
  • Create Postgres Database

Example:

CREATE DATABASE "clevertec-api"
    WITH
    OWNER = postgres
    ENCODING = 'UTF8'
    LC_COLLATE = 'English_World.1252'
    LC_CTYPE = 'English_World.1252'
    TABLESPACE = pg_default
    CONNECTION LIMIT = -1;
  • Set up environment variables

DB_URL - JDBC url for Postgres database.

DB_USERNAME - database username

DB_PASSWORD - database password

  • Run Gradle
gradle clean build bootRun

You can also use the gradle wrapper: ./gradlew


๐Ÿ”ฅ API Usage

๐Ÿ’  Endpoints

๐Ÿ“ฆ PRODUCTS

HTTP METHOD URL QUERY PARAMETERS TEMPLATE DESCRIPTION
GET /api/v1/products none none Getting all Products.
GET /api/v1/products/{id} none none Getting Product by id.
GET /api/v1/products/search term: {any} - required none Full text search for all Products.
POST /api/v1/products none post-template Creating a new Product.
PUT /api/v1/products none put-template Updating existing Product.
DELETE /api/v1/products/{id} none none Deleting Product by id.

๐Ÿ’ณ DISCOUNT CARDS

HTTP METHOD URL QUERY PARAMETERS TEMPLATE DESCRIPTION
GET /api/v1/cards none none Getting all Discount Cards.
GET /api/v1/cards/{id} none none Getting Discount Card by id.
POST /api/v1/cards none post-template Creating a new Discount Card.
PUT /api/v1/cards none put-template Updating existing Discount Card.
DELETE /api/v1/cards/{id} none none Deleting Discount Card by id.

๐Ÿงพ RECEIPTS

HTTP METHOD URL QUERY PARAMETERS TEMPLATE DESCRIPTION
GET /api/v1/receipts none none Getting all Receipts.
GET /api/v1/receipts/{id} none none Getting Receipt by id.
GET /api/v1/receipts/search term: {any} - required none Full text search for all Receipts.
GET /api/v1/receipts/download/{id} none none Download existing Receipt in PDF format.
POST /api/v1/receipts none post-template Creating a new Receipt.
PUT /api/v1/receipts none put-template Updating existing Receipt.
DELETE /api/v1/receipts/{id} none none Deleting Receipt by id.

๐Ÿช„ Demo

Insomnia used for demonstration.

๐Ÿ“ฆ PRODUCTS DEMO

Get all products

products-all

Get product by id

products-by-id

Products full text search

products-search

Add new product

products-add

Update existing product

products-update

Delete product

products-delete

๐Ÿ’ณ DISCOUNT CARDS DEMO

Get all cards

cards-all

Get card by id

cards-by-id

Add new card

cards-add

Update existing card

cards-update

Delete card

cards-delete

๐Ÿงพ RECEIPTS DEMO

Get all receipts

receipts-all

Get receipt by id

receipts-by-id

Receipts full text search

receipts-search

Download receipt in PDF

receipts-download-pdf

Add new receipt

receipts-add

Update existing receipt

receipts-update

Delete receipt

receipts-delete

clevertec-test-task's People

Contributors

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