Backend2026

NowliiAI-Assisted Productivity API

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.

Primary technologies

  • Python
  • Django
  • Django REST Framework
  • Simple JWT
  • PostgreSQL
  • Docker
  • AWS
  • OpenAI · Anthropic · Gemini
Four Nowlii mobile screens: onboarding, daily plan, a timed quest session, and support chat

What this project is

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.

Engineering problem

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.

Success criteria

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.

What I designed, built, and shipped

The areas I owned end to end as Backend Engineer.

  1. Email OTP registration, JWT sessions, password recovery, and personalized companion profiles

  2. User-scoped quest and nested subtask workflows with scheduling, completion tracking, bulk deletion, and streaks

  3. Weekly and monthly analytics with cached, multi-provider AI reflections and quest suggestions

How the system is structured

  1. Layer 01

    Domain-oriented Django apps

    Users, quests, AI subtask generation, and insights are separated into focused applications with their own models, serializers, views, routes, and migrations.

  2. Layer 02

    User-scoped REST boundary

    Authenticated profile, quest, subtask, and insight operations resolve data through the requesting user, preventing cross-account access to personal productivity state.

  3. Layer 03

    Analytics and AI pipeline

    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.

Key technical decisions

Nested quest writes

Quest serializers create and replace related subtasks in the same request, matching the mobile client's task-composition workflow.

Ownership enforced in querysets

Profiles, quests, bulk deletion, subtasks, streaks, and analytics are filtered through the authenticated user instead of trusting client-supplied ownership identifiers.

Provider-independent AI selection

AI generation selects Anthropic, OpenAI, or Gemini from configured credentials and normalizes provider output through JSON parsing and DRF response serializers.

Technology stack

Application

  • Python 3.12+
  • Django 6
  • Django REST Framework
  • drf-yasg

Identity

  • Email OTP verification
  • Simple JWT
  • Token blacklisting
  • Django Allauth

Product

  • Companion profiles
  • Quests
  • Nested subtasks
  • Streaks
  • Weekly and monthly analytics

Infrastructure & AI

  • PostgreSQL
  • Amazon S3
  • Docker
  • GitHub Actions
  • Anthropic
  • OpenAI
  • Google Gemini

What the system does

Verified account flows

Email registration and password recovery use six-digit OTPs with 15-minute expiry, alongside JWT login and refresh-token blacklisting.

Personalized companion profiles

One-to-one profiles support uploaded images, predefined companion characters, custom companion names, language selection, and voice preference.

Quest and subtask management

Authenticated CRUD supports scheduling, four effort zones, nested subtasks, completion flags, repeat and reminder settings, date filtering, bulk deletion, and streak calculation.

AI-assisted insights

Weekly reflections, personalized quest suggestions, AI-generated subtasks, monthly milestones, productivity calendars, and zone progress are exposed through authenticated endpoints.

Challenges & solutions

Challenge 01

Turning quest history into actionable feedback

Problem

Raw completion flags, subtasks, dates, and difficulty zones do not directly provide useful progress insights.

Solution

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

Controlling external AI cost and variability

Problem

Generating multiple AI responses on every insights request would add latency, cost, and dependence on inconsistent provider output.

Solution

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.

What was delivered

  1. Delivered a documented REST API covering account verification, profiles, quests, subtasks, streaks, and productivity insights.

  2. Combined deterministic progress analytics with cached generative-AI recommendations across three supported providers.

  3. Prepared containerized development and production workflows with PostgreSQL support, S3 media storage, Docker Hub publishing, and EC2 deployment.

What I took away

  1. Productivity recommendations are more dependable when deterministic analytics are calculated before invoking a generative model.

  2. User ownership should be enforced at the queryset boundary for every personal resource, including aggregate and bulk operations.

Next step

Building something that needs this kind of backend?

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 MirBackend & DevOps Engineer, Dhaka, Bangladesh.