Releases: Tryboy869/LDSS
LDSS v0.1.0 - Experimental Release
π LDSS - Local Distributed Storage System
Store data in your users' browsers. Zero backend required.
Quick Start β’ Documentation β’ Examples β’ Contributing
β οΈ Experimental Release
LDSS v0.1.0 is an experimental proof-of-concept.
- β Works in modern browsers (Chrome, Firefox, Safari, Edge)
- β Great for prototypes and personal projects
β οΈ API may change in future versionsβ οΈ Not battle-tested in production yet
Use at your own risk. Feedback and contributions welcome!
π― What is LDSS?
LDSS (Local Distributed Storage System) is a JavaScript library that lets you store data directly in your users' browsers using modern web APIs.
Why LDSS?
- π Zero Backend - No servers, no databases, no infrastructure costs
- π° Free Forever - Storage lives in user devices, not your servers
- π Privacy-First - Data never leaves the user's device
- β‘ Blazing Fast - Direct access to local storage, no network latency
- π¦ Simple API - Store, retrieve, search - that's it
Perfect For
- Personal projects and prototypes
- Offline-first applications
- Client-side tools and utilities
- Learning modern web storage APIs
- MVP development without backend
π¦ Installation
Via NPM
npm install ldss-clientVia CDN
<script src="https://unpkg.com/ldss-client@0.1.0/ldss-client.js"></script>Manual Download
Download ldss-client.js from GitHub Releases
π Quick Start
1. Import LDSS
// ES6 Module
import LDSS from 'ldss-client';
// CommonJS
const LDSS = require('ldss-client');
// Browser (CDN)
// LDSS is available as window.LDSS2. Initialize
const db = new LDSS({
projectName: 'MyAwesomeApp'
});
await db.init();3. Store Data
await db.store('todos', {
title: 'Build something amazing',
done: false
});4. Retrieve Data
const todos = await db.getAll('todos');
console.log(todos);Complete Example
<!DOCTYPE html>
<html>
<head>
<title>LDSS Todo App</title>
</head>
<body>
<h1>My Todos</h1>
<input type="text" id="todoInput" placeholder="New todo...">
<button onclick="addTodo()">Add</button>
<ul id="todoList"></ul>
<script src="https://unpkg.com/ldss-client@0.1.0/ldss-client.js"></script>
<script>
let db;
async function initApp() {
db = new LDSS({ projectName: 'TodoApp' });
await db.init();
await loadTodos();
}
async function addTodo() {
const input = document.getElementById('todoInput');
const title = input.value.trim();
if (!title) return;
await db.store('todos', {
title,
done: false,
createdAt: Date.now()
});
input.value = '';
await loadTodos();
}
async function loadTodos() {
const todos = await db.getAll('todos');
const list = document.getElementById('todoList');
list.innerHTML = todos
.map(todo => `<li>${todo.title}</li>`)
.join('');
}
initApp();
</script>
</body>
</html>π Documentation
API Reference
new LDSS(config)
Create a new LDSS instance.
const db = new LDSS({
projectName: 'MyApp' // Required: Unique name for your app
});Parameters:
config.projectName(string, required) - Unique identifier for your application
await db.init()
Initialize LDSS workers. Must be called before any operations.
await db.init();Returns: Promise - The initialized instance
await db.store(collection, data)
Store data in a collection.
await db.store('users', {
name: 'Alice',
email: 'alice@example.com'
});Parameters:
collection(string) - Collection namedata(object) - Data to store
Returns: Promise<{ success: boolean, id: string }>
Auto-generated fields:
id- Unique identifier (auto-generated if not provided)_createdAt- Timestamp when record was created
await db.get(collection, id)
Get a single item by ID.
const user = await db.get('users', 'user-123');
console.log(user);Parameters:
collection(string) - Collection nameid(string|number) - Item ID
Returns: Promise<object|null> - The item or null if not found
await db.getAll(collection)
Get all items from a collection.
const allUsers = await db.getAll('users');
console.log(allUsers); // Array of user objectsParameters:
collection(string) - Collection name
Returns: Promise - Array of items
await db.delete(collection, id)
Delete an item.
await db.delete('users', 'user-123');Parameters:
collection(string) - Collection nameid(string|number) - Item ID
Returns: Promise<{ success: boolean }>
await db.search(query)
Search across all collections.
const results = await db.search('alice');
console.log(results);
// [{ collection: 'users', id: 'user-123', score: 100 }]Parameters:
query(string) - Search query
Returns: Promise - Array of search results with scores
Searchable fields: title, name, text, content, description
await db.clear(collection)
Clear all data from a collection.
await db.clear('todos');Parameters:
collection(string) - Collection name
Returns: Promise<{ success: boolean }>
await db.getStats()
Get storage statistics.
const stats = await db.getStats();
console.log(stats);
/*
{
version: '0.1.0',
projectName: 'MyApp',
collections: 3,
totalItems: 42,
searchIndexSize: 42,
estimatedSize: 43008
}
*/Returns: Promise - Storage statistics
Architecture
LDSS v0.1.0 uses 3 specialized workers:
βββββββββββββββββββββββββββββββββββββββ
β LDSS Architecture β
βββββββββββββββββββββββββββββββββββββββ€
β β
β Worker 1: IndexedDB β
β ββ Primary data storage β
β ββ ~50 MB - 2 GB capacity β
β ββ Persistent across sessions β
β β
β Worker 2: Cache (localStorage) β
β ββ Fast access cache β
β ββ ~5-10 MB capacity β
β ββ TTL-based expiration β
β β
β Worker 3: Search (in-memory) β
β ββ Full-text search index β
β ββ Variable size β
β ββ Rebuilt on page load β
β β
βββββββββββββββββββββββββββββββββββββββ
Storage Capacity:
- Total: 50 MB - 2 GB (depends on browser)
- Chrome/Edge: Up to 60% of free disk space
- Firefox: Up to 10% of free disk space
- Safari: Fixed ~1 GB limit
π‘ Examples
Example 1: Todo App
Example 2: Notes App
Example 3: Contacts Manager
π§ Advanced Usage
Working with Multiple Collections
// Users collection
await db.store('users', { name: 'Alice' });
await db.store('users', { name: 'Bob' });
// Posts collection
await db.store('posts', { title: 'Hello World', author: 'Alice' });
await db.store('posts', { title: 'LDSS is awesome', author: 'Bob' });
// Get all users
const users = await db.getAll('users');
// Get all posts
const posts = await db.getAll('posts');Custom IDs
// Provide your own ID
await db.store('users', {
id: 'user_alice_2025',
name: 'Alice'
});
// Retrieve by custom ID
const alice = await db.get('users', 'user_alice_2025');Search with Auto-Indexing
// Store items with searchable fields
await db.store('articles', {
title: 'Getting Started with LDSS',
content: 'LDSS is a local storage system...',
author: 'Anzize'
});
await db.store('articles', {
title: 'Advanced LDSS Patterns',
content: 'Learn how to build complex apps...',
author: 'Anzize'
});
// Search across all articles
const results = await db.search('LDSS');
// Returns articles sorted by relevanceError Handling
try {
await db.store('users', { name: 'Alice' });
} catch (error) {
console.error('Failed to store user:', error);
}Storage Statistics
const stats = await db.getStats();
console.log(`
Project: ${stats.projectName}
Collections: ${stats.collections}
Total Items: ${stats.totalItems}
Search Index: ${stats.searchIndexSize} items
`);π Browser Support
| Browser | Version | Support |
|---|---|---|
| Chrome | 87+ | β Full |
| Firefox | 78+ | β Full |
| Safari | 14+ | β Full |
| Edge | 87+ | β Full |
| Opera | 73+ | β Full |
Requirements:
- IndexedDB support
- localStorage support
- ES6+ JavaScript
π Privacy & Security
Data Privacy
- 100% Client-Side: All data stays in the user's browser
- No Tracking: LDSS doesn't send any...