A real-time collaborative notes application built with FastAPI, Socket.IO and Redis for instant updates across connected clients.
Users can create, edit and share notes in real time, with changes instantly synced for all participants in a shared room.
- Real-time Collaboration — Multiple users can edit notes simultaneously with instant updates via Socket.IO.
- Persistent Storage — Notes are stored in Redis for quick retrieval and low latency.
- Room-based Editing — Users can join specific rooms to collaborate on different notes.
- Private/Public Rooms — Users can create rooms which can only be accessed through passcodes (private) or they can be public.
- REST + WebSocket Hybrid — FastAPI serves the REST API for CRUD operations, while Socket.IO handles live updates.
- Scalable Architecture — Designed to run in distributed environments with Redis Pub/Sub as the message broker.
- Backend Language: Python
- Backend Framework: FastAPI
- Frontend: HTML, CSS, JavaScript
- WebSocket Communication: python-socketio (Socket.IO for Python)
- Message Broker / Cache: Redis
- ASGI Server: Uvicorn
- Docker: Docker
- Docker Compose: Docker Compose
- Minikube: Minikube
- Kubernetes: Kubernetes
collaborative-notes/
├── docker-compose.yml
├── Dockerfile
├── k8s/
│ ├── notes-app-deployment.yaml
│ ├── notes-app-service.yaml
│ ├── redis-deployment.yaml
│ └── redis-service.yaml
├── main.py
├── models.py
├── README.md
├── requirements.txt
├── screenshots/
│ ├── accessing-private-note.png
│ ├── collaborative-editing-private-note-1.png
│ ├── collaborative-editing-private-note-2.png
│ ├── collaborative-editing-private-note-3.png
│ ├── collaborative-editing-public-note-1.png
│ ├── collaborative-editing-public-note-2.png
│ ├── collaborative-editing-public-note-3.png
│ ├── deleted-private-note.png
│ ├── deleted-public-note.png
│ ├── deletion-private-note.png
│ ├── deletion-public-note.png
│ ├── initial-screen.png
│ ├── private-note-creation.png
│ ├── public-note-creation.png
│ └── wrong-passcode.png
└── static/
├── index.html
├── script.js
└── style.css
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/notes |
Get all notes |
GET |
/api/notes/{id} |
Get a specific note |
POST |
/api/notes |
Create a new note |
POST |
/api/notes/{id}/unlock |
Unlocks a passcode-locked note |
DELETE |
/api/notes/{id} |
Delete a note |
| Event Name | Direction | Description |
|---|---|---|
join_note |
Client ↔ Server | Opens a specific note |
leave_note |
Client ↔ Server | Closes a specific note |
apply_patch |
Client ↔ Server | Broadcast note content changes in real time |
update_title |
Client ↔ Server | Broadcast note title changes in real time |
cursor_move |
Client ↔ Server | Broadcast active users' cursor positioning in real time |
git clone https://github.com/deluxe-wizard-seven/collaborative-notes.git
cd collaborative-notespython -m venv .venv
source .venv/bin/activate # Mac/Linux
.venv\Scripts\activate # Windowspip install -r requirements.txtFor local development using redis-stack, redis-server is used in production level:
docker run -d --name redis-stack -p 6379:6379 -p 8001:8001 redis/redis-stack:latestpython main.py-
Local Development:
- Start the redis-server/redis-stack in your localhost.
- Run
python main.py.
-
Dockerized Setup:
-
A Dockerfile is provided to containerize the FastAPI + Socket.IO backend.
-
A docker-compose.yml is included to orchestrate services (FastAPI app, Redis and any additional dependencies).
-
Bring everything up with:
docker compose up --build
-
-
Kubernetes Setup:
- Using minikube the project can be deployed (locally).
- Create image -
docker build -t notes-app:latest . - Start minikube service -
minikube start - Load image in minikube -
minikube image load notes-app:latest - Apply the k8s config -
kubectl apply -f ./k8s - Tracking changes -
kubectl get deploymentsandkubectl get services - Fetch Cluster IP using -
minikube ipand the app will be hosted onhttp://<cluster ip address>:31000/ - Clean resources -
kubectl delete deployments redis notes-appandkubectl delete services redis notes-svc - Stop minikube service -
minikube stop - Remove image -
docker rmi -f notes-app:latest
- Create image -
- Using minikube the project can be deployed (locally).
-
Production Deployment:
- Push the Docker images to a registry (e.g., Docker Hub, AWS ECR or GCP Artifact Registry).
- Deploy via AWS ECS/Fargate, GCP Cloud Run, or Kubernetes.
- Ensure Redis runs either as a managed service (AWS ElastiCache, GCP Memorystore) or as part of your container stack.














