A collaborative real-time markdown editor that allows multiple users to edit documents simultaneously. Built with modern web technologies and containerized for easy deployment.
- Real-time collaborative editing
- Markdown preview
- Persistent storage with MongoDB
- WebSocket-based real-time updates
- Containerized deployment with Docker
- Kubernetes support for scaling
- Load testing capabilities with Locust
The project consists of several components:
- Frontend: React-based web application
- Backend: Node.js/Express server with Socket.IO
- Database: MongoDB for document storage
- Containerization: Docker for both frontend and backend
- Orchestration: Kubernetes deployment configurations
- Load Testing: Locust for performance testing
- Node.js (v14 or higher)
- MongoDB
- Docker and Docker Compose (for containerized deployment)
- Kubernetes cluster (for k8s deployment)
Create a .env
file in the root directory with the following variables:
MONGODB_URI=mongodb://localhost:27017/markdown-notebook
PORT=3001
FRONTEND_URL=http://localhost:3000
-
Install dependencies:
# Install backend dependencies npm install # Install frontend dependencies cd frontend npm install
-
Start the development servers:
# Start backend server npm run dev # Start frontend server (in a new terminal) cd frontend npm start
- Build and run with Docker Compose:
docker-compose up --build
- Apply the Kubernetes configurations:
kubectl apply -f k8s/
The project includes Locust for load testing. To run load tests:
cd locust
locust
Then open http://localhost:8089 to start the load test.
.
├── backend/ # Backend server code
├── frontend/ # React frontend application
├── k8s/ # Kubernetes configuration files
├── locust/ # Load testing scripts
├── server.js # Main backend entry point
└── package.json # Project dependencies
GET /api/documents/:documentId
- Fetch a document- WebSocket events:
join-document
- Join a document roommarkdown-change
- Update document contentmarkdown-update
- Receive document updates
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Socket.IO for real-time communication
- React for the frontend framework
- MongoDB for data persistence
- Docker for containerization