LIVEIT: Habit Platform for Spiritual Growth

Project

LIVEIT Platform (Monorepo)

My Role

Backend + Platform Engineer

Duration

2025 - Present

Tech Stack

Flutter (Bloc + Dio), NestJS 11, Prisma 6, PostgreSQL, SvelteKit, Appwrite (Auth/Storage/Tables), Redis (optional), Swagger, Docker

Platform Scope

Mobile App + Backend API + Internal CMS for content and user progression

LIVEIT Platform Architecture

Project Overview

LIVEIT is a faith-based platform that helps young Christians build real spiritual habits through an action-oriented habit tracker, meaningful gamification (Zoe Points, streaks, badges), and curated inspirational content. The product is built as a monorepo with a Flutter mobile client, a NestJS backend as the source of truth, and a SvelteKit CMS used internally to manage content.

Platform Architecture

  • Clients: Flutter app (consumer) and SvelteKit CMS (internal admin)
  • Backend: NestJS API as the single entry point and business logic layer
  • Data: PostgreSQL via Prisma for core domain data; Appwrite for auth/storage/tables (proxy + hybrid strategy)

Data Flow

Flutter App  ----\
                 \\--> NestJS API --> PostgreSQL (Prisma)
SvelteKit CMS ----/                 \
                                   --> Appwrite (Auth/Files/Tables)

Repositories

liveit-server (Backend API)

  • NestJS 11 + Prisma/PostgreSQL as source of truth
  • Appwrite proxy integration for auth/storage/tables
  • Swagger docs, rate limiting, Docker deployment path

liveit-flutter (Mobile App)

  • Flutter + Bloc for state management, Dio for HTTP
  • Consumes backend APIs for auth, habits, gamification, content
  • Built for young adult audience (18-35) with habit-first UX

liveit-web (CMS Admin)

  • SvelteKit CMS for articles/content workflows
  • Uses backend API with admin gating (JWT + allowlist)
  • Supports Medium-like content model and asset uploads

Core Capabilities

Auth & Profiles

  • Appwrite-proxy auth (email/password + OAuth) + JWT
  • Email-claim flow with TTL and profile privacy controls
  • Profile summary endpoints with habit + gamification aggregates

Habit Tracker

  • Idempotent check-in/undo; archive without losing history
  • Timezone-aware day boundary (requires profiles.timezone)
  • Custom habits + reporting + moderation hooks
  • Phase 2A scheduling: frequency/repeat period + ordering + visuals

Gamification

  • Zoe Points awards: check-in, all-done, streak milestones
  • Badges/achievements with reflection prompts + level system
  • Points history audit log with hybrid storage strategy

Devotionals

  • Daily devotional delivery via Appwrite Tables facade
  • Like/unlike, view count, reading time, and habit integration
  • Designed for curation-first, low-conflict consumption

Articles CMS

  • Medium-like content: ProseMirror JSON + derived word/read time
  • Draft/publish/unpublish lifecycle + public slug endpoints
  • Asset uploads (image/video) with size/MIME checks + admin gating

Current Status

  • Implemented: Auth, Profiles, Habit Tracker, Gamification, Devotionals, Articles CMS
  • In progress / planned: push notifications (reminders) and content seeding workflows

Reliability & Operations

  • API docs: Swagger UI at /api with bearer auth
  • Global rate limiting via @nestjs/throttler with per-route overrides
  • Configurable cache layer: Redis or in-memory (CACHE_DRIVER)
  • Structured JSON logs (nestjs-pino) with requestId propagation
  • Dockerized deployment path + Prisma migrations/seed scripts

Deployment (DigitalOcean App Platform)

Service Setup

  • App Platform Web Service linked to repository
  • Build command: npm ci && npm run build
  • Run command: npm run start:prod (App Platform sets PORT)
  • Health check path: / (simple hello route)
  • Scaling: 1 container to start; enable autoscale later

Environment

  • NODE_ENV=production, JWT_KEY
  • DATABASE_URL (attach DO Managed PostgreSQL)
  • Cache: CACHE_DRIVER (memory/redis) + REDIS_HOST/REDIS_PORT when enabled
  • APP_URL, FRONTEND_URL
  • APPWRITE_ENDPOINT, APPWRITE_PROJECT_ID, APPWRITE_API_KEY
  • Appwrite IDs: APPWRITE_DB_ID, APPWRITE_*_COLLECTION_ID, APPWRITE_*_BUCKET_ID
  • CMS admin gating: CMS_ADMIN_EMAILS
  • Logging: LOG_LEVEL, PRISMA_SLOW_QUERY_THRESHOLD_MS
  • Connect repo → select main branch → set commands and env vars
  • Attach Managed PostgreSQL; App Platform injects DATABASE_URL
  • First deploy: run npm run migrate:deploy (manually or pre-release step)
  • Zero-downtime updates via rolling deploy; view logs in App Platform UI

Ownership & Outcomes

  • Shipped platform foundations across Auth, Profiles, Habit Tracker, Gamification, Devotionals, and Articles
  • Built secure-by-default patterns: guards, DTO validation, and per-route throttling
  • Established production ops baseline: Swagger docs, JSON logs + requestId, and a Redis-to-memory cache fallback
  • Enabled internal content workflows via a dedicated CMS + admin gating