REST API built with Spring Boot for a discussion forum. Supports full CRUD on topics and uses JWT-based authentication to secure every request.
| Method | Endpoint | Description |
|---|---|---|
| POST | /auth |
Login and get JWT token |
Request body:
{
"login": "usuario",
"clave": "password"
}| Method | Endpoint | Description |
|---|---|---|
| GET | /topicos |
List all topics |
| POST | /topicos |
Create a new topic |
| PUT | /topicos |
Update an existing topic |
| DELETE | /topicos/{id} |
Delete a topic by ID |
POST / PUT body:
{
"titulo": "Topic title",
"mensaje": "Topic message",
"nombreCurso": "Course name"
}All endpoints except
/authrequire the headerAuthorization: Bearer
- Java 17+
- MySQL running locally
- Maven
# 1. Clone the repository
https://github.com/Ccirhack/forum-hub-java
cd forum-hub-java
# 2. Configure your database in src/main/resources/application.properties
spring.datasource.url=jdbc:mysql://localhost:3306/forohub
spring.datasource.username=YOUR_USER
spring.datasource.password=YOUR_PASSWORD
api.security.secret=YOUR_JWT_SECRET
# 3. Build and run (Flyway will create the tables automatically)
mvn clean install
mvn spring-boot:run- Java 17, Spring Boot, Spring Security, Spring Data JPA
- Flyway for database migrations
- Lombok for boilerplate reduction
- MySQL as database
- Maven as build tool
- Securing a REST API with JWT and Spring Security
- Database versioning with Flyway migrations
- Input validation with Bean Validation
- Clean layered architecture with DTOs and repositories
Contributions are welcome. Open an issue first to discuss changes, then submit a pull request.
Yuan Retamozo · LinkedIn · yretamozovilca@gmail.com