Back to Portfolio
Digital Study Center • Full-Stack Enterprise Platform
// FULL-STACK ENTERPRISE PLATFORM Completed 2024

Digital Study Center

Full-Stack Coaching & Academic Operations Platform

Streamlining academic administration, attendance auditing, and resource distribution for modern educational coaching institutions.

ROLE & SCOPE Full-Stack System Architect & Developer
PRIMARY ARCHITECTURE Application Server
DATABASE & CACHE PostgreSQL • Redis
100%
Paperless Transition

Completely replaced manual register books for daily and monthly attendance workflows.

AAL2
MFA Security Level

TOTP two-factor authentication enforcement on all faculty and administrative accounts.

< 80ms
Average Query Time

Optimized PostgreSQL composite indexes for fast student history and fee ledger queries.

3 Portals
Role-Based Workspaces

Strict privilege isolation between Administrator, Teacher, and Student access levels.

The Problem & System Scope

Digital Study Center is an end-to-end management platform engineered for a real coaching institution. The platform replaced error-prone paper attendance ledgers and disconnected WhatsApp broadcast groups with a secure, centralized web portal. It provides role-based workspaces for administrators, educators, and students with robust two-factor security and fast student analytics.

End-to-End Architectural Design

Built upon a modular Node.js and Express backend communicating with a Supabase PostgreSQL relational database. The presentation layer features high-performance semantic HTML, CSS, and modular JavaScript delivering zero-dependency client speed. Multi-factor authentication is enforced at the API gateway layer with JWT token signing and session claim validation.

01

Client Web Interface

HTML5CSS3Modern Vanilla JSResponsive Layout

Fast, lightweight portal accessible on any mobile device, low-end tablets, and desktop computers.

02

Application Server

Node.jsExpress.jsBcryptSpeakeasy (TOTP)JWT

Authentication gateway, business validation, attendance ledger computation, student report generation.

03

Database & Storage

PostgreSQLSupabaseCloud Storage

Relational data store with foreign keys, cascading integrity, student documents, and homework PDFs.

04

In-Memory Accelerator

Redis LayerKey-Value Cache

Session tracking, rate-limiting failed login attempts, and caching static subject/batch rosters.

Execution Pipeline & Data Flow
  1. STEP 1 User accesses portal; client submits credentials over HTTPS to Express authentication controller.
  2. STEP 2 Backend verifies password hash using bcrypt; checks if account has TOTP MFA enabled.
  3. STEP 3 If MFA is required, a temporary short-lived intermediate token is issued requiring TOTP verification code input.
  4. STEP 4 Upon verification, a signed JWT with role claim (ADMIN, TEACHER, STUDENT) is issued to client.
  5. STEP 5 Role-Based Access Control (RBAC) middleware checks route permissions against JWT claims before controller execution.
  6. STEP 6 Database queries leverage composite indexes on student ID, batch ID, and date ranges for instantaneous ledger rendering.

Technology Choices & Justifications

Backend Architecture Node.js & Express.js

Robust ecosystem for REST API creation, customized middleware chaining, and high-performance JSON request handling.

Database Engine PostgreSQL & Supabase

ACID transactions are essential for academic attendance and fee ledgers where missing or corrupted entries are unacceptable.

Security Architecture TOTP Multi-Factor Authentication

RFC 6238 time-based OTP protection stops credential stuffing attacks on faculty accounts that hold sensitive student records.

Cache & Rate Limiting Redis

Caches class rosters and enforces brute-force lockout thresholds on login endpoints.

Identity Management Bcrypt & JSON Web Tokens

Industry-standard password hashing with high salt rounds and stateless tamper-proof session tokens.

Deep Technical Breakthroughs

CHALLENGE 01

High-Volume Attendance Batch Recording & Concurrency

THE PROBLEM

Teachers taking attendance for classes of 50-100 students at the same time caused database lock contention and duplicate record insertion errors.

ENGINEERING TRADEOFFS

Inserting records one-by-one was slow (50+ round trips); dropping unique constraints risked double-marked records.

IMPLEMENTED SOLUTION

Implemented PostgreSQL atomic batch upserts using `INSERT INTO attendance ... ON CONFLICT (student_id, date, batch_id) DO UPDATE SET status = EXCLUDED.status`. This reduced 50 round trips into a single 12ms atomic transaction and guaranteed data idempotency.

CHALLENGE 02

Step-Up MFA with Backend AAL2 Verification

THE PROBLEM

