Overview
CodeInk uses IndexedDB to store all your documents entirely in your browser. No data is ever transmitted to external servers or stored in the cloud. This architecture ensures complete privacy and data ownership.All documents remain on your device. CodeInk has zero access to your content.
IndexedDB Implementation
CodeInk implements a simple, efficient storage layer using the browser’s native IndexedDB API.Database Structure
The storage system consists of:- Database Name:
codeink-docs - Object Store:
documents - Key Path:
id(unique document identifier) - Database Version: 1
Document Schema
Each document stored in IndexedDB contains the following fields:Documents are automatically sorted by
updatedAt timestamp in descending order, showing your most recently edited documents first.Storage Operations
CodeInk’s database layer (src/lib/db.ts) provides four core operations:
Read Operations
Get All Documents
Get Single Document
null if not found.
Write Operations
Save Document
id field to determine whether to insert or update.
Delete Document
What Data is Stored
Stored Locally in IndexedDB
- Document content (markdown text)
- Document titles (auto-generated and custom)
- Creation and modification timestamps
- Unique document identifiers
NOT Stored Anywhere
- User accounts or authentication data (CodeInk has no accounts)
- Analytics or usage tracking
- IP addresses or device information
- Cookies for tracking purposes
- Any data on external servers
CodeInk is 100% client-side. The application code runs entirely in your browser, and your documents never leave your device unless you explicitly export them.
Storage Limits
IndexedDB storage limits vary by browser:| Browser | Storage Limit |
|---|---|
| Chrome/Edge | Up to 80% of total disk space (shared across all origins) |
| Firefox | Up to 2GB per origin (prompts user if more needed) |
| Safari | Up to 1GB per origin (prompts user after 50MB) |
For typical markdown documents, even large codebases with hundreds of documents will use only a few megabytes of storage.
Browser Support
IndexedDB is supported by all modern browsers:- Chrome 24+
- Firefox 16+
- Safari 10+
- Edge (all versions)
- Opera 15+
Data Persistence
IndexedDB data persists across browser sessions and even system restarts. However, data can be lost in certain scenarios:Backup Recommendations
Since data is stored locally:- Export important documents regularly using the export feature
- Use browser profiles to separate work and personal documents
- Consider external backups for critical content
- Avoid incognito mode for long-term document storage
Privacy Guarantees
CodeInk’s architecture provides strong privacy guarantees:What We Can’t See
- Your document content
- Document titles or metadata
- How many documents you create
- How often you use CodeInk
- Any information about you or your device
Same-Origin Policy
IndexedDB data is isolated by origin (https://codeink.app). This means:
- Other websites cannot access your CodeInk documents
- CodeInk cannot access data from other websites
- Even subdomains cannot access the data without explicit permission
The browser’s same-origin policy ensures that your data remains isolated and secure from other web applications.
Open Source Verification
CodeInk is fully open source, allowing you to verify the privacy claims:- Source Code: Available on GitHub
- Database Implementation:
src/lib/db.tscontains the complete storage logic (64 lines) - No Network Requests: Review the codebase to confirm no data transmission
- No Tracking Libraries: Check
package.jsonfor dependencies
Key Dependencies
Frompackage.json, CodeInk uses:
@codemirror/*- Editor component (no network activity)marked- Markdown parsing (client-side only)mermaid- Diagram rendering (client-side only)katex- Math rendering (client-side only)shiki- Syntax highlighting (client-side only)
Technical Architecture
The storage layer uses a promise-based wrapper around IndexedDB:- Opens the database connection
- Creates a transaction (readonly or readwrite)
- Performs the operation on the object store
- Closes the connection when complete
- Atomicity: Operations succeed or fail completely
- Consistency: Data remains in a valid state
- Error handling: Failed operations are properly caught and reported
Next Steps
Offline Support
Learn how CodeInk works without an internet connection
Export Documents
Back up your documents by exporting to markdown