{"id":25089676,"url":"https://github.com/josedgg/forohub","last_synced_at":"2026-05-08T13:38:58.738Z","repository":{"id":273170286,"uuid":"918436116","full_name":"JoseDGG/forohub","owner":"JoseDGG","description":"foro para enviar comentarios. Se debe logear, contiene métodos HTTP y maneja SQL para la base de datos","archived":false,"fork":false,"pushed_at":"2025-02-07T02:42:25.000Z","size":56,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-07T03:24:16.530Z","etag":null,"topics":["flyway","insomnia","java","jpa","jwt","mysql","sprinbootsecurity","springboot","springsecurity","swagger"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JoseDGG.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-17T23:45:40.000Z","updated_at":"2025-02-07T02:45:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"0628ca0e-8a0b-40f6-91e0-322692f8b7bb","html_url":"https://github.com/JoseDGG/forohub","commit_stats":null,"previous_names":["josedgg/forohub"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoseDGG%2Fforohub","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoseDGG%2Fforohub/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoseDGG%2Fforohub/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoseDGG%2Fforohub/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JoseDGG","download_url":"https://codeload.github.com/JoseDGG/forohub/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246679069,"owners_count":20816402,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["flyway","insomnia","java","jpa","jwt","mysql","sprinbootsecurity","springboot","springsecurity","swagger"],"created_at":"2025-02-07T11:18:24.052Z","updated_at":"2026-05-08T13:38:58.613Z","avatar_url":"https://github.com/JoseDGG.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Foro Hub \n\nForum Hub is a forum application designed to facilitate communication and discussion between users. \nThis application allows users to create topics, reply to them, and participate in discussions.\n\n## Characteristics\n\n- User authentication with JWT\n- Creation of user, topics, answers and courses\n- Deleting users, topics, answers, courses under user validation\n- Listing users, topics answers and coursers\n- HTTP error handling\n\n## Technolgies\n\n- Java\n- Spring Boot\n- Spring Security\n  - BCrypt to encode passwords\n- JWT (JSON Web Tokens)\n- JPA (Java Persistence API)\n- MYSQL (To storage data)\n- Flyway (for migrations)\n- Insomnia (To test HTTP request)\n- Swagger (Documentation of API)\n\n## Project Structure\n\n- **Entities:** These classes represent the tables in our database\n- **DTO:**\n  - These classes are records which helps us to avoid exposing the entire entity structure\n  - Also help us to transform data to simpler objects and the communication to APIs\n- **Repository:** Interface that extends JPA to perform CRUD operations\n- **Controller** These classes handle HTTP requests\n- **Error handling** These class handles errors\n- **Security** There are multiple security classes which defines how our security handling and filtering is done\n\n## Installation\n\nClone this repository:\n```\ngit clone https://github.com/JoseDGG/forohub\n```\n\nGo to project directory:\n```\ncd ForoHub\n```\n- Open the project in your favorite IDE (for example, IntelliJ IDEA or Eclipse).\n- Configuration\n- Database: MySQL\n\n\nThis project is configured to use an in-memory H2 database by default. You can change the database settings in the application.properties file.\n### Swagger\nSwagger is configured to generate API documentation automatically. You can access the Swagger interface at the following URL when the server is up and running:```\nhttp://localhost:8080/swagger-ui/index.html\n\n![swagger pt1](src/main/java/com/jdgg/forohub/assets/swaggerpt1.png)\n\nand\n\n![swagger pt2](src/main/java/com/jdgg/forohub/assets/swaggerpt2.png)\n### Execution\n```\nThis project currently works on console\n```\nLa application is on: `http://localhost:8080`.\n\nMain Endpoint\n- `/auth/login`: Endpoint to authenticate users registered in database (Beforehand you must introduce manually users and their passwords using BCrypt). Envía una solicitud POST con un JSON que contiene `username` y `password`.\n\nThe following endpoints contains the following HTTP methods: GET, POST, PUT and DELETE\n- `/topicos`: Endpoint to handle topics.\n- `/respuestas`: Endpoint to handle answers.\n- `/cursos`: Endpoint to handle courses.\n- `/usuarios`: Endpoint to create users (currently a work in progress). Requires authentication using a JWT token.\n\n### HTTP Request examples\n\n- Authentication\n\nRequest:\n```\nPOST http://localhost:8080/auth/login\n```\nBody:\n```\n{\n    \"correoElectronico\":\"user_email\",\n\t\"contrasena\":\"user_password\"\n}\n```\nAnswer:\n```\n{\n    \"jwTtoken\": \"jwt_token_generated\"\n}\n```\n- List topics\n\nRequest:\n```\nGET http://localhost:8080/topicos\n```\nHeaders (A Bearer Token):\n```\nAuthorization: jwt_token_generated_in_login\n```\nBody:\n```\n\"content\": [\n\t\t{\n\t\t\t\"id\": 1,\n\t\t\t\"titulo\": \"error 400\",\n\t\t\t\"mensaje\": \"blabla blablablablablablablabla blablablabla\",\n\t\t\t\"fechaCreacion\": \"2025-01-21T16:40:08\",\n\t\t\t\"nombreAutor\": \"Deyvid\",\n\t\t\t\"nombreCurso\": \"Spring Boot 3: desarrollar una API Rest en Java\"\n\t\t},\n\t\t{\n\t\t\"id\": 2,\n\t\t\t\"titulo\": \"Lombok no me quiere funcionar\",\n\t\t\t\"mensaje\": \"blabla blablablablablablablabla blablablabla\",\n\t\t\t\"fechaCreacion\": \"2025-01-21T16:40:08\",\n\t\t\t\"nombreAutor\": \"Deyvid\",\n\t\t\t\"nombreCurso\": \"Spring Boot 3: desarrollar una API Rest en Java\"}\n\t],\n\t\"pageable\": {\n\t\t\"pageNumber\": 0,\n\t\t\"pageSize\": 5,\n\t\t\"sort\": {\n\t\t\t\"empty\": true,\n\t\t\t\"sorted\": false,\n\t\t\t\"unsorted\": true\n\t\t},\n\t\t\"offset\": 0,\n\t\t\"paged\": true,\n\t\t\"unpaged\": false\n\t},\n\t\"last\": true,\n\t\"totalPages\": 1,\n\t\"totalElements\": 1,\n\t\"first\": true,\n\t\"size\": 5,\n\t\"number\": 0,\n\t\"sort\": {\n\t\t\"empty\": true,\n\t\t\"sorted\": false,\n\t\t\"unsorted\": true\n\t},\n\t\"numberOfElements\": 1,\n\t\"empty\": false\n```\n\n## Work in progress\nThis project is getting updates:\n- Limit HTTP requests by user role\n- Introduce creation of users\n- Introduce \"token refresh\"\n- Translate code to english","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjosedgg%2Fforohub","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjosedgg%2Fforohub","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjosedgg%2Fforohub/lists"}