DocGuard (Nigeria)

Inspiration

In Nigeria's ₦15 trillion corporate lending market, time kills deals. A single syndicated loan involves 3+ weeks of LMA template adaptation, manual CAC charge registration delaying disbursement by 14-21 days, and siloed KYC checks across NIMC, NIBSS, and Credit Bureaus.

We witnessed banks lose millions in opportunity cost while lawyers manually perfected charges at the Corporate Affairs Commission. DocGuard was born from a simple question: "What if AI could draft, perfect, and verify a loan in hours, not weeks?"

What it does

DocGuard is a desktop-native command center for Nigerian loan officers that combines:

  • LMA Smart Document Builder: AI-powered editor adapting international LMA templates to Nigerian law with Gemini-powered clause analysis, one-click lender-favorable rewrites, and smart variable detection
  • CAC Registry Bot: Simulated RPA engine demonstrating automated charge perfection with real-time terminal logging and native OS notifications
  • KYC Orchestrator: Modular identity verification pipeline with NIN/BVN verification, AI document scanning, liveness detection, and composite risk scoring

How we built it

Layer Technology
Frontend React 19 + TypeScript + Tailwind CSS
Desktop Shell Electron 39 with secure IPC
AI Engine Google Gemini API (@google/genai)
Charts Recharts for portfolio visualization
Build System Vite + esbuild + electron-builder
Auth Supabase (OAuth 2.0 ready)

We chose desktop-first architecture because banks require local data sovereignty—Electron enables offline drafting and secure filesystem access.

Challenges we ran into

  1. ESM vs CommonJS Hell: Electron's main process conflicted with "type": "module". The bundler wrapped require("electron") incorrectly, causing app.whenReady() to be undefined. Solution: Switched to esbuild with --format=cjs and .cjs file extensions.

  2. Tailwind v4 @apply Opacity: Tailwind v4's new architecture broke @apply directives with opacity modifiers. Solution: Replaced with standard CSS for glassmorphism utilities.

  3. Packaged App Path Resolution: __dirname didn't resolve correctly in packaged apps. Solution: Used app.getAppPath() for correct file paths.

Accomplishments that we're proud of

  • Built a fully functional desktop app that launches and runs from an AppImage or Windows executable (.exe)
  • Integrated Google Gemini AI for intelligent clause analysis and rewriting
  • Created a beautiful glassmorphism UI that looks premium and professional
  • Implemented native Electron features: system notifications, shell integration, PDF export
  • Built a modular KYC pipeline ready for real API integration

What we learned

  1. Electron packaging is fragile: ESM/CJS interop, external modules, and asset paths require meticulous configuration
  2. AI can't replace lawyers (yet): Gemini excels at suggestions, but human review remains critical for legal documents
  3. Nigerian fintech has massive potential: The pain points we addressed are real—banks are hungry for automation
  4. Desktop apps still matter: For sensitive financial workflows, local processing and offline capability are crucial

What's next for DocGuard (Nigeria)

  • Real CAC API integration (requires accreditation)
  • NIBSS BVN/NIN verification sandbox integration
  • Multi-party document collaboration (borrower/lender split view)
  • Mobile companion app for KYC on the go
  • Integration with Nigerian commercial banks' core banking systems

Built With

Share this project:

Updates

posted an update

links updated.

DocGuard Nigeria - Download Links for Judges

Desktop Application Downloads

All binaries are hosted on Google Drive with public access (anyone with the link can download).

[!NOTE] The desktop applications provide the complete DocGuard experience with all features including native file system access, desktop notifications, and offline-capable UI (still requires network connection for AI analysis and database interactions). They are recommended for the full functionality of the platform.

Linux Users

AppImage (Portable - Recommended)

Snap Package

Windows Users

NSIS Installer


Web Application

Live Demo: https://docguard-nigeria.vercel.app

The web application is deployed and fully functional on Vercel.

Built for the LMA Edge Hackathon 2025

Log in or sign up for Devpost to join the conversation.

posted an update

DocGuard Nigeria - Download Links for Judges

Desktop Application Downloads

All binaries are hosted on Google Drive with public access (anyone with the link can download).

[!NOTE] The desktop applications provide the complete DocGuard experience with all features including native file system access, desktop notifications, and offline-capable UI (still requires network connection for AI analysis and database interactions). They are recommended for the full functionality of the platform.

Linux Users

AppImage (Portable - Recommended)

Snap Package

Windows Users

NSIS Installer


Web Application

Live Demo: https://docguard-nigeria.vercel.app

The web application is deployed and fully functional on Vercel.


What's Included

All desktop applications include:

  • Full functionality (Requires network connection)
  • Encrypted API credentials (AES-256-GCM)
  • Supabase backend integration
  • Google Gemini 3 Flash AI analysis
  • Native file system access for PDF generation
  • Desktop notifications for deadlines

Security Note

All executables are signed and include production-grade security:

  • Encrypted secrets
  • Row-level security on database
  • Context isolation (Electron security model)

Built for the LMA Edge Hackathon 2025

Log in or sign up for Devpost to join the conversation.