Admins needed heightened protection when modifying student fee records or releasing exam marks, without burdening casual student views.

ENGINEERING TRADEOFFS

Forcing MFA on every login annoyed students on poor network connections.

IMPLEMENTED SOLUTION

Created an Authenticator Assurance Level (AAL) stepped architecture: basic login grants AAL1 (sufficient for viewing assignments and announcements). Performing administrative actions or faculty grade edits requires AAL2 authentication backed by TOTP verification.

CHALLENGE 03

Multi-Batch Schedule Conflicts & Attendance History Aggregation

THE PROBLEM

Calculating monthly percentage summaries over thousands of historical attendance records caused slow page loads on teacher analytics dashboards.

ENGINEERING TRADEOFFS

Pre-computing daily summaries required heavy background cron jobs.

IMPLEMENTED SOLUTION

Created composite B-tree indexes on `(batch_id, date, student_id)` and created an optimized SQL view utilizing window functions (`COUNT(*) OVER ...`) that retrieves attendance summaries in under 35ms.

Production Engineering Logic

Atomic Attendance Batch Upsert Controller JAVASCRIPT
Demonstrates single-transaction idempotent batch attendance submission in PostgreSQL.
// Express Controller for Batch Attendance
const pool = require('../config/database');

exports.recordBatchAttendance = async (req, res) => {
    const { batchId, date, records } = req.body;
    // records: [{ studentId: '123', status: 'PRESENT' }, ...]

    if (!batchId || !date || !Array.isArray(records)) {
        return res.status(400).json({ error: 'Invalid payload structure' });
    }

    const client = await pool.connect();
    try {
        await client.query('BEGIN');

        // Construct bulk parameterized query
        const values = [];
        const placeholders = records.map((record, index) => {
            const offset = index * 4;
            values.push(record.studentId, batchId, date, record.status);
            return `($${offset + 1}, $${offset + 2}, $${offset + 3}, $${offset + 4})`;
        }).join(', ');

        const queryText = `
            INSERT INTO attendance (student_id, batch_id, attendance_date, status)
            VALUES ${placeholders}
            ON CONFLICT (student_id, batch_id, attendance_date)
            DO UPDATE SET 
                status = EXCLUDED.status,
                updated_at = NOW()
            RETURNING id;
        `;

        const result = await client.query(queryText, values);
        await client.query('COMMIT');

        return res.status(200).json({
            success: true,
            recordsProcessed: result.rowCount,
            date,
        });
    } catch (error) {
        await client.query('ROLLBACK');
        console.error('Batch attendance failure:', error);
        return res.status(500).json({ error: 'Failed to record attendance batch' });
    } finally {
        client.release();
    }
};

Persistence & Schema Design

Normalized relational schema with foreign key constraints, composite unique indexes, and audit timestamps.

❖

Users

Core identity table containing credentials, MFA secrets, and role assignments.

KEY FIELDS
  • id: UUID (PK)
  • email: VARCHAR
  • password_hash: VARCHAR
  • role: ENUM
  • totp_secret: VARCHAR
  • is_mfa_enabled: BOOLEAN
❖

Attendance

Daily attendance record per student per batch with unique composite constraint.

KEY FIELDS
  • id: UUID (PK)
  • student_id: UUID (FK)
  • batch_id: UUID (FK)
  • attendance_date: DATE
  • status: ENUM(PRESENT, ABSENT, LATE)
❖

StudyMaterial

Academic resources, lecture notes, and downloadable assignments.

KEY FIELDS
  • id: UUID (PK)
  • batch_id: UUID (FK)
  • title: VARCHAR
  • file_url: TEXT
  • uploaded_by: UUID (FK)

Key Learnings & Future Enhancements

✓ Key Engineering Learnings

  • Understanding real user workflows: educators prioritize speed and keyboard ergonomics over flashy animations when taking attendance.
  • Mastered transactional database concurrency: bulk SQL upserts prevent race conditions and drop round-trip network delays by orders of magnitude.
  • Learned how to construct enterprise-grade role-based access control and multi-factor authentication from scratch.

⚡ Future Roadmap (v2)

  • Automated WhatsApp/SMS alerts to parents when a student is marked absent.
  • Integrated online fee payment gateway with instant PDF invoice generation.
  • Interactive quiz and computerized test evaluation module for entrance exam preparation.
// HIRE OR COLLABORATE

Interested in Discussing This Architecture?

I am actively looking for engineering opportunities, backend roles, and impactful software projects. Let's talk system design and code.