Skip to content
KheAi

Archives

All the articles I've archived.

2026 99
June 16
May 26
  • The README — Enterprise NestJS Monorepo (enterprise-todo)

    The production-ready README for the enterprise-todo repository built across all 24 parts of this series. Copy this into your repo's README.md — it covers stack, prerequisites, getting started, every environment variable, every script, the architecture, and all known gotchas.

  • Tech Lead SDLC & Daily Workflow: Ticket to Production

    The complete SDLC from ticket to production — SDLC phases, daily workflow, a real end-to-end case study building the Product module, sprint ceremonies, code review standards, ADRs, and onboarding new developers.

  • Memory, Knowledge Graphs & Code Intelligence

    The authoritative reference for Claude's three-layer knowledge system - persistent memory, graphify codebase graph, and gitnexus call graph — what each stores, how to maintain them, and how they compose.

  • MCP Setup - GitHub, ClickUp & Lark Integration

    Set up GitHub MCP for PR and CI management, ClickUp MCP as your primary project management integration, and Lark MCP as a team comms alternative — all from the terminal without context-switching.

  • Claude Code & the AI Development Layer

    By the end of this part, you will learn Claude Code configuration, MCP servers, graphify, gitnexus, and the 6-phase AI-accelerated module workflow.

  • Production Deployment — ECS Fargate, RDS, ElastiCache & Zero-Downtime Releases

    Deploy both NestJS apps (api + portal-api) and the Next.js frontend to AWS ECS Fargate with RDS PostgreSQL, ElastiCache Redis, Secrets Manager for environment variables, a GitHub Actions CD pipeline, and a zero-downtime migration strategy using one-off ECS tasks

  • Git Commit Standards & CI/CD Pipeline

    Set up Commitizen with correct selective staging, Husky pre-commit hooks, branch strategy, GitHub branch protection rules, Docker multi-stage build, GitHub Actions CI/CD, and production migration patterns on AWS ECS Fargate.

  • Affiliate & Referral Tree — Materialized Path Hierarchy on UserEntity

    Add a self-referential affiliate tree to UserEntity using the materialized path pattern — store each user's ancestry as a string path, enabling O(1) depth lookups, efficient descendant queries with a single LIKE clause, and referral commission calculations without recursive CTEs.

  • AstroPaper 6.0

    AstroPaper v6: a from-scratch rewrite on Astro v6, Tailwind v4, and a new config system.

  • Media Library — S3 Presigned Uploads, Magic Byte Validation & CDN

    Build a production-grade media library with S3 presigned upload URLs, Bull-queue post-processing, magic-byte file-type validation, sharp thumbnail generation, and CloudFront CDN delivery — without ever routing file bytes through your API server.

  • Dual-App Monorepo — Portal API & Platform Interceptor

    Add a second NestJS app (portal-api) for your internal operations team, wire up a RequestPlatformInterceptor that prevents user JWTs from working on the admin portal, and complete the enterprise-todo monorepo as a fullstack replacement scaffold.

  • Multi-tenancy & Role-Based Access Control (RBAC)

    By the end of this part, you will learn multi-tenancy, tenantId pattern, TenantGuard, RBAC, Dual-auth architecture, @Authorize and promoting a module to multi-tenant.

  • Advanced Data Patterns — Column Transformers, Audit Columns & Shared Libraries

    Add reusable TypeORM column transformers (lowercase, slug), wire up createdBy/updatedBy audit columns via a request-scoped TypeORM subscriber, build a running number service for ordered sequences, and extract shared config into libs/core for multi-app monorepo reuse.

  • Queues & Real-time

    By the end of this part, you will learn about async queues, Bull, Redis, GraphQL Subscriptions and when to use.

  • Testing - Unit + E2E

    By the end of this part, you will learn the enterprise testing philosophy, Unit tests, mock TypeORM correctly, E2E tests and run tests in CI.

  • Case Study 2 - Todo Module (FK + Auth + DataLoader)

    By the end of this part, you will be building a module with a foreign key to another entity (Todo → User) and learn about solving N+1 problem with DataLoader.

  • Case Study 1 - Tag Module (Complete 9-Step Build)

    By the end of this part, you follow every step of the 9-step pattern with nothing skipped — from empty directory to running GraphQL queries in the Playground, with unit tests passing. This is your first complete module build from scratch.

  • Extended Auth — Email Service, Secured Tokens & Two-Factor Authentication

    Add transactional email via Bull queues, a single-use SecuredToken module for password reset and email verification, and TOTP two-factor authentication with otplib and qrcode.

  • Authentication, Guards & Security Patterns

    By the end of this part, you will learn RS256, AuthModule, Passport JWT, AuthJwtGuard, @CurrentUser, ValidationPipe, forbidNonWhitelisted and Dual-auth architecture.

  • GraphQL API + Next.js Frontend

    By the end of this part, you will learn DTOs, @Field, @FilterableField, class-validator, resolver anatomy, QueryArgsType, ConnectionType, and FilterQueryBuilder for backend. As well as Next.js, Shadcn UI, Apollo, writing GraphQL queries and mutations.

  • CQRS - The Enterprise Request Pipeline

    By the end of this part, you will learn CQRS, request lifecycle, GraphQL mutation, 9-step module pattern, and index pattern.

  • Production Hardening — Config Validation, Logging & Security Middleware

    Add Joi environment validation, typed config mapper, global LoggingInterceptor, Helmet, rate limiting and a custom ExceptionFilter — the production hardening layer that prevents silent failures in any NestJS app.

  • Database - PostgreSQL, TypeORM, Entities & Migrations

    By the end of this part, you will learn PostgreSQL, TypeORM, AbstractEntity, SnakeNamingStrategy, migration lifecycle and verify your schema in Adminer.

  • TypeScript Decorators, NestJS DI & the Module System

    By the end of this part, you will learn TypeScript decorators, NestJS module system and dependency injection, difference between GraphQL and REST, and Writing your first NestJS module by hand.

  • Environment Setup & Nx Workspace

    Set up the entodo Nx monorepo from scratch — Node, Yarn, Docker, NestJS, Next.js, PostgreSQL, and a Conventional Commits workflow with GitHub Desktop and Commitizen.

  • From Meteor Magic to NestJS Enterprise Clarity

    The enterprise pattern is not harder to write — it is harder to learn. Every decision Meteor makes for you — you make yourself, in code, where it is visible, testable, and changeable. Once you know the pattern, writing a new feature is a repeatable 9-step checklist. Any developer on your team can pick up any module and immediately know where to find the business logic, the validation, the data shape, and the test.

April 20
March 34
January 3
  • The Mind Sovereign Protocol

    Life is a process of reclaiming ourselves from a sea of bacteria, hormones, and genetic programming. Sovereignty is the process of unlearning. The most expensive things in life—clarity, peace, and health—require the least money but the highest discipline.

  • Nostr NIP-05 Verification Guide

    A practical walkthrough of NIP-05, showing how domains bridge human identity and cryptographic keys in the Nostr Web3 stack for decentralized communication, without tokens or gatekeepers.

  • The High-Tech Farmer-Philosopher

    We explore the hard-path to self-sufficiency through cognitive mastery and biological optimization, seeking a life of philosophical integrity beyond urban dependence.

2025 29
August 1
July 9
June 18
March 1
  • AstroPaper 5.0

    AstroPaper v5: keep the clean look, updates under the hood.

2024 3
July 1
January 2
2023 3
September 1
  • AstroPaper 3.0

    AstroPaper Version 3: Elevating Your Web Experience with Astro v3 and Seamless View Transitions

July 1
January 1
  • AstroPaper 2.0

    AstroPaper with the enhancements of Astro v2. Type-safe markdown contents, bug fixes and better dev experience etc.

2022 7
September 4
July 1
June 1
March 1