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

IvanHayel/modsen-crud-api: Simple CRUD API · GitHub

Repository files navigation

MODSEN

🚀 Test task - Meetup API

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

📄 Task Description

📝 Task

Development of CRUD REST API for working with Events.

The application must be accompanied by a README.md file with instructions for project startup.

📝 Main Technologies

Database
Backend

📝 Special Requirements

Using pure Hibernate (Spring Data JPA wrapper not allowed)

📝 Additional Technologies

  1. Integration or unit tests.

  2. Database migration (Liquibase or Flyway).

  3. Ability to run from docker-compose.

  4. Ability to filter and sort Events.

  5. Using environment variables.


⚙️ Getting Started

⏩ The Easiest Way ⏩

API already deployed on PAAS Heroku:

🐋 Start with Docker

  • Clone the repository
git clone https://github.com/IvanHayel/modsen-crud-api.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/modsen-crud-api.git
  • Create Postgres Database

Example:

CREATE DATABASE "modsen-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

⚠️ Attention! Date and time in API is valid only in ISO 8601 format! ⚠️

💠 Endpoints

HTTP METHOD URL QUERY PARAMETERS TEMPLATE DESCRIPTION
GET /api/v1/events sortedBy: id (default), theme, organizer, start, place - not required
direction: asc (default), desc - not required
theme: {any} - not required
description: {any} - not required
organizer: {any} - not required
place: {any} - not required
start: {Date/time in ISO 8601} - not required
none Getting all Events with the ability to filter and sort.
GET /api/v1/events/{id} none none Getting an Event by id.
GET /api/v1/events/search term: {any} - required none Full text search for all Events.
POST /api/v1/events none Creating a new Event.
PUT /api/v1/events none Updating existing Event.
DELETE /api/v1/events/{id} none none Deleting Event by id.

🪄 Demo

Insomnia used for demonstration.

Get all events

Get all events with restrictions

Get event by id

Full text search

Create new event

Update existing event

Delete event

Releases

Packages

Contributors

Languages


Back | FazBrowse Home | New Git URL