Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
1615f8e
create Word class and controller
AlbertProfe Jan 10, 2025
55f09b9
add repository and application.properties
AlbertProfe Jan 10, 2025
17056d0
create controller word method get all words
AlbertProfe Jan 10, 2025
4116bbd
spring boot rest controller docs
AlbertProfe Jan 10, 2025
8f2660e
renaming files
AlbertProfe Jan 10, 2025
5cbb18b
renaming files
AlbertProfe Jan 10, 2025
656ac27
WordController comments
AlbertProfe Jan 16, 2025
0b15c36
test with JUnit to word entity
AlbertProfe Jan 16, 2025
b5c117a
spring docs-resources images project structure
AlbertProfe Jan 16, 2025
aa68930
spring docs-resources test JUnit word
AlbertProfe Jan 16, 2025
0eb0b0f
db local
AlbertProfe Jan 17, 2025
557b0d6
new folder Test Junit
AlbertProfe Jan 17, 2025
f596df5
basic wordController CRUD
AlbertProfe Jan 17, 2025
8fd89c9
H2 local db and word controller
AlbertProfe Jan 17, 2025
8fdc1ad
move md
AlbertProfe Jan 17, 2025
6c6a27e
doc: containers and pronunciationApp-v0.1
AlbertProfe Jan 23, 2025
50b30db
feat: refactor controller and repository
AlbertProfe Jan 23, 2025
052eeef
doc: spring boot for 5yo
AlbertProfe Jan 23, 2025
bc9c5ee
fix: getWordByPhoneticSpelling at WordRepository pronunciation fields…
AlbertProfe Jan 23, 2025
c4bc3db
feat: createWords and deleteAllWords
AlbertProfe Jan 23, 2025
52be154
doc: styling docs
AlbertProfe Jan 23, 2025
04dde27
doc: annotations
AlbertProfe Jan 24, 2025
7685ec5
doc: add mock-data script
AlbertProfe Jan 24, 2025
eea3805
doc: image h2 with mock data
AlbertProfe Jan 24, 2025
90e659a
feat: refactor with ResponseEntity, headers and optional
AlbertProfe Jan 24, 2025
ec64ac1
doc: import .csv to H2 DB
AlbertProfe Jan 24, 2025
d6590ad
doc: mock Server postman
AlbertProfe Jan 29, 2025
0313b8c
doc: update mock Server Postman
AlbertProfe Jan 29, 2025
e9fc851
doc: java faker
AlbertProfe Jan 30, 2025
b297b2a
doc: jpa
AlbertProfe Jan 30, 2025
072c3e2
feat: refactor WordController, implement WordService and create Healt…
AlbertProfe Jan 30, 2025
39a3371
doc: pronunciationApp-v0.2.d and spring 5yo
AlbertProfe Jan 30, 2025
1561d0b
doc: task definition and estimated time for each task
emsmccoy Jan 30, 2025
1e814b1
feat: create User entity
emsmccoy Jan 30, 2025
530bbd3
feat: add PID, java version to HealthController
AlbertProfe Jan 30, 2025
84dc48f
doc: check health image
AlbertProfe Jan 30, 2025
113cb56
doc: create jpa folder
AlbertProfe Jan 30, 2025
3dee29a
feat: improve User entity with AI suggestions
emsmccoy Jan 30, 2025
2b07bc0
fix: check jpa folder typo
AlbertProfe Jan 30, 2025
fad4d9c
doc: first task completed
emsmccoy Jan 30, 2025
41e879a
feat: create files for UserAppController and UserAppService
emsmccoy Jan 30, 2025
2c1b472
doc: dal dao and model 0.2
AlbertProfe Jan 30, 2025
bb9e867
feat: create files for UserController, UserRepository and UserService
emsmccoy Jan 30, 2025
b1233ef
fix: renamed UserApp to User and added annotation and schema for quer…
emsmccoy Jan 30, 2025
a2ce67b
Merge remote-tracking branch 'origin/PRA02-EmmaAlonsoMcCoy' into PRA0…
emsmccoy Jan 30, 2025
4f5d97c
doc: JPA queries
AlbertProfe Jan 31, 2025
a37c883
doc: update pronunciationApp-v0.2-model.md
AlbertProfe Jan 31, 2025
018aa40
doc: update jpa.md
AlbertProfe Jan 31, 2025
2a562e2
feat: new entity StageWord and controller service
AlbertProfe Jan 31, 2025
5e6c268
feat: implement UserController functions
emsmccoy Feb 1, 2025
cb9c12a
feat: finish implementing UserController functions
emsmccoy Feb 3, 2025
8c9c40a
feat: include user count in HealthController
emsmccoy Feb 3, 2025
197c1a9
doc: userController implementation
emsmccoy Feb 3, 2025
75c59f8
feat: set up connection to h2 and create data.sql for mock users
emsmccoy Feb 5, 2025
5c2defa
doc: finish common part and add Postman Runner image
emsmccoy Feb 5, 2025
a967de9
doc: Update README.md
emsmccoy Feb 5, 2025
3688f0c
feat: [optional] connect to Postgres DB. Change UUID in data.sql to e…
emsmccoy Feb 6, 2025
1ba23b3
doc: add images for connection to H2, pgAdmin 4, postgres terminal an…
emsmccoy Feb 6, 2025
a94b5bd
feat: implement DataInitializer with java faker
emsmccoy Feb 6, 2025
f8fcf79
doc: streams to create a list of objects from an int range
emsmccoy Feb 6, 2025
5157d71
doc: backend model v2.0
AlbertProfe Feb 7, 2025
8564464
doc: update backend model
AlbertProfe Feb 7, 2025
346fcc9
feat: create UserServiceUnitTest
emsmccoy Feb 7, 2025
ec5caa9
doc: document UserServiceUnitTest time
emsmccoy Feb 7, 2025
e596a10
fix: refactor deleteUserById by removing @RequestBody User user
emsmccoy Feb 7, 2025
e8142a2
feat: create UserControllerIntegrationTest
emsmccoy Feb 7, 2025
bc52fad
doc: document integration testing and final times
emsmccoy Feb 7, 2025
7f5dc90
doc: correct links for images
emsmccoy Feb 7, 2025
5a0eae9
doc: PronunciationApp Backend v0.3.md
AlbertProfe Feb 13, 2025
45a3a67
doc: update PronunciationApp Backend v0.3.md
AlbertProfe Feb 13, 2025
d253477
feat: Pronunciation entity and repo, onetomany word-pronunciation and…
AlbertProfe Feb 13, 2025
de41b66
doc: JPA one to many docs and images
AlbertProfe Feb 13, 2025
09c2ef8
Merge branch 'PRA02-EmmaAlonsoMcCoy' into PRA04-EmmaAlonsoMcCoy
emsmccoy Feb 13, 2025
58e8c28
doc: added AlbertProfe UML for reference
emsmccoy Feb 14, 2025
e64838d
fix: updated JavaFaker to DataFaker. Changed from Postgres to H2.
emsmccoy Feb 14, 2025
dbbfe73
doc: created PR submission checklist, estimates table, UML table and …
emsmccoy Mar 3, 2025
5a9e13e
feat: created entities that had not been defined in PRA#02
emsmccoy Mar 3, 2025
d77eb90
doc: updated README.md
emsmccoy Mar 3, 2025
21f9fa6
doc: copied UML from AlbertProfe repo for reference
emsmccoy Feb 13, 2025
7c09a27
fix: changed User to UserApp top avoid conflicts with reserved types
emsmccoy Mar 3, 2025
a1df5be
fix: re-added definition attribute to Pronunciation
emsmccoy Mar 3, 2025
448bd94
fix: changed User to UserApp
emsmccoy Mar 3, 2025
9338779
feat: created GameProgress entity, enum type GameStage
emsmccoy Mar 3, 2025
d2bd6e1
feat: created test for OneToOne bidirectional relationship and added …
emsmccoy Mar 3, 2025
cebdd81
fix: commented data.sql to avoid interference and added complexity wi…
emsmccoy Mar 3, 2025
5d1e221
doc: tracked times
emsmccoy Mar 3, 2025
56efdb8
fix: changed application.properties and removed unnecessary annotatio…
emsmccoy Mar 5, 2025
b1b800d
fix: passed OneToOne test
emsmccoy Mar 7, 2025
461ff42
feat: created ManyToMany Category-Word relationship
emsmccoy Mar 7, 2025
2a3e8ef
feat: created ManyToOne unidirectional StageWordWord relationship and…
emsmccoy Mar 8, 2025
b8c0403
feat: created ManyToOne bidirectional StageStageWord relationship and…
emsmccoy Mar 10, 2025
14ee3cf
feat: created ManyToOne relationships and tests for GameProgress-Stag…
emsmccoy Mar 10, 2025
36925c6
feat: create test for ManyToOne bidirectional relationship StageLevel
emsmccoy Mar 11, 2025
a09d84e
docs: updated tests done
emsmccoy Mar 11, 2025
01ada1d
fix: added levels [test for commit-tracker]
emsmccoy Mar 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
147 changes: 0 additions & 147 deletions PRA/PRA_guide.md

