Alumni Network
Alumni platform for NIT Arunachal Pradesh: directory, mentorship, jobs and events
- Role
- Solo project, Coding Pundit
- When
- 2026
- Links
- Source
Overview
A modular monolith for the institute's alumni network: 15 business modules in one Next.js app, a worker for background jobs, and PostgreSQL holding every durable fact.
The constraint
Every durable fact has to live in PostgreSQL. Losing Redis or the queue can slow things down, but must never lose an email, a notification or a booking.
What I built
- 01
Each use case writes its rows and an outbox event in one transaction. The worker claims unpublished events with FOR UPDATE SKIP LOCKED and enqueues them in BullMQ with the event id as job id, so idempotent processors absorb at-least-once delivery.
- 02
Concurrency rules live in the database: unique and partial unique indexes, CHECK constraints, guarded state transitions and row locks for event seats, mentor capacity and group size.
- 03
Better Auth with database sessions, so revoking a session takes effect on the next request. Every use case calls authorize() against permissions, never roles, with grants that can be scoped to a chapter.
- 04
Uploads go straight to S3-compatible storage, then the worker scans them with ClamAV and re-encodes to WebP, failing closed. Directory search runs on PostgreSQL with pg_trgm and keyset pagination.
- 05
Module boundaries are enforced by ESLint, dependency-cruiser and architecture tests across a pnpm and Turborepo workspace, with Prometheus, Grafana and runbooks for operations.
Request path
- Nginx
- Next.js (Server Actions, /api/v1)
- PostgreSQL + outbox
- Worker relay
- BullMQ
- Email, uploads, notifications
From the code
const rows = await tx.$queryRaw<OutboxEventRow[]>` SELECT id::text AS id, type, payload, request_id AS "requestId", created_at AS "createdAt" FROM outbox_event WHERE published_at IS NULL AND failed_at IS NULL AND type = ANY(${[...knownTypes]}::text[]) ORDER BY created_at LIMIT ${limit} FOR UPDATE SKIP LOCKED`;if (rows.length === 0) return 0; const result = await publish(rows);Outcome
15 business modules over a 42-model schema, with an append-only audit log and a documented failure mode for every dependency. In active development.
- Next.js
- TypeScript
- PostgreSQL
- Prisma
- Redis
- BullMQ
- Better Auth
- Turborepo
Next project
AEIA
AI assistant that answers questions about a codebase, with citations