Fix/journal frontend - #54
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Kavinduk2
approved these changes
Mar 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces significant improvements to the journal feature in the backend, focusing on more robust file upload handling, improved validation, and new analytics endpoints. The changes include a new flexible image upload service with local disk fallback, enhanced input validation and parsing for journal entries, and a new endpoint for user writing statistics. Additionally, the codebase is refactored for better clarity and maintainability, with improved error handling and route organization.
Journal feature enhancements:
/api/journals/statsendpoint to provide users with aggregated writing statistics, including total entries, word count, top mood, writing streak, and mood distribution. [1] [2]File upload and static file serving:
/uploadswhen Cloudinary is not configured, making them accessible to the frontend. [1] [2]getFileUrlto generate correct public URLs for uploaded images, supporting both Cloudinary and local disk scenarios. [1] [2]API and route organization:
/journals/statsendpoint is registered before parameterized routes to avoid conflicts.These changes make the journal API more robust, secure, and flexible for both development and production environments.