> ## Documentation Index
> Fetch the complete documentation index at: https://ihub.learnille.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Non-Functional Requirements (NFRs)

> Migrated from the previous Learnille internal documentation hub

## Overview

This specification details the non-functional requirements (NFRs) for performance, security, availability, data integrity, and compliance across the Learnille platform.

***

## ⚡ 1. Performance Requirements

* **API Response Time**: 95% of standard CRUD API responses must be delivered in `< 200ms`. Complex analytics or search queries must complete in `< 500ms`.
* **Database Query Latency**: PostgreSQL indexing must keep single-entity lookups under `< 10ms`.
* **Video Delivery**: Video content stored on MinIO/S3 must support progressive loading and HLS chunk streaming without buffering on 3G+ networks.
* **Concurrent Users**: The backend system must support at least **10,000 concurrent active socket connections** via Soketi / InstantDB without connection drops.

***

## 🔒 2. Security & Data Protection

* **Authentication**: JWT access tokens signed via RS256 / HS256 with short expiry (15m) and secure HTTP-only refresh tokens.
* **Authorization**: All endpoints protected via NestJS `JwtAuthGuard` and role-based guards (CASL / RBAC).
* **Data Encryption**: All data in transit must be encrypted via TLS 1.3. Sensitive fields (OTP, bank account numbers, tokens) encrypted at rest using AES-256.
* **OWASP Compliance**: Prevention of SQL injection, XSS, CSRF, rate-limiting on sensitive endpoints (`/auth/login`, `/auth/forgot-password`, `/withdrawals/request`).

***

## 🛡 3. High Availability & Resilience

* **Uptime Target**: 99.9% uptime for core API endpoints and database layer.
* **Failover**: Database replication with primary-replica setup. Redis sentinel for queue and cache failover.
* **Queue Fault Tolerance**: Asynchronous jobs (emails, outbox processing, video transcode) handled via BullMQ with automatic retries and dead-letter queues (DLQ).
* **Database Migrations**: Zero-downtime database migrations using backward-compatible schema changes.

***

## ♿ 4. Accessibility & Cross-Browser Support

* **WCAG Compliance**: Frontend applications must comply with **WCAG 2.1 AA** standards (color contrast ratio >= 4.5:1, full keyboard navigation, screen-reader friendly ARIA tags).
* **Browser Matrix**: Full support for Chrome (latest 2 versions), Firefox (latest 2 versions), Safari (latest 2 versions), Edge (latest 2 versions), and mobile browsers (iOS Safari, Android Chrome).
* **Responsive Layout**: Fluid layouts adapting seamlessly from mobile (`320px`) to desktop screens (`2560px`).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.