Skip to content

institute-atri/blog-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

blog-backend Java Spring MongoDB JWT

Blog Project for ATRI Institute

Project Status   GitHub License   Java   Spring Boot

Our project is a blogging system in the development phase, developed with Java 21 and Spring Boot. With a strong focus on security and usability, we are incorporating JWT tokens for secure authentication and implementing Spring Security to protect our endpoints. We use efficient DTOs and mappings to optimize communication and data manipulation, making the management of posts, categories, tags and users more intuitive. For storage and flexibility, we are integrating MongoDB as our main database. In addition, we are working to create clear and interactive documentation with Swagger, making it easier to understand and use our APIs.

🍃 Back-End Engineering


@Rafael-Dev

@NicollyRamos

@wendoxx
Rafael Silva
Back-end Engineer
LinkedIn
Nicolly Ramos
Back-end Engineer
LinkedIn
Wendel Silva
Back-end Engineer
LinkedIn

Pre-requisites

  • Before you start, make sure you meet the following requirements:
  • Java 21 installed
  • Windows updated
  • Linux updated
  • macOS updated

Installation

  1. Clone the repository:
git clone https://github.com/institute-atri/blog-backend.git

Technology used

API endpoints

   -> AuthenticationController

   - POST /v1/auth/login - Authenticate user by verifying credentials.

   - POST /v1/auth/register - Endpoint for user registration.

   - POST /v1/auth/logout - Endpoint for logging out the current user.

   - POST /v1/auth/refresh-token - Endpoint to refresh the access token using a valid refresh token.

   -> UserController

   - GET - /v1/users - Returns a list of all users registered in the system, only with the admin token.

   - GET - /v1/users/find/{id} - Returns the user with the specified ID. Only users with the ADMIN role can search by user.

   - PUT - /v1/users/update/{id} - Updates the user with the specified ID.
 
   - DELETE - /v1/users/delete/{id} - Deletes the user with the specified ID. Only users with the ADMIN role can delete the user.

   - GET - /v1/users/posts/id - Returns posts by user id.

   - POST - /v1/users/change-password - Endpoint to change the password of the currently authenticated user.

  -> PostController

  - GET - /v1/posts - Collection of events.

  - GET - /v1/posts/find/{id} - Event identifier ID.

  - POST - /v1/posts/create - Create an event.

  - PUT - /v1/posts/update/{id} - Update an event by ID.

  - DELETE - /v1/posts/delete/{id} - Delete an event by ID.

  -> CategoryController

  - GET - /v1/categories - Collection of events.

  - GET - /v1/categories/posts/{id} - Returns posts by category ID.

  - GET - /v1/categories/find/{id} - Event identifier ID.

  - POST - /v1/categories/create - Create an event.

  - PUT - /v1/categories/update/{id} - Update an event by ID.

  - DELETE - /v1/categories/delete/{id} - Delete an event by ID.

  -> TagController

  - GET - /v1/tags - Collection of events.

  - GET - /v1/tags/posts/{id} - Returns posts by tag ID.

  - GET - /v1/tags/find/{id} - Event identifier ID.

  - POST - /v1/tags/create - Create an event.

  - PUT - /v1/tags/update/{id} - Update an event by ID.

  - DELETE - /v1/tags/delete/{id} - Delete an event by ID.

Authentication

The API uses Spring Security for authentication control. The following roles are available:

USER -> Standard user role for logged-in users.
ADMIN -> Admin role for managing partners (registering new partners)

Dependendcies used

  • Spring web
  • Lombok
  • Spring boot dev tools
  • Spring data mongoDb
  • Spring security
  • Hibernate validator
  • Java jwt auth0
  • Spring doc open api
  • Mapstruct
  • Junit
  • Mockito
  • Cucumber

Contributing

If you have any suggestions for improving this project, follow these steps:

  1. Bifurcate the project
  2. Create a branch git checkout -b feat-#1/sugestions
  3. Make your changes to the code
  4. Confirm your changes git commit -m 'feat: add a new susgestion (#1)'
  5. Send to branch git push origin feat-#1/sugestions
  6. Open pull request

Don't forget to read CONTRIBUTING.md for details on the code of conduct and the process of sending pull requests to us.