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 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.
- Kotlin
- Gradle
- JDK 17 (
JAVA_HOME
environment variable must be set toPATH
) - Docker or Docker Desktop (required for running
Postgres
database)
POST /auth/login
- Authenticates a user using their email and password.POST /auth/refresh
- Refreshes the JWT token using a refresh token.GET /auth/validate
- Validates the current JWT token.
GET /api/v1/users/me
- Retrieve the current user's information.GET /api/v1/users/{id}
- Retrieve a user's information by ID.PUT /api/v1/users/{id}
- Update a user's information by ID.DELETE /api/v1/users/{id}
- Delete a user by ID.
GET /api/v1/products
- Retrieve a list of products.GET /api/v1/products/{id}
- Retrieve a product's information by ID.POST /api/v1/products
- Create a new product.PUT /api/v1/products/{id}
- Update a product's information by ID.DELETE /api/v1/products/{id}
- Delete a product by ID.
GET /api/v1/orders
- Retrieve a list of orders.GET /api/v1/orders/{id}
- Retrieve an order's information by ID.POST /api/v1/orders
- Create a new order.PUT /api/v1/orders/{id}
- Update an order's information by ID.DELETE /api/v1/orders/{id}
- Delete an order by ID.
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.
- 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
. - Run the
Terminal
and type./gradlew run
to run the project. - Run
./gradlew composeDown
to stop the Postgres container andDROP
the database.
- 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...) - Enter the command
.\gradlew.bat run
. - Run
.\gradlew.bat composeDown
to stop thePostgres
container andDROP
the database.
Logs are stored in the logs
directory and cleaned up automatically before each run.
This project is licensed under the MIT License.