ForoHub is a REST API designed to manage discussion forums through CRUD operations, with support for authentication and authorization. The application is developed with Spring Boot.
- User authentication with JWT.
- Full management of forum topics (create, read, update, and delete).
- Security implementation with Spring Security.
- Automatic database migrations with Flyway.
- API documentation with Springdoc.
- JSON serialization/deserialization with Jackson.
- Simplified code with Lombok.
- Spring Boot: Framework for robust Java application development.
- Spring Security: Handles authentication and authorization.
- JWT (JSON Web Tokens): Token-based authentication.
- Flyway: Database migrations.
- MySQL: Relational database.
- JPA: Database query abstraction.
- Lombok: Simplifies boilerplate code.
- Springdoc: Automatically generates OpenAPI documentation.
- Insomnia: API testing client.
Ensure you have the following installed:
- Java Development Kit (JDK) 17 or higher.
- Maven for dependency management.
- MySQL configured and running locally.
- Insomnia or Postman to test the API.
-
Clone the repository and install dependencies:
git clone https://github.com/abengl/ForoHub.git cd Forohub mvn install
-
Configure your MySQL database credentials in the
application.properties
file:spring.datasource.url=jdbc:mysql://localhost:3306/foro_db spring.datasource.username=your_username spring.datasource.password=your_password
-
Start the application:
mvn spring-boot:run
- POST /login: Authenticates a user and generates a JWT.
- GET /topics: Retrieves a paginated list of topics.
- GET /topics/{id}: Retrieves a specific topic by its ID.
- POST /topics: Creates a new topic (requires authentication).
- PUT /topics/{id}: Updates an existing topic (requires authentication).
- DELETE /topics/{id}: Deletes an existing topic (requires authentication).