Platform Architecture
An overview of our scalable, privacy-by-design data model, from individual SaaS to a full Enterprise solution.
// Database Markup Language (DBML) for Pass-Exams Platform
// This diagram illustrates our user-centric, sandboxed data model.
// The 'users' table is the root for all user-specific data.
// The 'id' is the Firebase Auth UID, acting as the primary key.
Table users {
id varchar [primary key, note: 'Firebase Auth UID']
email varchar [unique, not null]
displayName varchar
photoURL varchar
createdAt timestamp
subscriptionStatus varchar
isCustomer boolean
}
// A sub-collection under 'users'.
// Stores custom quizzes created by a user.
Table exams {
id varchar [primary key, note: 'Auto-generated ID']
user_id varchar [not null, ref: > users.id]
title varchar [not null]
description text
public boolean [default: false]
createdAt timestamp
}
// A sub-collection under 'users'.
// Stores questions a user has bookmarked for review.
Table bookmarkedQuestions {
question_id varchar [primary key, note: 'The ID of the bookmarked question']
user_id varchar [not null, ref: > users.id]
quiz_id varchar [not null]
createdAt timestamp
}
The core principle here is **data isolation**. Each user's data—their custom exams and bookmarks—exists in a secure "sandbox" under their unique user ID. This is enforced by `firestore.rules`, making it impossible for one user to access another's data.
Phase 1: Current State (NoSQL Document DB)
Our current model uses Firestore, a NoSQL database perfect for storing structured data like user profiles, exam metadata, and bookmarks. It answers questions like: "Who is this user?" or "What did they bookmark?".
Phase 2: The Tipping Point (Semantic Search)
The architecture must evolve when we need to understand the *meaning* of unstructured data, like a student's written answer. This is the trigger for **Cognitive Variable #4: Semantic KPC Variance**. We need to measure how "semantically similar" a student's answer is to an ideal answer.
Phase 3: The Vector Database Solution
To solve this, we convert text into mathematical vectors (embeddings). A **Vector Database** is purpose-built to store these vectors and perform ultra-fast similarity searches. It allows us to ask: "How close in meaning is this student's answer to our expert-defined key points?" This measurement becomes a core part of their unique Cognitive ID.
| Cognitive Variable | Neural/Pedagogical Metric | Measurement Mechanism |
|---|---|---|
| Decision Latency Delta | Processing Speed | The millisecond difference in response time between "Bookmarked" (hard) vs. "Non-Bookmarked" (easy) questions. |
| Heuristic Pathing (MCQ) | Elimination Logic | Tracking mouse/touch movement patterns across the 4 MCQ options before selection. |
| Rationale Dwell-Time | Receptivity Index | Time spent reading the "Teaching Rationale" vs. the complexity (word count) of the text. |
| Semantic KPC Variance | Linguistic Fingerprint | In text answers, measuring the linguistic distance between the user's vocabulary and the KPC (Key Point Checklist). |
| The Self-Correction Pulse | Metacognitive Monitoring | Frequency and timing of "backspacing" or editing text-based answers before submission. |
| Topic Gravity (Bookmark Ratio) | Intellectual Topography | The specific distribution of bookmarks across 100+ topic tags. |
| Stamina Decay Slope | Neuro-Endurance | The rate at which accuracy and latency change over a 2-hour session. |
Application: The "Sovereign Learner" Identity
By measuring these metrics, our platform can verify a user not by what they know, but by *how* they know it. The unique combination of these cognitive variables forms a "Cognitive ID"—a high-entropy seed that is statistically unique to an individual's learning process. This data asset, owned by our institutional partners, has massive implications for high-stakes certification, identity verification, and next-generation data security.