posted an update

DocGuard Nigeria: Comprehensive User & Technical Manual

Version: 1.0.0 (Hackathon Release)
Date: January 2026
Target Audience: End Users (Loan Officers) & Developers


1. Introduction

DocGuard Nigeria is an intelligent "Operating System" for secured corporate lending in Nigeria. It moves beyond simple document generation to handle the entire lifecycle of a loan—from the initial term sheet to the final perfection of the security charge at the Corporate Affairs Commission (CAC).

Core Problem Solved

Nigerian banks lose security on loans (approx. 40% error rate) because charge registration is manual, disconnected from the loan documentation process, and prone to the strict 90-day deadline (CAMA 2020) being missed. DocGuard automates this compliance.


2. Installation & Setup

Prerequisites

  • Node.js (v18 or higher)
  • Bun (Recommended package manager)
  • Git

Step-by-Step Setup

  1. Clone the Repository:

    git clone https://github.com/doc-guard/docguard-nigeria.git
    cd docguard-nigeria
    
  2. Install Dependencies:

    bun install
    # OR
    npm install
    
  3. Environment Configuration: The application uses a secure secret management system. You generally do not need a .env file for local development unless you are overriding defaults.

    • Google Gemini API: Required for AI features. Set in Settings > API Keys inside the app.
    • Supabase Credentials: Built-in for the hackathon demo version.
  4. Running the App:

    • Desktop Mode (Electron): bun run electron:dev (Recommended)
    • Web Mode: bun run dev (Limited functionality - no file system access)

3. User Manual: Feature Walkthrough

3.1 Dashboard & Command Center

Upon login, you land on the Dashboard.

  • Portfolio Health: Top metrics show active loan volume and perfection success rate.
  • Pipeline: A pipeline view showing deals in Review, Documentation, and Disbursement.
  • Deadline Guardian (Top Right): A traffic-light widget showing the most urgent CAMA filing deadline.
    • Red: <15 Days remaining (CRITICAL)
    • Amber: 15-30 Days
    • Green: >30 Days

3.2 Smart Loan Origination

Location: Sidebar > Loan Origination

How it Works:

  1. Click New Loan.
  2. Smart Context: Enter the Borrower Name (e.g., "Dangote Cement").
  3. Identity Capture: Enter RC Number (RC123456), TIN (1234...), and BVN.
  4. Auto-Link Magic: The system checks if this RC Number exists in your KYC database. If yes, it automatically links the verified status to this new transaction, saving you from re-doing due diligence.

3.3 KYC Orchestrator

Location: Sidebar > KYC

The "Unified Check": Instead of logging into 3 different portals, DocGuard runs parallel checks:

  1. CAC Check: Validates the company exists and is "ACTIVE".
  2. FIRS Check: Validates Tax Clearance status.
  3. NIBSS Check: Validates Directors' BVNs.

Note: In this version, these services are **Simulated* to demonstrate the workflow without live government API keys. Use RC... for valid company results.*

3.4 LMA Document Builder

Location: Sidebar > LMA Doc Builder

This is the heart of the legal automation.

  1. Select Template: Choose from Secured Term Facility, Revolving Credit, etc.
  2. Variable Injection: The system auto-fills the "Borrower" variable with the full legal description: "Dangote Cement (with Registration No. RC123456)".
  3. Redline AI Analyzer:
    • Highlight a clause.
    • Click "Analyze Risk".
    • The AI (Gemini 3 Flash) scans it against CAMA 2020 and Evidence Act 2023 to find enforceability risks.
  4. Magic Rewrite: Click to have the AI rewrite the clause to be more lender-friendly.

3.5 CAC Registry Bot (RPA)

Location: Sidebar > CAC Registry

The "Killer Feature"

  1. Select a Loan to perfect.
  2. Click "Open GuardBot Terminal".
  3. Click "Run Simulation".
  4. Watch the Magic:
    • The bot logs into the (simulated) CAC portal.
    • It fills Form 8 automatically using data from the Loan.
    • It captures a Screenshot of the success page.
    • It uploads this screenshot to Supabase Cloud Storage as permanent evidence.

4. Technical Architecture

4.1 System Design

DocGuard follows a Hybrid Desktop Architecture:

  • Frontend: React 19 + TypeScript + Tailwind CSS (High performance UI).
  • Backend-as-a-Service: Supabase (PostgreSQL + Auth + Storage).
  • Desktop Host: Electron 39.

4.2 Security Architecture (AppSec)

  • Zero-Trust Storage: We do not store API keys in plaintext.
  • Electron safeStorage: We use the OS native encryption:
    • Windows: DPAPI (Data Protection API)
    • macOS: Keychain
    • Linux: Libsecret/Keyring

4.3 Data Model (Supabase)

  • loans: The central fact table.
  • filings: Linked to loans (1:N), tracks CAC status.
  • documents: Linked to loans (1:N), stores generated PDFs.
  • kyc_requests: Linked to loans, stores verification results.
  • activity_feed: A SQL View that aggregates events from all tables for the dashboard timeline.

Log in or sign up for Devpost to join the conversation.