Advanced Backend Development for Innovative App

Job ID: 39915686

Budget: ₹1,500 – ₹12,500 INR

Backend Implementation Requirements
These points detail the necessary backend work for the new features, focusing on database changes, logic, and API endpoints.

1. Onboarding Data Structure
Requirement: Update the onboarding API to receive an array of strings (multi-select answers) for relevant questions, replacing the current single-string input.

Action: Modify the user schema/model to accommodate a UserOnboardingData field that stores an array of key-value pairs or tags (['sleep_anxiety', 'focus_goals', 'stress_reduction']) for richer personalization logic.

2. User Persona and Daily Challenge Logic
Requirement: Develop an algorithm that processes the new multi-select onboarding data to generate two dynamic outputs:

A text summary for the User Persona Page (e.g., "The Resilience Builder").

A filter/ranking set used to populate the Daily Challenge Page with highly relevant, personalized activities.

Action: Implement the data processing logic in a dedicated service layer that runs post-onboarding and updates a UserPersonalizationProfile field on the user model, ensuring quick look-up for feature rendering.

3. Anchor + Novelty Routine Data Modeling
Requirement: Create a new data model for the AnchorRoutine feature. This model must store the activity IDs and be structurally similar to the existing Activity content model.

Action: Design an API endpoint (/api/routines/anchor-novelty) to serve the content, which will include fields for type: 'anchor' or type: 'novelty', activity_id, and description.

4. Anchor Activity Selection Logic
Requirement: Implement the business logic for selecting and managing Anchor Activities.

The API must serve 6 pre-filtered Anchor Activity IDs (likely based on the user's Persona/Profile).

The backend must accept and validate the user's selection of exactly 3 activity IDs and store them in the user's ActiveAnchorRoutines array.

Action: Develop the selection endpoint (/api/user/set-anchor-routines) with validation checks for count (3) and activity type (Anchor).

5. Community Real-Time Notification via Sockets
Requirement: Leverage the existing Socket (or WebSockets) infrastructure to track and broadcast unread events (new replies, mentions) within the community feature.

Action: Implement a socket event handler that increments and tracks an UnreadCommunityCount field on the user profile, allowing the frontend to show the badge icon without constant polling.

6. Mood Tracker and Journal Export API
Requirement: Develop a dedicated, secure API endpoint to fetch and format a user’s complete historical mood and journal data.

Action: Create an endpoint (/api/data/export) that queries all records from the MoodTracker and JournalEntry models for the authenticated user, serializes the data, and prepares it for file generation (e.g., CSV or a simple JSON/PDF structure). Security and rate limiting are critical here.

7. Anchor Activity Review Trigger
Requirement: Implement a mechanism to track a user's usage duration and trigger a review prompt.

Implement a mechanism to prompt the user to review their current Anchor Routines after 10 days of enrollment. If the user chooses to change them, the system must trigger the selection flow again.

i have limited budget for this 5k.