0%
balqalam Logo
balqalam
FeaturesCommunityPricingDocumentation
Login
  • Introduction
  • Pitch
  • Hogwarts
  • Live Demo
  • MVP
  • Roadmap
  • Launch Sprint
  • PRD
  • Get Started
  • Localhost
  • Architecture
  • Structure
  • Pattern
  • Page
  • Layout
  • Content
  • Types
  • Config
  • Actions
  • Queries
  • Authorization
  • Validation
  • Form
  • Table
  • Detail
  • Card
  • Util
  • Hooks
  • List Params
  • Views
  • README.md
  • ISSUE.md
  • Technology Stack
  • Database
  • File
  • CDN Assets
  • Entry Points
  • Dashboard
  • Authentication
  • Credentials
  • OAuth
  • Flow Diagrams
  • Multi-Tenancy
  • Offline
  • Onboarding
  • Onboarding Videos
  • Add Values
  • Admission
  • Application
  • Attendance
  • Compliance
  • Profile
  • Exams
  • Exam Wizard
  • Timetable
  • Classrooms
  • Notifications
  • Conference
  • LMS (Lumos)
Finance
  • Finance
  • Fee Management
  • Invoice
  • Wallet
  • Salary
  • Payroll
  • Timesheet
  • Expenses
  • Budget
  • Receipt
  • Accounts
  • Banking
  • Reports
  • Dashboard
  • Permissions
  • Messages
  • Integration Flow
  • Provision
  • AI Document Processing
  • Document Intelligence
  • Internationalization
  • Translation
  • Translation Guide
  • Icons
  • Docs Factory
  • Inspiration
  • Listings
  • Teachers
  • Students
  • Catalog
  • Library
  • Contributing
  • Code of conduct
  • GitHub Workflow
  • Database Seeds
  • Database Safety
  • Test Accounts
  • Playwright
  • Prettier
  • Block Rebound
Sales & GTM
  • Marketing Brief
  • Sales
  • Go-to-market
  • Marketing
  • Admission — Feature Spotlight
  • Pilot Program
  • Leads
  • Proposal
  • Outreach Templates
  • Case Study
  • Competitors
  • Landing-page teardown
  • Competitor FAQ
  • Business model
  • Shared economy
  • Traction
Fundraising & Ecosystem
  • Get Support
  • Investor Deck
  • Data Room
  • Investors
  • Accelerators
  • Incubators
  • Grants
  • Sponsors
  • Partners
  • Competitions & Hackathons
  • Universities & Training Centers

Database Seeds

PreviousNext

K-12 school simulation for demo.databayt.org — 17 phases, single-language storage, idempotent upserts.

The seed system creates a realistic K-12 school for demo.databayt.org. Content is stored in one language (Arabic primary) with a lang field; translation happens on demand via Google Translate + DB cache. All seeds are idempotent upserts — safe to re-run.

Quick start

# Seed a single module (always use this)
pnpm db:seed:single <name>
 
# List available seeds
pnpm db:seed:single --list

Always use pnpm db:seed:single <name>. Full seed is forbidden — auto-blocked by a pre-tool hook. The full sequential run takes 45–120 minutes and is reserved for manual full resets only. See CLAUDE.md rule #8 and safe seeds.

Counts

EntityCountNotes
Users3,105All roles, @databayt.org emails
Teachers100Arabic names, qualifications, expertise
Students970K-12 distribution
Guardians2,0002 per student (father + mother)
Staff26Non-teaching
Departments6Arabic primary + lang
Subjects19Arabic primary + lang
Year Levels14KG1–12
Classrooms28Labs, rooms, special facilities
Classes187Subject × level
Student Enrollments12,950All classes
Assignments188All classes
Submissions13,371With grade distribution
Lumos Categories8Arabic LMS
Lumos Courses59With chapters
Lumos Enrollments200
Books90Unique Arabic-titled
Borrow Records99Active, overdue, returned
Exams~200Midterm + Final + Quizzes
Exam Results~1,500With grade distribution
Question Bank~950Arabic educational
Fee Structures82-year history
Fee Assignments~1,940Per student per year
Payments~500With receipt numbers
Invoices10With items + addresses
Expense Receipts10OCR data (SDG)
Salary Structures100Allowances + deductions
Timesheet Entries~6,0003 months daily
Payroll Runs3Oct–Dec 2025, all PAID
Bank Accounts3Operating, Savings, Petty Cash
Transactions100Oct–Dec 2025 (SDG)
Finance~500Chart of accounts + journals
Attendance~60,00060 days
Timetable Entries~1,500Conflict-free
Gamification~350Badges, streaks, competitions
Conversations~50300+ messages
Notifications~500Mixed
Admission~50Campaigns + applications
Catalog Subjects~240US K-12 grade-specific, + Sudan base
Catalog Chapters~750Platform-wide (no schoolId)
Catalog Lessons~3,993US-curriculum sourced
Audit Logs~500
Health Records~110Health, disciplinary, achievements
Student Documents200Birth certs, passports, medical

