An application whose main function is to allow a user to record daily notes of gratitude and a rating of their mood.
- Mehlia Rahman
- Billie Redwood
- Rashad Ramali
- Joseph Carpentieri
- Thomas McLaughlin
- Implements habits of reflection and appreciation into a users daily routine.
- Prompt users to engage with their mood and mental health in a positive way.
- Identify possible trends in a users lifestyle so feedback can be customised and tailored for each specific use case.
- Create code that is clearly written and well formatted to make it easy to work and extend upon.
- Code-base available on an open source basis to allow for easier development within wellbeing software space.
- Spring Boot Starter Data JPA
- Spring Boot Starter Web
- Spring Boot devtools
- Spring Boot Starter Mail
- Postgresql
- Clone from github repo:
git@github.com:mclaughlin111/BNTA_BackendProject_GratitudeJournal.git
- Open up
GratitudeJournal
folder in intellij (or IDE of choice). - Check dependencies for spring dependencies specified above in pom.xml - if not installed it will not run correctly.
- Create a postgreql database called gratitude_journal in terminal.
- Run GratitudeJournal.java application.
- Test mapping routes in API server of choice (Click here to download our pre-mapped Postman Collection to test routes).
-
Add a Journal Entry:
- Select day of the week ✅
- Input mood rating for the day ✅
- Enter a gratitude entry in the journal ✅
-
Display all Journal Entries ✅
-
Update Journal Entry ✅
-
Delete Journal Entry ✅
- Create a User ✅
- Update User Credentials ✅
- Delete User ✅
- Filter Journal Entries by
Weekday
✅ - Filter Journal Entries by
userId
✅ - Filter Journal Entries by
moodRating
- Upon 5 Journal Entries for a single day, allow no additional entries ✅
- When 5 entries have been inputted on a single day, show status of Journal as
COMPLETE
. - Write a method that calculates a weekly average from a users
MoodRating
and returns a score.
- Create a database of motiviational quotes
- Write a method that returns a motivational quote to a user on a random basis
- Send Email message directly to a users email address✅
- extend method to only send motivational quotes to users below a certain MoodRating or below a specific
JournalEntry
average
- Create a 'Streak' system that rewards users for continued daily usage at certain milestones (i.e. 3 days, 1 week, 1 month) with a virtual ⭐️ point system.
Gratitude Journal Class Diagram
GET localhost:8080/Users
JSON RESPONSE
{
"id": 1,
"name": "Billie",
"emailAddress": "billie@bnta.com"
},
{
"id": 2,
"name": "Tom",
"emailAddress": "toma@bnta.com"
},
{
"id": 3,
"name": "Mehlia",
"emailAddress": "mehlia@bnta.com"
},
{
"id": 4,
"name": "Joe",
"emailAddress": "joe@bnta.com"
}
GET localhost:8080/Users/id
{
"id": 1,
"name": "Billie",
"emailAddress": "billie@bnta.com"
}
POST localhost:8080/Users
RequestBody: User
{
"name" : "username",
"emailAddress" : "emailaddress"
}
PATCH localhost:8080/Users/id
RequestBody: UserDTO
{
"name" : "updated_username",
"emailAddress" : "updated_emailaddress"
}
DELETE localhost:8080/Users/id
GET localhost:8080/journal-entries
{
"id": 1,
"content": "I had a great day today",
"weekDay": "FRIDAY",
"moodRating": "REALLYGOOD"
},
{
"id": 2,
"content": "I had bad day",
"weekDay": "TUESDAY",
"moodRating": "REALLYBAD"
},
{
"id": 3,
"content": "I had a good day",
"weekDay": "THURSDAY",
"moodRating": "POSITIVE"
},
{
"id": 4,
"content": "I had an average day",
"weekDay": "SUNDAY",
"moodRating": "INDIFFERENT"
},
{
"id": 5,
"content": "I had a mediocre day",
"weekDay": "MONDAY",
"moodRating": "NEGATIVE"
},
{
"id": 6,
"content": "I had a brilliant",
"weekDay": "FRIDAY",
"moodRating": "REALLYGOOD"
}
GET localhost:8080/journal-entries/id
{
"id": 1,
"content": "I had a great day today",
"weekDay": "FRIDAY",
"moodRating": "REALLYGOOD"
}
POST localhost:8080/journal-entries/id
RequestBody: JournalEntry
PATCH localhost:8080/journal-entries/id
RequestBody: EntryDTO
{
“content”: “I had a beaut day”,
“weekDay”: “WEDNESDAY”,
“moodRating”: “POSITIVE”
}
DELETE localhost:8080/journal-entries/id
-
Display all journal entries -
"/journal-entries"
-
Include optional path variable to display by journal entry ID -
"/{id}"
-
Response entity returns a List of all journal entries back to the user, or specific journal by ID.
-
Return
HTTPStatus.OK
- Include request body. Use a EntryDTO to get the UserId-
"userId" = 1,
"content" = "I am grateful.",
"weekDay" = "Monday",
"moodRating = "Great"
- Response entity returns the posted journal entry back to the user
- Return
HTTPStatus.CREATED
- Include path variables to select JournalEntry ID that we want to update -
"/{id}
- Include request body of a journalEntry object to input information to be updated.
- Response entity returns the updated journal entry back to the user.
- Return
HTTPStatus.OK
- Include path variable to select JournalEntry ID that we want to delete -
"/{id}
. - Response entity returns JournalEntry ID that we deleted.
- Return
HTTPStatus.OK
-- Link to: Group Presentation