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 connect this project with the testing-playground-frontend project to create a full-stack application for testing purposes.
- Kotlin
- Exposed
- Gradle
- JDK 17 (
JAVA_HOMEenvironment variable must be set toPATH) - Docker or Docker Desktop (required for running
Postgresdatabase)
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
DockerorDocker Desktopinstalled. - Open a
Terminaland navigate to the root directory of the project. - Run the
Terminaland type this commanddocker compose up -dto build and start the containers. (-doption 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
DockerorDocker Desktopinstalled. - Open a
Terminaland navigate to the root directory of the project. - Run the
Terminaland type this commanddocker compose -f docker-compose-database.yml up -dto build and start thePostgrescontainer. (-doption 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 Correttoinstaller from the Amazon website. - Install/Update
IntelliJ IDEA Community Editionto the latest version. - Open the
IDEAproject (check in the settings thatGradleis using the correctJDKversion). - IDEA automatically downloads all
dependencies. - Follow the Docker Compose DATABASE section to run the
Postgresdatabase. - Go to the
src/main/kotlindirectory and open theApplication.ktfile. - Right-click on the
mainfunction and selectRun 'ApplicationKt'or use theplaybutton 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 Editionto the latest version. - Download the
JDK 17 Correttoinstaller from the Amazon website. - Verify the system and user
PATHvariables (one was incorrect, so I updated it manually). - Reboot the computer to apply the new
PATH. - Open the
IDEAproject (check in the settings thatGradleis using the correctJDKversion). - IDEA automatically downloads all
dependencies. - Open a new type of
Terminalin 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
Postgresdatabase. - Go to the
src/main/kotlindirectory and open theApplication.ktfile. - Right-click on the
mainfunction and selectRun 'ApplicationKt'or use theplaybutton 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.