Skip to Content
FeaturesJournalJournal Feature Guide

Journal Feature Guide

Guide to the daily Journal module — reflection entries with customizable Q&A, mood tracking across 25 emotion types, and historical review.

Overview

The Journal module provides a daily reflection system. Each entry has a title, summary, and a set of question-answer pairs drawn from configurable journal questions. Questions can be text-based or mood-based. Mood answers are captured as one of 25 typed emotions (e.g. JOY, ANXIETY, NOSTALGIA) each carrying a category (Positive, Negative, Neutral, Physical, Complex) and an emoji. Entries are date-scoped — one entry per day.

Architecture

Questions are fetched separately from entries and reused across days — only the answers are stored per entry.

Data Models

QuestionType

ValueBehavior
TEXTFree-text answer stored in answer field
MOODAnswer is a MoodType enum value stored in mood field

MoodType Categories

CategoryExample moods
PositiveJOY, HAPPINESS, EXCITEMENT, RELAXED, CURIOSITY
NegativeSADNESS, ANGER, ANXIETY, FEAR, FRUSTRATION
NeutralAMBIVALENCE, CONFUSION, SURPRISE, NOSTALGIA
PhysicalTIRED, STRESSED, OVERWHELMED
ComplexMixed emotional states

25 mood types total, each with an emoji and display label.

API Endpoints

MethodPathDescription
GET/daily-journalsList all entries (paginated)
GET/daily-journals/byDateRangeEntries in a date range
GET/daily-journals/entry/{date}Entry by date (dd/MM/yyyy)
GET/daily-journals/entriesEntries list for a range
POST/daily-journalsCreate new entry
GET/daily-journals/{id}Get entry by ID
PATCH/daily-journals/{id}Update entry
DELETE/daily-journals/{id}Delete entry

Client Behavior

The ViewModel checks for an existing entry first; if none exists it presents the question list for the user to answer.

Key Files

FilePurpose
shared/.../services/dailyjournal/models/DailyJournalModels.ktDailyJournal, QuestionAnswer, MoodType (25 values)
journal/journal_domain/.../repository/JournalRepository.ktRepository interface
journal/journal_data/.../repository/JournalRepositoryImpl.ktRepository implementation
journal/journal_presentation/.../viewmodel/JournalViewModel.ktState management — history, questions, completion
server/.../routing/DailyJournalRouting.kt8 REST endpoints

Testing

  • Unit: MoodType category classification; verify all 25 types have a non-null emoji and label.
  • Unit: Answer payload builder — only non-empty answers should be included in the POST body.
  • Integration: create entry, fetch by date, verify Q&A round-trip; update entry and confirm changes persist.
  • Edge cases: entry on the last day of a month; duplicate entry for the same date (server should reject or overwrite).

Troubleshooting

Entry not found for today

  • Confirm date format is dd/MM/yyyy — the server is strict about this format.
  • Timezone mismatch: the client’s “today” may differ from the server’s — pass currentDateTime explicitly if needed.

Mood answer not saving

  • MOOD questions require mood field, not answer; verify the payload sets the correct field.
  • Ensure type is MOOD on the QuestionAnswer object when submitting.

Questions list empty

  • Questions are user-configurable; if none have been created the list will be empty.
  • Default questions can be seeded server-side; check if the seed migration has run.

API Endpoints

All endpoints require JWT authentication and are prefixed with /api/v1. See server/README.md for full reference.

MethodPathDescription
GET/daily-journalsList journal entries (paginated)
POST/daily-journalsCreate a journal entry
GET/daily-journals/entry/{date}Get journal entry for a specific date (dd/MM/yyyy)
GET/daily-journals/{id}Get journal entry by ID
PATCH/daily-journals/{id}Update journal entry
DELETE/daily-journals/{id}Delete journal entry
GET/questionsList custom questions (paginated)
POST/questionsCreate a custom question
GET/question-answers/byDailyJournal/{id}Get answers for a journal entry