This is the backend for SynchroDocs, a collaborative online document editor. The backend is built with Node.js, Express, MongoDB, and Socket.io for real-time collaboration.
frontend: https://www.github.com/ujjwal-bh/synchrodocs-ui
- Real-time collaborative editing using Socket.io
- User authentication and authorization with JWT
- RESTful API for document management
- Document version history
Ensure you have the following installed on your system:
- Node.js (v12.x or later)
- npm (v6.x or later)
- MongoDB (v4.x or later)
-
Navigate to the backend directory:
cd backend
-
Install the dependencies:
npm install
-
Set up environment variables:
Create a
.env
file in thebackend
directory and add the following:MONGO_URI=your_mongodb_uri JWT_SECRET=your_jwt_secret
-
Start the development server:
npm run dev
The backend server should now be running on
http://localhost:5000
.
-
User Authentication:
- POST
/api/auth/register
- Register a new user - POST
/api/auth/login
- Authenticate a user
- POST
-
Document Management:
- GET
/api/documents
- Get all documents for the authenticated user - POST
/api/documents
- Create a new document - GET
/api/documents/:id
- Get a specific document by ID - PUT
/api/documents/:id
- Update a document by ID - DELETE
/api/documents/:id
- Delete a document by ID
- GET
- Node.js
- Express
- MongoDB
- Mongoose
- JWT (for authentication)
- Socket.io (for real-time collaboration)
For any questions or issues, please open an issue in the repository or contact us at bhattaraujjwal26@gmail.com