/opt/jfmsrv01/scripts/TRANSCRIPTION_HANDOVER.md
# Legal Transcription and Document Automation Platform
# Handover and Project Reference Document
# ============================================
# Status: ON HOLD - Ready to build
# Server: jfmsrv01 (192.168.100.197)
# Updated: 2026-05-28
# ============================================
═══════════════════════════════════════════════════════════════
SECTION 1 — PROJECT STATUS AND CONTEXT
═══════════════════════════════════════════════════════════════
STATUS: ON HOLD — ALL PLANNING COMPLETE, BUILD NOT YET STARTED
The server infrastructure is fully ready. All planning documents,
architecture decisions, build scripts, and design documents are
complete. The project is paused intentionally and can be resumed
at any time by running the build scripts in order.
WHAT IS DONE
────────────
- Full master project plan written and reviewed (see Section 3)
- Server and storage design plan written and reviewed (see Section 4)
- All five mandatory foundations designed:
1. Feature flags
2. Tenant settings
3. Storage abstraction (with path traversal protection)
4. AI abstraction (with privacy tier enforcement)
5. Event-based modules
- Build scripts ready in /jfmsrv01-build/ on the server
- Server infrastructure fully provisioned:
PostgreSQL, Redis, PHP 8.3, Python 3.12, ffmpeg,
LibreOffice, ClamAV, Nginx, Supervisor, Node.js
- Stack decision made: Laravel/PHP + Python workers + PostgreSQL + Redis
WHAT IS NOT YET DONE
─────────────────────
- Storage layout (script ready, not run)
- Application skeleton (script ready, not run)
- Admin safety tools (script ready, not run)
- First firm creation (script ready, not run)
- Any application code
- Nginx vhost for transcription platform
- Any database tables for the transcription platform
═══════════════════════════════════════════════════════════════
SECTION 2 — HOW TO RESUME THIS PROJECT
═══════════════════════════════════════════════════════════════
All build scripts are in /jfmsrv01-build/ on the server.
Run them in order. Each is idempotent (safe to re-run).
STEP 1 — Storage layout
────────────────────────
sudo bash /jfmsrv01-build/01_storage_layout.sh
Creates:
/data/jfmsrv01/firms/{firm_id}/recordings
/data/jfmsrv01/firms/{firm_id}/transcripts
/data/jfmsrv01/firms/{firm_id}/documents
/data/jfmsrv01/firms/{firm_id}/templates
/data/jfmsrv01/firms/{firm_id}/attachments
/data/jfmsrv01/firms/{firm_id}/exports
/data/jfmsrv01/firms/{firm_id}/temp
/data/jfmsrv01/firms/{firm_id}/reports
/data/jfmsrv01/firms/{firm_id}/backups
/data/jfmsrv01/quarantine/
/data/jfmsrv01/processing/
/data/jfmsrv01/imports/
/data/jfmsrv01/shared/
/backups/jfmsrv01/
Also creates:
ClamAV scan helper script
Temp/processing cleanup cron job (every 30 minutes)
Firm storage creation helper script
STEP 2 — Application skeleton
───────────────────────────────
sudo bash /jfmsrv01-build/02_app_skeleton.sh
Creates:
Laravel application at /opt/jfmsrv01/app
All five mandatory foundations
Database migrations (firms, users, feature_flags, matters,
notifications, audit_logs)
21 event classes
20 feature definitions seeded
4 Supervisor queue workers
.env configuration file
STEP 3 — Admin safety tools
────────────────────────────
sudo bash /jfmsrv01-build/03_admin_safety_tools.sh
Creates:
CHANGELOG.md
HANDOVER.md
backup.sh (source/database/files/tenant/full)
smoke_test.sh
patch.sh (patch workflow)
diagnostics.sh (JSON for admin panel)
route_list.sh
log_tail.sh
STEP 4 — Create first firm
───────────────────────────
sudo bash /jfmsrv01-build/04_first_firm.sh
Creates:
First firm record in database
Platform admin user
Firm admin user
Firm storage directories
Level 1 features enabled
STEP 5 — Configure Nginx
──────────────────────────
After the app is running, add an Nginx vhost:
/etc/nginx/sites-available/transcription
Choose a port (e.g. 8090) or set up a domain.
Run: nginx -t && systemctl reload nginx
THEN — Continue with Phase 1 build list (see Section 6)
═══════════════════════════════════════════════════════════════
SECTION 3 — MASTER PROJECT PLAN SUMMARY
═══════════════════════════════════════════════════════════════
Full document: legal_transcription_platform_master_plan.txt
Available on handoff portal under: transcription/master-plan.html
CORE PURPOSE
─────────────
Law firms provide audio recordings, dictation, uploaded letters,
emails, existing documents, or live speech. The system transcribes
the content, identifies the document type, selects the correct
Word template, inserts the content, and saves a professional legal
document into the correct client/matter/lawyer folder.
The system assists legal professionals. It must never claim
AI-generated work is final legal advice. Final review belongs
to the lawyer.
DEPLOYMENT MODELS (all use the same codebase)
───────────────────────────────────────────────
Model 1: Hosted multi-tenant — multiple firms, one server
Model 2: Hosted single-tenant dedicated — one firm, one server
Model 3: Onsite single-tenant — installed at law firm premises
Model 4: Hosted + local connector agent (preferred for SMB access)
SYSTEM HIERARCHY
─────────────────
Platform / Host Admin
-> Firm / Tenant
-> Users (Lawyers, Secretaries, Reviewers, Firm Admins, Read-only)
THE FIVE MANDATORY FOUNDATIONS (must exist from day one)
──────────────────────────────────────────────────────────
1. Feature flags
- Enable/disable globally, per plan, per firm, per role, per user
- Disabled features disappear from menus, blocked at routes,
background jobs do not run
2. Tenant settings
- Every firm has its own branding, users, permissions, templates,
folders, AI settings, email, jurisdiction, backup, retention
3. Storage abstraction
- All file access through StorageService
- Supports: local disk, SMB, SFTP, FTP, cloud/object storage
- Path traversal protection built in
- Per-firm isolated storage paths
4. AI abstraction with privacy tiers
- All AI calls through AiService
- Privacy tiers: 1=on-premise, 2=private API, 3=[REDACTED]