Skip to content

PRA#02_SpringBoot-EmmaAlonsoMcCoy-CreateUserAPIRest - #15

Open
emsmccoy wants to merge 57 commits into
AlbertProfe:masterfrom
emsmccoy:PRA02-EmmaAlonsoMcCoy
Open

PRA#02_SpringBoot-EmmaAlonsoMcCoy-CreateUserAPIRest#15
emsmccoy wants to merge 57 commits into
AlbertProfe:masterfrom
emsmccoy:PRA02-EmmaAlonsoMcCoy

Conversation

@emsmccoy

@emsmccoy emsmccoy commented Feb 7, 2025

Copy link
Copy Markdown

PRA#02-SpringBoot: Create User API Rest

CIFO La Violeta - FullStack IFCD0210-25 MF01

This document serves as a guide and log for the backend development of the PRA#02 Spring Boot project.


PR Submission Checklist

Common Tasks:

  • Create User @entity
  • Create UserController (Rest API controller)
  • Implement UserRepository
  • Configure application properties with local H2 database
  • Develop UserService
  • Test all endpoints with Postman

Optional Tasks:

  • Configure Postgres database
  • Implement Faker for test data
  • Add unit tests for services
  • Integration tests for controllers

Testing:

  • All endpoints tested in Postman.
  • Error handling implemented in controllers.
  • Data persistence verified in H2 database.

Estimated Time for Tasks

Common Part

Task Estimated Time Actual Time Impediments (if any) New Concepts
Create User @entity 1 hours 45 min @PrePersist
@GeneratedValue(strategy = GenerationType.UUID)
@column(unique = true, nullable = false)
Create UserController 1 hours 1.5 hour ResponseEntity utility methods
 Centralize headers handling using helper method
Implement UserRepository 0.5 hours 0.5 hours
Configure H2 database 0.5 hours 0.5 hours
Develop UserService 2 hours 1 hours
Test endpoints with Postman 1.5 hours 2 hours data.sql only executes correctly if the table has been created previously data.sql to introduce mock data
postman data file to test and run collections
Total 6.5 hours 6.25 hours

Optional Part

Task Estimated Time Actual Time Impediments (if any) New Concepts
Configure Postgres database 2.5 hours 2.5 hours
Implement Faker for test data 1 hours 1.5 hours Use Faker dinamically via API (not implemented)
 Streams: IntStream.range(x, y).mapToObj(i -> ...).collect(Collectors.toList()
Add unit tests for services 2 hours 1.5 hours Mockito JUnit integration
Integration tests for controllers 2 hours 1 hour so far MockMvc and Fluent API
Total 7.5 hours 6.5 hours

Images

H2

Database Connection

image

Postman Runner Results

image

Postgres

Database Connection (pgAdmin 4 & terminal)

image
image

Postman Runner Results

image

Future Improvements

  • Implement Global Exception Handling.
  • Add more unit and integration tests for key functionalities.
  • Implement custom queries for enhanced user search.
  • Optimize service layer for better performance and maintainability.
  • Enhance validation for user input fields.

AlbertProfe and others added 27 commits January 30, 2025 12:09
…d results of the Postman Runner with Postgres
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants