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
| Value | Behavior |
|---|---|
TEXT | Free-text answer stored in answer field |
MOOD | Answer is a MoodType enum value stored in mood field |
MoodType Categories
| Category | Example moods |
|---|---|
| Positive | JOY, HAPPINESS, EXCITEMENT, RELAXED, CURIOSITY |
| Negative | SADNESS, ANGER, ANXIETY, FEAR, FRUSTRATION |
| Neutral | AMBIVALENCE, CONFUSION, SURPRISE, NOSTALGIA |
| Physical | TIRED, STRESSED, OVERWHELMED |
| Complex | Mixed emotional states |
25 mood types total, each with an emoji and display label.
API Endpoints
| Method | Path | Description |
|---|---|---|
GET | /daily-journals | List all entries (paginated) |
GET | /daily-journals/byDateRange | Entries in a date range |
GET | /daily-journals/entry/{date} | Entry by date (dd/MM/yyyy) |
GET | /daily-journals/entries | Entries list for a range |
POST | /daily-journals | Create 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
| File | Purpose |
|---|---|
shared/.../services/dailyjournal/models/DailyJournalModels.kt | DailyJournal, QuestionAnswer, MoodType (25 values) |
journal/journal_domain/.../repository/JournalRepository.kt | Repository interface |
journal/journal_data/.../repository/JournalRepositoryImpl.kt | Repository implementation |
journal/journal_presentation/.../viewmodel/JournalViewModel.kt | State management — history, questions, completion |
server/.../routing/DailyJournalRouting.kt | 8 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
currentDateTimeexplicitly if needed.
Mood answer not saving
MOODquestions requiremoodfield, notanswer; verify the payload sets the correct field.- Ensure
typeisMOODon theQuestionAnswerobject 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.
| Method | Path | Description |
|---|---|---|
GET | /daily-journals | List journal entries (paginated) |
POST | /daily-journals | Create 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 | /questions | List custom questions (paginated) |
POST | /questions | Create a custom question |
GET | /question-answers/byDailyJournal/{id} | Get answers for a journal entry |
Related Docs
- UI & UX — journal screen flows and mood picker UX
- Testing & QA — testing strategy