FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

IvanHayel/clevertec-test-task: Clevertec test task · GitHub

Repository files navigation

CLEVERTEC

🚀 Test task - Receipt API

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

📄 Task Description

📝 Main Technologies

Database
Backend
Build Tool
PaaS

⚙️ 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 Creating a new Product.
PUT /api/v1/products none 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 Creating a new Discount Card.
PUT /api/v1/cards none 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 Creating a new Receipt.
PUT /api/v1/receipts none Updating existing Receipt.
DELETE /api/v1/receipts/{id} none none Deleting Receipt by id.

🪄 Demo

Insomnia used for demonstration.

📦 PRODUCTS DEMO

Get all products

Get product by id

Products full text search

Add new product

Update existing product

Delete product

💳 DISCOUNT CARDS DEMO

Get all cards

Get card by id

Add new card

Update existing card

Delete card

🧾 RECEIPTS DEMO

Get all receipts

Get receipt by id

Receipts full text search

Download receipt in PDF

Add new receipt

Update existing receipt

Delete receipt


Back | FazBrowse Home | New Git URL