Skip to content

Backend: Implemented Profile Data & Calendar Journals#1

Open
ananyavarshney1 wants to merge 1 commit into
ArshiaAdhya:mainfrom
ananyavarshney1:feature/profile-backend
Open

Backend: Implemented Profile Data & Calendar Journals#1
ananyavarshney1 wants to merge 1 commit into
ArshiaAdhya:mainfrom
ananyavarshney1:feature/profile-backend

Conversation

@ananyavarshney1

Copy link
Copy Markdown
Collaborator

🚀 Overview

This PR implements the backend required for the user Profile Page and the Calendar Journal interaction using Dart Frog and Supabase.

🛠 Changes Made

  • _middleware.dart: Added a global Supabase provider. Configured to use the .env file architecture to securely hold the service_role key (bypassing RLS securely for the backend).
  • GET /profile: Created an endpoint that accepts a userId query parameter and fetches the user's current streak and seeds from the users table.
  • GET /profile/journal: Created an endpoint that accepts a userId and date. It queries the journal_entries table and returns a JSON list of all journals for that specific day, including the summary_text, initial_mood, and final_mood.

🧪 Testing Notes for the Team

To make frontend development and testing easier, authentication checks are currently bypassed on these profile routes.

🔒 Security Note

  • The SUPABASE_SERVICE_ROLE_KEY has been moved to a local .env file and added to .gitignore. Whoever pulls this branch will need to create their own .env file in the backend/ folder to run the server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant