This is a simple challenge to test your skills on building APIs.The ClickBus serivices use mainly Java and Springboot technologies.However, you can use language and framwork that you feel more confortable.
Create a simple API to manage places (CRUD).This API should allow to:
- Create a place
- Edit a placa
- Get a specific place
- List places and filter them by name
A place must have the following fields:
- name
- slug
- city
- state
- created at
- update at
- All API responses must be JSON
- Provide a README.md file with usage instructions(how to run, endpoints etc)
- Provide a testing environment(docker, etc)
- Tests, tests and tests
- SOLID
- Code and commits in english(methods, classes, variables, etc)
- Project structure, architecturing and organization
- Programming good practices
- VCS practices
You musk fork this repository and commit the solution in the solution folder.Your repository must be public.After that, send the repository link on the kenoby platform
This project was developed with the following technologies:
- Spring Boot
- Spring Webflux
- Spring Data + R2DBC
The following design patterns were used in this project:
- SOLID
- Integration tests
To run this project locally, follow these steps:
- Clone the git repository to your local machine using
git clone
. - Navigate to the project folder and run the command
mvn spring-boot:run
to start the application. - The API will be available at
localhost:8080
.
To make HTTP requests, you can use the httpie tool, Postman, or any other of your preference.
Here is an example of how to make a POST request to the /places
endpoint:
http POST :8080/places name="Place Name" state="State"
Os testes do PlaceService são escritos usando JUnit 5 e o WebTestClient do Spring Boot.
-
Project Compilation
The following command is used to compile the project and package the result into a JAR file:
./mvnw clean package
-
Building the Docker Image
The following command is used to build a Docker image of the project using the Spring Boot:
./mvnw spring-boot:build-image
-
Running the Docker Image
The following command is used to run the Docker image:
docker run --name placeservice -p 8080:8080 -d placeservice:0.0.1-SNAPSHOT
This will start a Docker container named
placeservice
, map the container's port 8080 to the host's port 8080, and run the container in the background.