This project is a REST API to manage topics in a forum.
This is a challenge project.
- Clone the repository.
- Create a PostgreSQL database.
- Set the database connection in the
application.properties
file. - Install the project dependencies with the command
mvn install
. - Run the project with the command
mvn spring-boot:run
. - The API documentation will be available at
http://localhost:8080/swagger-ui.html
.
POST /auth/login
: Login with a user.
At this moment, there is no endpoint to create a user. The users are created directly in the database.
GET /topics
: Get all topics with pagination.GET /topics/{id}
: Get a topic by id.POST /topics
: Create a new topic.PUT /topics/{id}
: Update a topic by id.DELETE /topics/{id}
: Delete a topic by id.GET /ten-most-recent
: Get the ten most recent topics.
The API uses JWT to authenticate the users. To access the endpoints, you need to pass the token in the header of the request.
The database is created with Flyway. The migration files are in the resources/db.migration
folder.
The tests are in the src/test
folder. The project has unit tests for the services and controllers.
- Create an endpoint to create a user.
- Add integration tests.
- Add more validations.
- Add more error handling.
- Add more documentation.
- Add more security configurations.
- Kotlin: Main programming language.
- Spring Boot: Framework to create the REST API.
- PostgreSQL: Database to store the data.
- Maven: Dependency management.