This file was deleted.

Binary file added PRA/Pasted image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added PRA/model.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
192 changes: 192 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,192 @@
# PRA#04-SpringBoot: JPA Relationships and Model Enhancement

## Overview

This document serves as a guide and log for the frontend development of the PRA#04-SpringBoot project. The exercise focuses on implementing JPA relationships and enhancing the data model for a Spring Boot pronunciation application.

---

## UML Model

```mermaid
classDiagram
class User {
+String id
+String usrname
+int age
+String email
+int totalScore
+boolean isActive
}
class Word {
+String id
+String text
+String description
+String sentence
+int difficulty
+boolean isCommon
}
class Pronunciation {
+String id
+String audioName
+int audioSize
+String audioUrl
+String phoneticSpelling
+String speakerGender
+enum type // canonical, recorded
}
class Level {
+String id
+int number
+String name
+int requiredScore
+boolean isBlocked
}
class Category {
+String id
+String categoryName
+String subCategoryName
+String description
+int wordCount
}
class GameProgress {
+String id
+int currentScore
+enum currentStage // stage_01, stage_02
+Date lastPlayedDate
+int wordsLearned
}
class Stage {
+String id
+String name
+String avatarUrl
+String status
+int progress
+int currentScore
}
class StageWord {
+String id
+enum status // done, pending, fail
+Date lastUpdatedDateTime
}


User "1" -- "1" GameProgress : tracks progress
Word "1" -- "*" Pronunciation : has pronunciation
Word "*" -- "*" Category : belongs to multiple
Word "*" -- "1" Level : has level
GameProgress "1" -- "*" Stage : is at stage
Stage "*" -- "1" Level : has level
Stage "1" -- "*" StageWord : has tracked words
Word "1" -- "*" StageWord : has stageword
```

