DocuPulse uses SQLAlchemy ORM with PostgreSQL to manage a comprehensive set of data models that support multi-tenant document management, user collaboration, and system administration. The database schema is designed for scalability, security, and efficient querying with proper relationships and constraints.
Core user account with authentication, roles, and profile information.
id - Primary keyusername - Unique usernameemail - Unique email addresspassword_hash - Encrypted passwordis_admin - Administrator roleis_manager - Manager rolelast_name - User's last namephone - Contact phonecompany - Company nameposition - Job positionprofile_picture - Avatar imagepreferred_view - UI preferenceDocument workspace with member management and file organization.
id - Primary keyname - Room namedescription - Room descriptioncreated_at - Creation timestampcreated_by - Creator user IDcreator - Room creator (User)members - Room members (User)member_permissions - Member permissionsfiles - Room files (RoomFile)Files and folders stored within rooms with metadata and access tracking.
id - Primary keyname - File/folder namepath - File pathtype - 'file' or 'folder'size - File size in bytesmodified - Last modified timestamproom_id - Parent roomuploaded_by - Uploader user IDuploaded_at - Upload timestampdeleted - Deletion statusdeleted_by - Deleter user IDdeleted_at - Deletion timestampReal-time messaging conversations with member management.
id - Primary keyname - Conversation namedescription - Conversation descriptioncreated_at - Creation timestampcreated_by - Creator user IDcreator - Conversation creatormembers - Conversation membersmessages - Conversation messagesprimary_color - Brand primary colorsecondary_color - Brand secondary colorcompany_name - Company namecompany_logo - Logo filenamecompany_website - Company websitecompany_email - Contact emailmax_rooms - Maximum rooms per instancemax_conversations - Max conversationsmax_storage - Storage limit in bytesupdated_at - Last update timestampUsers can create rooms, upload files, send messages, and participate in conversations with proper permission controls
Files are organized in rooms with folder structures, starring capabilities, and trash management for deleted items
Granular permissions control access to rooms, files, and conversations with role-based and user-specific settings
Comprehensive event logging tracks all user actions, file operations, and system changes for security and compliance