Archis Platform Features
A secure, role-aware caseload management system and timekeeping framework designed for modern, global law practices.
Core Architecture & Multi-Tenancy
Archis isolates firm data at the database layer using a unified SaaS instance. PostgreSQL RLS policies protect access, secure multi-tenant integrity, and actively block expired or suspended firms from reading any data.
Tenant Isolation
Data isolation via a primary firm_id column in all practice tables.
Active Firm RLS Gate
get_active_firm_id() returns NULL for expired or suspended firms, causing all 41 RLS policies to deny access.
Edge Middleware Lock
Next.js middleware intercepts every request, deletes cookies, and redirects inactive firm users before they reach any page.
-- Uses get_active_firm_id() so expired/suspended
-- firms receive NULL and all queries are denied
CREATE POLICY firm_isolation_policy
ON public.cases
FOR ALL
USING (
firm_id = get_active_firm_id()
);
-- Helper returns NULL when firm.status
-- is 'expired' or 'suspended'
CREATE OR REPLACE FUNCTION get_active_firm_id()
RETURNS uuid LANGUAGE sql SECURITY DEFINER AS $$
SELECT firm_id FROM public.users
WHERE id = auth.uid()
AND EXISTS (
SELECT 1 FROM public.firms
WHERE firm_id = firms.id
AND status IN ('trial', 'active')
);
$$;Dynamic Persona Simulator
Permissions are programmatically gated on both client routing and database access. Toggle between roles below to see how Archis reshapes the UI and security matrix for each persona.
Lawyer (Admin)
Firm Owner & Senior Associate
Scope of Permission
- ✔Full administrative controls across the tenant workspace.
- ✔Manage firm-wide team rosters, assign roles, and invite members.
- ✔Create, edit, and archive case files, client records, and billing invoices.
- ✔Assign tasks, delete documents firm-wide, and oversee time entries.
- ✔Self-deletion and self-demotion are programmatically blocked for security.
Sidebar Section Access
Firm-Wide Health Telemetry
Operational Dashboard Modules
Archis combines case pipelines, activity logs, task states, billing workflows, and secure bucket streaming into one centralized interface — with complete subscription lifecycle management.
Case Matter Management
Litigation files with customized stages (pending, active, settled, closed). Junction-linked client co-litigation support. All field changes commit to immutable audit history logs.
Task Workflow & Highlights
Inline task state machines (pending → in_progress → completed). Live discussion threads. Sidebar notification badge for unread tasks. Newly assigned tasks pulse with a 3.5s animate-highlight on first visit.
Private Documents Portal
Drag-and-drop atomic uploads to private Supabase buckets with automatic rollback on database failure. 50 MB per-file limit and storage quota checks before every upload. Only Lawyers can delete. Signed URLs for inline previews and forced downloads.
Time & Billing
Log billable hours for cases and tasks. Generate, edit, and send professional invoices with automatic PDF generation and line items. Track partially and fully paid invoices via financial KPI dashboards.
Billing CSV Import
Bulk-import invoices via CSV (up to 500 rows, 5 MB). Intelligent header mapping with alias resolution, strict DD/MM/YYYY and ISO date parsing, and ambiguous case/lawyer name resolution. Falls back from bulk → chunked → row-by-row insertion to isolate errors.
Team & Security Controls
Invite team members securely via RPC-backed email credentials. Self-deletion and self-demotion are programmatically blocked with descriptive error messages. Role guards short-circuit all write handlers — hiding buttons alone is never the only security layer.
"What's New" Announcements
Platform-wide announcements with priorities 1–4 (Critical). Registration-date gating hides historical notices from new users. Multiple unread notices are grouped into one modal panel to prevent fatigue. Live markdown preview in the Super Admin editor.
Subscription Edge Gating
Next.js edge middleware checks firm status on every request. Expired or suspended firms have session cookies deleted and are immediately redirected. Simultaneously, get_active_firm_id() returns NULL in RLS, blocking all database access at the server level.
Super Admin Controls
Platform owner dashboard aggregating all firms, usage metrics, and subscription statuses. Manage trial extensions, mark firms as active or suspended, and set custom per-firm storage quotas in GB — all backed by dedicated is_super_admin() RLS enforcement.
// Compare ISO date strings directly (UTC+5:45 safe)
const todayString = new Date()
.toLocaleDateString("en-CA", {
timeZone: firmTimeZone // E.g., "America/New_York"
}); // Output: "YYYY-MM-DD"
// Overdue check avoids datetime offsets
const isOverdue = taskDueDate < todayString;
// Court hearing countdown via local midnight diff
const [y, m, d] = dateStr.split("-").map(Number);
const target = new Date(y, m - 1, d); // local midnight
const today = new Date();
today.setHours(0, 0, 0, 0);
const daysLeft = Math.ceil(
(target.getTime() - today.getTime()) / 86400000
);Multi-Timezone & DST Compliance
Non-standard timezone offsets and daylight saving transitions are vulnerable to client-side datetime drift. Archis bypasses browser-specific timezone errors on court hearing deadlines and overdue checks by applying strict ISO string matching and local midnight arithmetic.
- ISOISO String Comparisons: Standardizes deadline checking by comparing date fields as formatted strings directly, avoiding raw JavaScript hour setters inside loops.
- CALMidnight Calculations: Computes time intervals directly relative to the firm's local midnight, locking precise calendar date intervals for court hearing countdowns.
Storage Quotas & Firm Lifecycle Management
Each firm gets an independently tracked storage allocation managed by database triggers. Super Admins can adjust per-firm quotas and manage the full subscription lifecycle without touching a single line of code.
Storage Tracking
Upload sizes feed documents.size_bytes. DB triggers aggregate this into firm_metrics.storage_used_bytes automatically.
Quota Enforcement
Default limit is 1 GB. Custom limits per firm are set in GB increments by the Super Admin. Quota checks block uploads before storage is touched.
Subscription States
Firms cycle through: trial → active → expired / suspended. Each transition is admin-controlled and immediately enforced at the edge and DB layers.
Instant Lock-Out
Status changes take effect immediately. No grace window — middleware, RLS, and client components all check and mirror the active status in real time.
Sharma & Partners
3.2 GB / 5 GB
Karki Law Office
0.4 GB / 1 GB
Thapa Associates
2.1 GB / 2 GB
Rai Legal Group
1.8 GB / 1 GB
Experience the system in action.
Create an owner account for your practice today. Secure multi-tenancy and RLS policies are active and optimized out-of-the-box.