Skip to content

vlad-bstrv/HairBookBackend

Repository files navigation

Ktor, Postgresql, JWT, Exposed, Rest API

Build Restful CRUD API for a blog using Ktor, Postgresql, JWT, Exposed, Koin

Steps to Set up

1. Clone the application

git clone https://github.com/vlad-bstrv/HairBookBackend.git

2. Change postgres url, username and password as per your installation

  • open src/main/kotlin/com/vladbstrv/plugins/Databases.kt
  • change bdUrl, bdUser and dbPassword

4. Run the app

The app will start running at http://0.0.0.0:8080

Explore Rest APIs

The app defines following CRUD APIs.

Auth

Method Url Decription Sample Valid Request Body
POST /api/v1/signup Sign up JSON
POST /api/v1/signin Log in JSON
GET /api/v1/user User info

Service

Method Url Description Sample Valid Request Body
POST /api/v1/service JSON
GET /api/v1/service Get all services
GET /api/v1/service/{id} Get service by id
PUT /api/v1/service Update service JSON
DELETE /api/v1/service/{id} Delete service

Client

Method Url Description Sample Valid Request Body
POST /api/v1/client JSON
GET /api/v1/client Get all clients
GET /api/v1/client/{phoneNumber} Get service by phoneNumber
PUT /api/v1/client Update clients JSON
DELETE /api/v1/client/{id} Delete clients

WorkingDay

Method Url Description Sample Valid Request Body
POST /api/v1/working-day JSON
GET /api/v1/working-day Get all working-day
GET /api/v1/working-day/{id} Get working-day by id
PUT /api/v1/working-day Update working-day JSON
DELETE /api/v1/working-day/{id} Delete working-day

Appointment

Method Url Description Sample Valid Request Body
POST /api/v1/appointment JSON
GET /api/v1/appointment Get all appointment
GET /api/v1/appointment/{id} Get appointment by id
PUT /api/v1/appointment Update appointment JSON
DELETE /api/v1/appointment/{id} Delete appointment

Sample Valid JSON Request Bodys

{
  "email": "mail@gmail.com",
  "login": "IvanIvanov",
  "password": "123",
  "firstName": "Ivan",
  "lastName": "Ivanov",
  "role": "admin"
}
{
  "email": "mail@gmail.com",
  "password": "123"
}
{
  "name": "Классическая модельная стрижка",
  "price": 2000.0,
  "time": "01:00:00"
}
{
  "id": 1,
  "name": "Классическая модельная стрижка",
  "price": 2000.0,
  "time": "01:00:00"
}
{
  "firstName": "Petr",
  "lastName": "Petrov",
  "phoneNumber": "89113334455",
  "comment": ""
}
{
  "firstName": "Petr",
  "lastName": "Petrov",
  "phoneNumber": "89113334455",
  "comment": ""
}
{
  "date": "2024-01-07",
  "startTime": "12:00:00",
  "endTime": "19:00:00"
}
{
  "id": 1,
  "date": "2024-01-07",
  "startTime": "12:00:00",
  "endTime": "19:00:00"
}
{
  "workingDayId": 1,
  "servicesId": [
    1,
    2
  ],
  "startTime": "13:00:00"
}
{
  "id": 13,
  "workingDayId": 1,
  "servicesId": [
    1,
    2
  ],
  "startTime": "13:00:00"
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages