Every time I started a new project, I had to write the same boilerplate — REST endpoints, WebSocket setup, Redis config, Firebase integration. I thought: what if none of this was needed?
So I built dsn-sync — a Python package that lets your backend and frontend talk to each other directly, with zero API setup.
The problem it solves
A typical data sync stack looks like this:
Backend → REST API → Controller → Route → Middleware → Frontend
(Plus: Redis, Celery, WebSocket, Firebase...)
With dsn-sync, it becomes:
Backend → Frontend ✅ (That's it!)
Installation
pip install dsn-sync # Backend (Python)
npm install dsn-sync-client # Frontend (JS)
Quick example
Backend (Python):
from dsn_sync import DSNSync
sync = DSNSync(port=3000)
sync.start()
sync.define_table('users', {
'key': 'user_id',
'fields': ['name', 'email', 'status']
})
# Push data to frontend — no API needed!
sync.sync('users', 'user_123', {
'name': 'Satish',
'email': 'satish@example.com',
'status': 'active'
})
Frontend (JavaScript):
import { connectDSN } from 'dsn-sync-client';
const client = connectDSN('YOUR_URL', 'YOUR_TOKEN');
// Get all users — auto synced!
const users = await client.getAll('users');
// Listen for real-time changes
client.onDataChange('users', (data) => {
console.log('Data updated!', data);
});
What it supports
Beyond basic sync, dsn-sync handles full CRUD, real-time notifications, a chat system, background auto-tasks, and live chart data — all without WebSocket, Firebase, Redis, or Celery. It uses encrypted communication with token-based auth and works with Python 3.7+.
CRUD example
@sync.on_create('users')
def handle_create(data):
print(f"New user: {data['name']}")
return True
@sync.on_update('users')
def handle_update(data):
print(f"Updated: {data}")
return True
@sync.on_delete('users')
def handle_delete(data):
print(f"Deleted: {data['user_id']}")
return True
Try it out
PyPI: https://pypi.org/project/dsn-sync/
GitHub: https://github.com/python-hacked
I would love feedback from the dev community — what features would you want next? Drop a comment below!
— Satish Choudhary
Top comments (0)