Nested quest writes
Quest serializers create and replace related subtasks in the same request, matching the mobile client's task-composition workflow.
A Django REST API for a mobile productivity companion, combining email-verified authentication, personalized profiles, user-owned quests, progress analytics, and AI-generated reflections, suggestions, and subtasks.
01Context
Nowlii is a Django and Django REST Framework backend for a mobile productivity companion. It manages verified accounts, customizable companion profiles, scheduled quests, nested subtasks, progress reporting, and AI-assisted recommendations.
The product needed to keep each user's goals and progress isolated while converting quest activity into useful weekly and monthly feedback for a mobile client.
Build an authenticated API that supports daily planning, personalized companion profiles, measurable progress, and provider-independent AI assistance.
The repository separates users, quests, AI subtask generation, and insights into Django applications; scopes protected data by the authenticated user; derives analytics from stored quest state; and caches generated insight payloads to limit repeated AI calls.
02Ownership
The areas I owned end to end as Backend Engineer.
Email OTP registration, JWT sessions, password recovery, and personalized companion profiles
User-scoped quest and nested subtask workflows with scheduling, completion tracking, bulk deletion, and streaks
Weekly and monthly analytics with cached, multi-provider AI reflections and quest suggestions
03System design
Layer 01
Users, quests, AI subtask generation, and insights are separated into focused applications with their own models, serializers, views, routes, and migrations.
Layer 02
Authenticated profile, quest, subtask, and insight operations resolve data through the requesting user, preventing cross-account access to personal productivity state.
Layer 03
Deterministic services aggregate quest completion, zones, calendars, and streaks before provider adapters generate reflections and suggestions that are stored in a per-user weekly cache.
04Engineering judgment
Quest serializers create and replace related subtasks in the same request, matching the mobile client's task-composition workflow.
Profiles, quests, bulk deletion, subtasks, streaks, and analytics are filtered through the authenticated user instead of trusting client-supplied ownership identifiers.
AI generation selects Anthropic, OpenAI, or Gemini from configured credentials and normalizes provider output through JSON parsing and DRF response serializers.
05Toolbox
06Capabilities
Email registration and password recovery use six-digit OTPs with 15-minute expiry, alongside JWT login and refresh-token blacklisting.
One-to-one profiles support uploaded images, predefined companion characters, custom companion names, language selection, and voice preference.
Authenticated CRUD supports scheduling, four effort zones, nested subtasks, completion flags, repeat and reminder settings, date filtering, bulk deletion, and streak calculation.
Weekly reflections, personalized quest suggestions, AI-generated subtasks, monthly milestones, productivity calendars, and zone progress are exposed through authenticated endpoints.
07Problem solving
Challenge 01
Raw completion flags, subtasks, dates, and difficulty zones do not directly provide useful progress insights.
Dedicated analytics services calculate completion totals, productive days, zone ratios, skipped days, calendar states, and streak milestones before sending a structured summary to the AI layer.
Challenge 02
Generating multiple AI responses on every insights request would add latency, cost, and dependence on inconsistent provider output.
Prompt builders require JSON-only responses, provider errors map to explicit API failures, and generated weekly reflections and suggestions are cached with an optional refresh path.
08Result
Delivered a documented REST API covering account verification, profiles, quests, subtasks, streaks, and productivity insights.
Combined deterministic progress analytics with cached generative-AI recommendations across three supported providers.
Prepared containerized development and production workflows with PostgreSQL support, S3 media storage, Docker Hub publishing, and EC2 deployment.
09Reflection
Productivity recommendations are more dependable when deterministic analytics are calculated before invoking a generative model.
User ownership should be enforced at the queryset boundary for every personal resource, including aggregate and bulk operations.
Next step
I take on backend, API, and DevOps work — from data modelling and REST design through containerization and production deployment.
A project case study by Md Fahad Mir — Backend & DevOps Engineer, Dhaka, Bangladesh.