Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/richardfelic/foro-hub

Forum management application built with Spring Boot 3.4.1 and Java 21. Includes topic, response, and user management with JWT-based authentication and OpenAPI documentation.
https://github.com/richardfelic/foro-hub

auth0 flyway java lombok postgresql spring-boot swagger

Last synced: 19 days ago
JSON representation

Forum management application built with Spring Boot 3.4.1 and Java 21. Includes topic, response, and user management with JWT-based authentication and OpenAPI documentation.

Awesome Lists containing this project

README

        

# Foro Hub - API REST

![Badge-Spring](https://github.com/user-attachments/assets/6be9d3d2-dae7-464e-9fc3-365d13fcdcc0)

---

## Project Description

Foro Hub is an application designed to manage online forums, facilitating user interaction through topics and responses. The project was developed using **Spring Boot 3.4.1** and **Java 21**, leveraging the latest features and enhancements of these technologies.

### Key Features:

- **Topic Management:** Create, edit, delete, and list topics.
- **Response Management:** Add and manage responses associated with topics.
- **User Management:** Administer users and their interactions with topics and responses.
- **Authentication and Authorization:** Implemented security with Spring Security and JWT.
- **API Documentation:** Automatically generated with Springdoc OpenAPI.

---

## Project Requirements

### Main Dependencies:

```xml


org.springframework.boot
spring-boot-starter-mail


org.springframework.boot
spring-boot-starter-security


org.springframework.boot
spring-boot-starter-data-jpa


org.springframework.boot
spring-boot-starter-validation


org.springframework.boot
spring-boot-starter-web


org.flywaydb
flyway-core


org.postgresql
postgresql
runtime


org.projectlombok
lombok
true


com.auth0
java-jwt
4.4.0


org.springdoc
springdoc-openapi-starter-webmvc-ui
2.7.0

```

---

## API Endpoints

### **Admin**

#### User Controller

- `GET /api/v1/user/{id}`: Get a user by ID.
- `PUT /api/v1/user/{id}`: Update a user.
- `DELETE /api/v1/user/{id}`: Delete a user.
- `PUT /api/v1/user/activate/{id}`: Activate a user.
- `GET /api/v1/user`: List all users.
- `POST /api/v1/user`: Create a new user.

#### Topic Controller

- `GET /api/v1/topic/{id}`: Get a topic by ID.
- `PUT /api/v1/topic/{id}`: Update a topic.
- `DELETE /api/v1/topic/{id}`: Delete a topic.
- `PUT /api/v1/topic/activate/{id}`: Activate a topic.
- `GET /api/v1/topic`: List all topics.
- `POST /api/v1/topic`: Create a new topic.

#### Response Controller

- `GET /api/v1/response/{id}`: Get a response by ID.
- `PUT /api/v1/response/{id}`: Update a response.
- `DELETE /api/v1/response/{id}`: Delete a response.
- `PUT /api/v1/response/active/{id}`: Activate a response.
- `GET /api/v1/response`: List all responses.
- `POST /api/v1/response`: Create a new response.

### **User (Public)**

#### Public Topic Controller

- `GET /api/v1/public/topic/{id}`: View a topic by ID.
- `PUT /api/v1/public/topic/{id}`: Update a topic.
- `DELETE /api/v1/public/topic/{id}`: Delete a topic.
- `GET /api/v1/public/topic`: List all topics.
- `POST /api/v1/public/topic`: Create a new topic.

#### Public Response Controller

- `GET /api/v1/public/response/{id}`: View a response by ID.
- `PUT /api/v1/public/response/{id}`: Update a response.
- `DELETE /api/v1/public/response/{id}`: Delete a response.
- `GET /api/v1/public/response`: List all responses.
- `POST /api/v1/public/response`: Create a new response.

#### Public User Controller

- `GET /api/v1/public/user`: List public users.
- `GET /api/v1/public/user/{id}`: Get details of a public user.

### **Authentication**

#### Auth Controller

- `POST /api/v1/auth/register`: Register a user.
- `POST /api/v1/auth/refresh`: Refresh a JWT token.
- `POST /api/v1/auth/logout`: Log out.
- `POST /api/v1/auth/login`: Log in.

---

## Installation

1. Clone the repository:
```bash
git clone
```
2. Configure the database in the `application.properties` or `application.yml` file.
3. Run migrations using Flyway.
4. Start the application:
```bash
./mvnw spring-boot:run
```

---

## Contributions

Contributions are welcome. If you want to contribute, please open an issue or a pull request.

---

## Contact

For more information, you can reach us at [[email protected]](mailto:[email protected]).