This project is a backend service for managing users, products, and orders. It is built using Kotlin and Ktor, and uses Gradle for build automation. Feel free to use this project as a playground to practice your API automation testing skills. Moreover, you can change the code and add new features to the project if you want to practice your Kotlin skills or just to have fun.
- Kotlin
- Exposed
- Gradle
- JDK 17 (
JAVA_HOME
environment variable must be set toPATH
) - Docker or Docker Desktop (required for running
Postgres
database)
Copy/Paste openapi.yaml
to Swagger Editor Online to view the API Documentation.
Or you can use the OpenAPI Specifications plugin to view the API documentation in IntelliJ IDEA.
Feel free to use the Playground
Postman Collection to test the API. You can import the collection into Postman and run the requests.
Or you can import the openapi.yaml
file into Postman
to view the API documentation and test the endpoints.
This project uses Docker Compose
to run the Postgres
database and the App
. The docker-compose.yml
file is located in the root directory of the project.
- Make sure you have
Docker
orDocker Desktop
installed. - Open a
Terminal
and navigate to the root directory of the project. - Run the
Terminal
and type this commanddocker compose up -d
to build and start the containers. (-d
option is not required, but it is recommended to run the containers in detached mode.) - Wait for the containers to start. You can check the logs in the terminal.
This project uses Docker Compose
to run the Postgres
database ONLY. The docker-compose.yml
file is located in the root directory of the project.
- Make sure you have
Docker
orDocker Desktop
installed. - Open a
Terminal
and navigate to the root directory of the project. - Run the
Terminal
and type this commanddocker compose -f docker-compose-database.yml up -d
to build and start thePostgres
container. (-d
option is not required, but it is recommended to run the container in detached mode.)
This project has been tested on Linux
and MacOS
operating systems. The steps below should work on both, but there may be some differences in the installation process.
- Install a fresh instance of
Docker Desktop
. - Download the
JDK 17 Corretto
installer from the Amazon website. - Install/Update
IntelliJ IDEA Community Edition
to the latest version. - Open the
IDEA
project (check in the settings thatGradle
is using the correctJDK
version). - IDEA automatically downloads all
dependencies
. - Follow the Docker Compose DATABASE section to run the
Postgres
database. - Go to the
src/main/kotlin
directory and open theApplication.kt
file. - Right-click on the
main
function and selectRun 'ApplicationKt'
or use theplay
button in the top right corner of the IDE.
This project has been tested on Windows
operating system. The steps below should work on Windows, but there may be some differences in the installation process.
- Install a fresh instance of
Docker Desktop
. - The Docker installer offered to install WSL and run through it instead of Hyper-V (a pleasant surprise ❤️).
- Install/Update
IntelliJ IDEA Community Edition
to the latest version. - Download the
JDK 17 Corretto
installer from the Amazon website. - Verify the system and user
PATH
variables (one was incorrect, so I updated it manually). - Reboot the computer to apply the new
PATH
. - Open the
IDEA
project (check in the settings thatGradle
is using the correctJDK
version). - IDEA automatically downloads all
dependencies
. - Open a new type of
Terminal
in IDEA via right-clicking on the terminal tab (see screenshot). (This terminal is some kind of illegitimate child of Linux and Windows...) - Follow the Docker Compose DATABASE section to run the
Postgres
database. - Go to the
src/main/kotlin
directory and open theApplication.kt
file. - Right-click on the
main
function and selectRun 'ApplicationKt'
or use theplay
button in the top right corner of the IDE.
The application configuration is located in the src/main/resources/application.conf
file. You can change the database connection settings, server port, and other parameters there.
Logs are written to the logs
directory in the root of the project. You can change the logging configuration in the src/main/resources/logback.xml
file.
This romsper | QA Buddy is my personal Telegram channel where I share my experience and knowledge about testing. I will be glad to see you there!
This project is licensed under the MIT License.