This project is a collaborative text editor built with a React frontend and an Express backend. It allows users to securely create, edit, and share documents with collaborators using encryption for data security.
- React with Vite: Fast and modern development setup.
- User Authentication: GitHub OAuth for secure login.
- Document Management: Create, edit, and view documents.
- Collaboration: Share documents with collaborators.
- Encryption: AES and RSA encryption for secure data sharing.
- Express.js: Lightweight and efficient server.
- MongoDB: Database for storing user and document data.
- JWT Authentication: Secure API access.
- Rate Limiting: Prevent abuse with request rate limiting.
src/components: Reusable React components likeHeader,DocumentList, andPrivateKeyModal.src/pages: Pages likeDashboardPage,LoginPage, andAddDocumentPage.src/services: Service files for API calls and encryption logic.vite.config.js: Vite configuration for development and proxy setup.
models: Mongoose schemas forUserandDocument.controller: Logic for handling authentication and document APIs.middleware: JWT authentication middleware.utils: Utility functions like JWT token generation and verification.
- Node.js (v16 or later)
- MongoDB
-
Clone the repository:
git clone <repository-url> cd collabTextEditor
-
Install dependencies for both frontend and backend:
cd collabTextEditorFE npm install cd ../collabTextEditorBE npm install
-
Set up environment variables:
- Create a
.envfile incollabTextEditorBEwith the following:MONGO_URI=<your-mongodb-uri> JWT_SECRET=<your-jwt-secret> GITHUB_CLIENT_ID=<your-github-client-id> GITHUB_CLIENT_SECRET=<your-github-client-secret> GITHUB_CALLBACK=<your-github-callback-url> REACT_URL=<frontend-url>
- Create a
-
Start the backend server:
cd collabTextEditorBE node server.js -
Start the frontend development server:
cd collabTextEditorFE npm run dev
- Open the frontend in your browser (default:
http://localhost:5173). - Log in using your GitHub account.
- Create a new document, add collaborators, and start editing securely.
- AES-GCM: Used for encrypting document content.
- RSA-OAEP: Used for encrypting AES keys.
- GitHub Gists: Public keys are stored securely in GitHub Gists.
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bugfix.
- Submit a pull request with a detailed description of your changes.
This project is licensed under the MIT License. See the LICENSE file for details.