Skip to content

Architecture Notes

System Overview

The dnd_identitydocs resource is designed as a comprehensive identity and document management tool for FiveM servers. It is optimized for performance, scalability, and reliability in server environments.

Subsystems

  • Request Repository: Queues and validates document requests.
  • Printer Service: Manages document printing jobs.
  • Photobooth Service: Handles photo capturing and storage.
  • Archive Service: Stores and retrieves historical records of all documents.
  • Holder Service: Provides holder mechanisms or inventory items for identity storage.
  • Configuration Repository: Centralized management of templates and settings via dnd_identitydocs_config.
  • Frontend (NUI): Built using React with Vite for seamless integration and runtime performance.

Storage Models

Holder Mode

When Config.use_holder = true:

  • Identities are stored in a database table (dnd_identitydocs_holders).
  • Ideal for persistent, queryable identity records.
  • Supports advanced archival features.

Item-Based Mode

When Config.use_holder = false:

  • Identities are converted into ox_inventory items.
  • Lightweight and easier for basic setups.
  • Uses item metadata for document details.

Document Templates

Runtime Dynamic Templates

  • Configured via dnd_identitydocs_config.templates_json.
  • Templates are stored dynamically in the database and editable in real-time.

Static Templates

  • Can be hardcoded as a fallback option.
  • Default templates are protected and cannot be deleted.

New Infrastructure Updates

  • Dynamic Sidebar UI: User-friendly experience via React interfaces.
  • Grade-Based Access Control: Set feature permissions based on job hierarchy.
  • Radial Menu Functionality: Document quick commands integrated with qbx-radialmenu.
  • DMV/STNK System: Simplified vehicle registration workflows.
  • Holder Persistence: Data consistency between live server restarts.

Developer Notes

  • Ensure all buyer-facing resources (e.g., template previews, photobooth snapshots) use web/images for easy client customizations.
  • Avoid modifications to the web/dist/assets folder to prevent compatibility issues during updates.

Documentation portal for DND resources.