A complete backend REST API for a forum platform, built with Java and Spring Boot 3. Features stateless authentication, full CRUD operations, and containerized deployment.
- 🔐 Stateless authentication with Spring Security + JWT
- 📋 Full CRUD for topics, replies, and users
- 🗄 Relational schema with 5 entities — users, profiles, courses, topics, replies
- 🔄 Versioned database migrations with Flyway
- 📦 Containerized with Docker & Docker Compose
- 📖 API documentation with OpenAPI 3 / Swagger UI
src/
├── main/
│ ├── java/com/forohub/
│ │ ├── controller/ # REST endpoints
│ │ ├── service/ # Business logic
│ │ ├── repository/ # Data access layer
│ │ ├── model/ # Entities
│ │ ├── dto/ # Data Transfer Objects
│ │ └── security/ # JWT & Spring Security config
│ └── resources/
│ ├── db/migration/ # Flyway migrations
│ └── application.properties
- Java 17+
- Docker & Docker Compose
- Maven
# Clone the repository
git clone https://github.com/AbrahamVC-coder/ChallengeForoHub.git
cd ChallengeForoHub
# Start the app and database
docker-compose up --buildThe API will be available at http://localhost:8080
# Configure your database in application.properties
# then run:
mvn spring-boot:runAll endpoints except /auth/login require a Bearer token.
POST /auth/login
Content-Type: application/json
{
"email": "user@example.com",
"password": "yourpassword"
}Response:
{
"token": "eyJhbGciOiJIUzI1NiJ9..."
}Use the token in subsequent requests:
Authorization: Bearer eyJhbGciOiJIUzI1NiJ9...| Method | Endpoint | Description |
|---|---|---|
| POST | /auth/login |
Authenticate and get JWT token |
| GET | /topicos |
List all topics |
| POST | /topicos |
Create a new topic |
| GET | /topicos/{id} |
Get topic by ID |
| PUT | /topicos/{id} |
Update a topic |
| DELETE | /topicos/{id} |
Delete a topic |
| POST | /respuestas |
Reply to a topic |
Once the app is running, access the interactive Swagger UI at:
http://localhost:8080/swagger-ui.html