Accounts

For the named-account table, bulk-account counts, simulation flows, and access matrix, see Test accounts — the canonical reference. For the Sudanese-specific configuration (periods, year levels, departments, classrooms, fee tiers), see Sudan curriculum.

17 phases

PhaseModuleWhat it creates
0Global CatalogseedCatalog() — US K-12: Subjects (~240), Chapters (~750), Lessons (~3,993) + Sudan base, images (S3/CloudFront)
1Core FoundationSchool (demo.databayt.org), branding
2User AccountsAll 3,105 users
3Academic StructureSchool Year (2025–2026), Terms, Periods (8 + 2 breaks), Departments (6), Year Levels (14)
4Subjects & ClassroomsSubjects (19), Classroom Types (8), Classrooms (28)
5PeopleTeachers (100), Students (970), Guardians (~1,940), Staff (26)
6Classes & EnrollmentsClasses (187), Student Enrollments (12,950), Teacher Assignments (187)
7LMS / LumosCategories (8), Courses (59), Enrollments (200), Lessons, Library (90 books, 99 borrows)
8AssignmentsAssignments (188), Submissions (13,371)
9Announcements & EventsTemporal spread, MENA calendar Sep 2025 – Jun 2026
10Exams, QBank & GradesExams (~200), exam results, QBank (~950 Arabic), grading config, gradebook Result rows derived from graded submissions, report cards + per-subject grades via the production aggregation
11FinanceChart of accounts (2-year), Fee Structures (8), Assignments (~1,940), Payments (~500), Invoices (10), Expense Receipts (10), Payroll
12Banking3 accounts, 100 transactions (Oct–Dec 2025)
13OperationsAttendance (~60,000), Excuses + Interventions, Timetable (~1,500), Gamification (~350)
14CommunicationsConversations (~50, 300 messages), Notifications (~500)
15AdmissionCampaigns + Applications (~50)
16Compliance & WellnessAudit Logs (~500), Health/Disciplinary/Achievements (~110)

Idempotent upserts

await prisma.subject.upsert({
  where: {
    schoolId_departmentId_subjectName: {
      schoolId,
      departmentId,
      subjectName: "الرياضيات",
    },
  },
  update: { lang: "ar" },
  create: { schoolId, departmentId, subjectName: "الرياضيات", lang: "ar" },
})

Re-runnable. Never duplicates. Safe in CI. For the single-language storage strategy and getText() helper, see Translation.

Troubleshooting

pnpm db:seed:single <name>      # single module
pnpm db:seed:single --list      # available seeds
pnpm db:reset-test-user         # reset user@balqalam.com
pnpm db:reset-test-applicant    # reset applicant@balqalam.com
pnpm prisma migrate reset       # destructive: drop all data (manual only)
IssueFix
Deadlock detectedReduce batch size in people.ts
Table does not existpnpm prisma db push
Unknown fieldCheck schema, run prisma generate
Foreign key constraintSeeds run in dependency order
Prisma client not foundpnpm prisma generate
Can't reach databaseNeon auto-suspend; retry once

npx prisma studio opens the data browser.

Production

Seeds are for development and demo only. Never run on production without review. Use migrations for schema changes. ensure-demo.ts provides Vercel deployment safety checks.

See also

  • Test accounts
  • Safe seeds
  • Multi-Tenancy
  • Catalog
  • Translation
GitHub WorkflowDatabase Safety

On This Page

Quick startCountsAccounts17 phasesIdempotent upsertsTroubleshootingProductionSee also

Built by Databayt ·

Welcome to balqalam.

A great journey is about to begin.