Thant Zin Phyo
Back to Selected Work
Technical DossierMulti-tenant student residence portal.

Dormitory Management System

A centralized administrative platform designed to manage student dormitories. It features role-based access control, automated student room allocation, billing records, and tracking for shared expenses and utilities.

Engineering Contribution

Full-stack development, authentication (Better Auth), database architecture (Neon Postgres), automated allocation logic, and responsive dashboard design.

Technology Stack

01 / Architecture

Frontend

  • Next.js 16
  • React 19
  • Tailwind CSS 4
  • Recharts

Backend & Database

  • Neon Serverless Postgres
  • Prisma ORM
  • Next.js Server Actions

Security & Storage

  • Better Auth
  • Bcryptjs
  • Zod

System Schematics

02 / Blueprints
Entity-Relationship Diagram
Fig. A — Entity-Relationship Diagram
Use Case Diagram
Fig. B — System Use Case Diagram

Core Modules

03 / Subsystems
Module 01

User Management & RBAC

Authentication powered by better-auth, distinguishing between Students and Administrators with secure session management.

  • Secure login and registration
  • Role-specific views
  • Session tracking
Module 02

Resident & Room Tracking

Manages student profiles, emergency contacts, room assignments, and move-in dates.

  • Profile management
  • Room allocation tracking
  • Active status toggling
Module 03

Billing & Shared Expenses

Comprehensive financial tracking for dormitory fees, shared utility purchases (water), and other expenses.

  • Record dormitory fee payments
  • Calculate cost-per-person for shared expenses
  • Track water bottle purchases
Module 04

Chore Management

System to track and assign daily/weekly chores like garbage disposal among residents.

  • Record garbage throwing turns
  • Add notes to chores
  • View chore history

Implementation Notes

04 / Code Excerpt

Better Auth Integration

The application uses the modern better-auth library for secure authentication, providing a robust session-based login system out of the box.

import { betterAuth } from "better-auth";
import { prismaAdapter } from "better-auth/adapters/prisma";
import prisma from "@/lib/prisma";

export const auth = betterAuth({
    database: prismaAdapter(prisma, {
        provider: "postgresql", 
    }),
    emailAndPassword: {
        enabled: true,
        autoSignIn: false,
    },
});

Neon Database & Prisma

By utilizing @neondatabase/serverless alongside Prisma's driver adapters, the application achieves extremely fast database connections in a serverless environment, drastically reducing cold start latency.