## PR Submission Checklist

### **Completed Tasks**:

- [x] Review and Improve Model v0.2

- [x] Implement One-to-One: UserApp and GameProgress

- [x] Create Many-to-Many: Word and Category

- [x] Implement One-to-Many/Many-to-One Relationships

- [x] Configure JPA Annotations

- [x] Create Repository Interfaces

- [ ] Implement Basic Service Methods

- [x] Test Relationships:

- [x] Word "1" -- "m" Pronunciation

- [x] Word "1" -- "m" StageWord

- [x] Stage "1" -- "m" StageWord

- [x] Word "m" -- "1" Level

- [x] GameProgress "1" -- "m" Stage

- [x] Stage "m" -- "1" Level

- [ ] Data Auditing

- [ ] Advanced Validation

- [ ] Pagination and Sorting Support

- [ ] Custom Query Optimization

### **Testing**:

- [ ] Relationship integrity tests
- [ ] Cascade operation tests
- [ ] Fetch strategy validation

---

## Estimated Time for Tasks

### Common Part

| Task | Estimated Time | Actual Time | Impediments | New Concepts |
| -------------------------------------- | -------------- | ----------- | ----------- | ------------------------------- |
| Model Review | 15 min | 10 min | | JPA mapping |
| One-to-One (User-App and GameProgress) | 15 min | 30 min | | Enums (@Enumerated annotation) |
| Many-to-Many (Word - Category) | 15 min | 30 min | | Join Table configuration |
| One-to-Many & Many-to-One | 1:30 hours | 2 hours | | |
| Relationship Configuration | 1 hour | | | Cascade types |
| Repository Creation | 10 min | 10 min | | Spring Data JPA |
| Service Implementation | 1 hour | | | Service layer patterns |
| Testing | 2 hours | 2:30 hour | | @ActiveProfiles, @Transactional |
| **Total** | **6:30 hours** | | | |

### Optional Part

| Task | Estimated Time | Actual Time | Impediments | New Concepts |
| ---------------------- | -------------- | ----------- | ----------- | ------------------- |
| Data Auditing | 1 hours | | | JPA Auditing |
| Advanced Validation | 1:20 hours | | | Bean Validation |
| Pagination and sorting | 2 hours | | | Pageable interface |
| Custom Queries | 1 hour | | | JPQL/Native queries |
| **Total** | **5:20 hours** | | | |

---

## Error Documentation and Solutions

### Error: `[ERROR_MESSAGE]`

**Corresponding Task:** [RELATED_TASK]

**Description:** [ERROR_DESCRIPTION]

**Error Trace:**

- **Component:** [COMPONENT_NAME]
- **File:** [FILE_NAME]
- **Line:** [ERROR_LINE]
- **Stack Trace:**
- [ERROR_TRACE]

**Possible Causes:**

- [POTENTIAL_CAUSES]

**Solution:**

```jsx
// Fixed code or solution
```

**Explanation:** [EXPLANATION_OF_THE_SOLUTION]

---

## Future Improvements

- **Caching Mechanism** - Add Hibernate second-level cache configuration
20 changes: 19 additions & 1 deletion backend/pronunciationAppBack/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<artifactId>pronunciationAppBack</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>pronunciationAppBack</name>
<description>Spring Boot for app pronunciatoin</description>
<description>Spring Boot for app pronunciation</description>
<url/>
<licenses>
<license/>
Expand All @@ -34,6 +34,11 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
Expand Down Expand Up @@ -65,6 +70,19 @@
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.datafaker</groupId>
<artifactId>datafaker</artifactId>
<version>2.4.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.instancio/instancio-junit -->
<dependency>
<groupId>org.instancio</groupId>
<artifactId>instancio-junit</artifactId>
<version>5.4.0</version>
<scope>test</scope>
</dependency>

</dependencies>

<build>
Expand Down
Loading