How harowwld/pupsj-rms-prototype works
PUP E-Manage is a local, office-scoped records-management system. Staff upload and manage student documents; the application stores records and supports scanning/OCR, review, and physical archive organization. Students and administrators have separate request, compliance, configuration, and oversight workflows. The README documents backups, PSA coordinate recognition, and local OCR integrations. Several feature routes were not sampled, so those capabilities are represented without asserting unverified internal calls.
Main entry points: postgresCompat.js Postgres adapter · storage-layout/route.js Archive layout API · documents/route.js Document API · studentsRepo.js Student records
Components 22
Records workflows
- Document API
next-app/src/app/api/documents/route.js - Document records
next-app/src/lib/documentsRepo.js - Document requests
next-app/src/app/api/document-requests/route.js - Scan and ingest
next-app/src/app/api/ingest - OCR engines
next-app/src/lib/ocrClient.js - PSA recognition
next-app/src/app/api/recognition - Student records
next-app/src/lib/studentsRepo.js - Archive layout API
next-app/src/app/api/storage-layout/route.js - Archive layout
next-app/src/lib/storageLayoutRepo.js - Layout editor
next-app/src/components/admin/StorageLayoutEditorTab.js
Identity and access
- Session authentication
next-app/src/lib/authHelpers.js - Staff accounts
next-app/src/lib/staffRepo.js - Role policy
next-app/src/lib/roleUtils.js
Administration
- Audit and analytics
next-app/src/app/api/audit-logs - Backup and recovery
next-app/src/app/api/system/backup - System configuration
next-app/src/app/api/system
Data and integrations
- Postgres adapter
next-app/src/lib/postgresCompat.js - PostgreSQL
next-app/src/lib/postgres.js - Legacy SQLite
next-app/src/lib/sqlite.js
Other components
- Records staff
- Students
- Administrators
Connections 23
- Records staff → Document API: uploads documents
- Document API → Document records: creates and lists
next-app/src/app/api/documents/route.js - Document API → Student records: resolves students
next-app/src/app/api/documents/route.js - Students → Document requests: submits requests
- Records staff → Scan and ingest: scans records
- Scan and ingest → OCR engines: extracts text
- Administrators → PSA recognition: calibrates templates
- Records staff → Archive layout API: manages archive
- Layout editor → Archive layout API: saves layout
next-app/src/components/admin/StorageLayoutEditorTab.js - Archive layout API → Archive layout: reads and saves
next-app/src/app/api/storage-layout/route.js - Archive layout API → Student records: checks and reassigns
next-app/src/app/api/storage-layout/route.js - Records staff → Session authentication: authenticates
- Session authentication → Staff accounts: resolves staff
next-app/src/lib/authHelpers.js - Administrators → Audit and analytics: reviews activity
- Administrators → Backup and recovery: backs up data
- Administrators → System configuration: configures system
- Document records → Postgres adapter: queries database
next-app/src/lib/documentsRepo.js - Student records → Postgres adapter: queries database
next-app/src/lib/studentsRepo.js - Staff accounts → Postgres adapter: queries database
next-app/src/lib/staffRepo.js - Archive layout → Postgres adapter: reads and writes
next-app/src/lib/storageLayoutRepo.js - Postgres adapter → PostgreSQL: executes queries
next-app/src/lib/postgresCompat.js - Administrators → Role policy: uses role policy
- Legacy SQLite → PostgreSQL: legacy migration