# How to build a document management system in Bubble

- Tool: Bubble
- Difficulty: Beginner
- Time required: 25-30 min
- Compatibility: All Bubble plans
- Last updated: March 2026

## TL;DR

Build a document management system in Bubble by creating Document and Folder data types with file upload, version tracking, tag-based search, and access permissions. Users upload files via the File Uploader element, organize them into folders, and search using tags and filenames. Privacy Rules control who can view and edit documents based on team membership or ownership.

## Build a Document Management System in Bubble

This tutorial guides you through creating a DMS where users upload, organize, search, and manage documents. You will build folder hierarchies, version tracking, and access controls.

## Before you start

- A Bubble account with user authentication
- Basic understanding of File Uploader element
- Familiarity with Data Types and Privacy Rules

## Step-by-step guide

### 1. Create Document and Folder Data Types

Create 'Folder' with: name (text), parent_folder (Folder — for nesting), owner (User), shared_with (list of Users). Create 'Document' with: name (text), file (file), folder (Folder), uploaded_by (User), version (number, default 1), tags (list of texts), description (text), file_size (text).

**Expected result:** Folder and Document data types with proper fields.

### 2. Build the Folder Navigation Interface

Create a page with a sidebar showing folders in a Repeating Group. Filter by parent_folder = null for root folders. Clicking a folder updates a Custom State 'current_folder' and shows its sub-folders and documents. Add breadcrumbs showing the folder path. Add 'New Folder' and 'Upload Document' buttons.

**Expected result:** Users can browse folders and see contained documents.

### 3. Implement File Upload with Metadata

Add a popup for uploading: File Uploader element, Input for document name, Multiline for description, and a tag input. The upload workflow: Create Document with file = File Uploader's value, name from input, folder = current_folder state, uploaded_by = Current User, version = 1.

**Expected result:** Users can upload documents with metadata into the current folder.

### 4. Add Version Tracking

When updating a document, create a 'DocumentVersion' data type: document (Document), file (file), version_number (number), uploaded_by (User), upload_date (date). Instead of overwriting, create a new version entry and increment the Document's version number. Display version history in a popup.

**Expected result:** Documents maintain a version history with downloadable previous versions.

### 5. Build Search and Filtering

Add a search input at the top. Filter the Documents Repeating Group by: name contains search text OR tags contains search text. Add Dropdown filters for file type and upload date range. Use Search constraints for efficient server-side filtering.

**Expected result:** Users can search documents by name, tags, and metadata.

### 6. Set Access Permissions

Add Privacy Rules on Document: viewable when folder's owner = Current User OR folder's shared_with contains Current User. Add a 'Share' button on folders that lets owners add users to shared_with. Documents inherit their folder's permissions.

**Expected result:** Documents are only visible to authorized users based on folder sharing.

## Complete code example

File: `Workflow summary`

```text
DATA TYPES:
- Folder: name, parent_folder (Folder), owner (User), shared_with (list of Users)
- Document: name, file, folder (Folder), uploaded_by (User), version (number), tags (list of texts), description, file_size
- DocumentVersion: document (Document), file, version_number, uploaded_by (User), upload_date

PAGES:
1. documents — folder tree sidebar + document list + search
2. document-detail — full info, version history, download

KEY WORKFLOWS:
1. Create Folder → Create Folder (parent = current_folder or null for root)
2. Upload Document → Create Document → Link to current folder
3. Update Document → Create DocumentVersion → Increment version number
4. Share Folder → Add user to shared_with list
5. Delete Document → Soft delete (is_deleted flag) or hard delete
```

## Common mistakes

- **Not organizing documents into folders** — A flat list becomes unusable once you have more than 50 documents. Fix: Implement a folder hierarchy from the start, even if you only have a few documents initially.
- **Overwriting files instead of creating versions** — Users lose access to previous versions, which is critical for auditing and recovery. Fix: Create a DocumentVersion record for each update rather than replacing the file field.
- **Not setting file size limits on uploads** — Very large files slow down the app and consume storage quickly. Fix: Set max file size on the File Uploader element (e.g., 25MB) and validate in the workflow.

## Best practices

- Implement folder hierarchy with breadcrumb navigation for easy orientation.
- Track document versions rather than overwriting files.
- Use tags for flexible cross-folder document discovery.
- Set Privacy Rules based on folder ownership and sharing.
- Add file type icons (PDF, Word, Excel) for visual identification.
- Implement soft-delete with a trash/recycle bin before permanent deletion.

## Frequently asked questions

### How much storage do I get for documents?

Storage depends on your Bubble plan: Free = 0.5GB, Starter = 10GB, Growth = 100GB, Team = 1TB. Monitor usage in Settings.

### Can I preview documents in-browser?

Images display natively. PDFs can be embedded in an iframe. For Word/Excel, you would need a document viewer plugin or convert to PDF first.

### How do I handle large file uploads?

Set reasonable size limits (25-50MB per file). For very large files, consider using external storage (AWS S3) via the API Connector.

### Can I add full-text search within document contents?

Bubble cannot search within file contents natively. You would need an external search service (Algolia) or extract text during upload and store it as a searchable field.

### How do I implement document approval workflows?

Add a 'status' field (draft/pending/approved/rejected) and an approval workflow. For complex document workflows, RapidDev can build custom approval chains.

### Can multiple users edit the same document?

Bubble does not support real-time collaborative editing. Users download, edit locally, and upload a new version. Use file locking (a 'locked_by' User field) to prevent concurrent edits.

---

Source: https://www.rapidevelopers.com/bubble-tutorial/build-a-document-management-system-in-bubble-3cf3b
© RapidDev — https://www.rapidevelopers.com/bubble-tutorial/build-a-document-management-system-in-bubble-3cf3b
