A cloud-based document editor that lets you create, edit, and save letters directly to your Google Drive.
A demonstration video of the Letter Editor application is available
- Google Authentication: Securely login with your Google account
- Create Documents: Write and format letters in a clean, distraction-free editor
- Save to Google Drive: Automatically save documents to your Google Drive
- Document Management: Browse, edit, and manage all your saved letters
- Responsive Design: Works on desktop and mobile devices
- React.js with Vite
- React Router for navigation
- Bootstrap for UI components
- Axios for API requests
- Node.js with Express
- Google OAuth2 for authentication
- Google Drive API for document storage
- JWT for secure token management
- Node.js (v14+ recommended)
- npm or yarn
- A Google Cloud Platform account with OAuth credentials
git clone https://github.com/josephpeter231/letter-editor.git# Navigate to backend directory
cd backend
# Install dependencies
npm install
# Create .env file with the following variables
touch .envAdd the following to your .env file:
PORT=5000
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
JWT_SECRET=your_jwt_secret
CLIENT_URL=http://localhost:5173
# Navigate to frontend directory
cd frontend
# Install dependencies
npm install
# Create .env file for frontend
touch .env.localVITE_API_URL=http://localhost:5173/api
- Go to Google Cloud Console
- Create a new project
- Enable the Google Drive API
- Configure OAuth consent screen
- Create OAuth 2.0 Client IDs
- Add authorized redirect URIs:
http://localhost:5000/api/auth/google/callback(for development)https://letter-editor-backend.onrender.com/api/auth/google/callback(for production)
In development mode:
# Start the backend server (from backend directory)
npm run dev
# In a separate terminal, start the frontend (from frontend directory)
npm run devVisit http://localhost:5173 to access the application.
The application is deployed and accessible at: (backend is hosted in free tier in render.com so there will be some delay)
- Frontend: https://letter-editor.vercel.app
- Backend: https://letter-editor-backend.onrender.com
- Login: Click the "Login with Google" button to authenticate
- Create: Click "Editor" in the navigation bar to create a new document
- Save: Enter your content and click "Save to Drive" to store in Google Drive
- Manage: Access all your documents from the "My Letters" section
- Edit: Click on any document to view or edit its contents
- User clicks "Login with Google"
- User is redirected to Google's OAuth consent screen
- After granting permissions, user is redirected back to the application
- The backend exchanges the authorization code for access and refresh tokens
- User is authenticated and can now access the application features
GET /api/auth/google: Initiates Google OAuth flowGET /api/auth/google/callback: OAuth callback endpointGET /api/drive/files: Retrieves user's saved documentsGET /api/drive/files/:fileId/content: Gets content of a specific documentPOST /api/drive/save: Creates a new documentPUT /api/drive/files/:fileId: Updates an existing document
Made with ❤️ by Joseph peter J