Write Aid is a full-stack application that provides sentence-by-sentence writing analysis using the FinChat API. It takes a paragraph as input and analyzes each sentence individually using the write-aid-1 prompt.
- Frontend: React application with a clean, modern UI
- Backend: Flask API server that interfaces with FinChat
- Analysis: Each sentence is processed individually through FinChat's
write-aid-1prompt
- ✨ Sentence-by-Sentence Analysis: Each sentence is analyzed individually for writing improvements
- 🔄 Parallel Processing: Multiple sentences processed simultaneously for faster results
- 📊 Detailed Results: View analysis results with success rates and session URLs
- 🌐 FinChat Integration: Direct links to detailed analysis in FinChat interface
- 📱 Responsive Design: Works on desktop and mobile devices
- ⚡ Real-time Feedback: Live progress updates during analysis
write-aid/
├── backend/ # Python Flask backend
│ ├── app.py # Main Flask application
│ └── requirements.txt # Python dependencies
├── frontend/ # React frontend
│ ├── public/
│ │ └── index.html # HTML template
│ ├── src/
│ │ ├── App.js # Main React component
│ │ ├── App.css # Styles
│ │ ├── index.js # React entry point
│ │ └── index.css # Global styles
│ └── package.json # Node.js dependencies
├── finchat_readme.md # FinChat API documentation
└── README.md # This file
- Python 3.8+
- Node.js 16+
- npm or yarn
-
Navigate to the backend directory:
cd backend -
Create a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Start the Flask server:
python app.py
The backend will be available at
http://localhost:5000
-
Navigate to the frontend directory:
cd frontend -
Install dependencies:
npm install
-
Start the React development server:
npm start
The frontend will be available at
http://localhost:3000
GET /api/health- Health check endpointPOST /api/analyze- Analyze a paragraph{ "paragraph": "Your paragraph text here." }POST /api/split-sentences- Utility endpoint to split sentences{ "paragraph": "Your paragraph text here." }
- Input: User enters a paragraph in the React frontend
- Sentence Splitting: Backend splits the paragraph into individual sentences
- Parallel Processing: Each sentence is sent to FinChat API simultaneously
- FinChat Analysis: Each sentence is analyzed using the
write-aid-1prompt:cot write-aid-1 $sentence:{sentence} $paragraph:{full_paragraph} $author:EB White - Result Aggregation: All analysis results are collected and formatted
- Display: Frontend shows results with links to detailed FinChat sessions
The system uses the FinChat API workflow:
- Create Session:
POST /api/v1/sessions/ - Send Message:
POST /api/v1/chats/with the write-aid-1 prompt - Wait for Completion: Poll session status until "idle"
- Retrieve Results: Get the analysis results
Each analysis includes:
- Original sentence
- Analysis results from FinChat
- Direct link to FinChat session for detailed review
- Success/failure status
- FinChat URL:
https://finchat-api.adgo.dev - Author: Currently set to "EB White" (configurable in code)
- Max Workers: Default 3 concurrent sentences (configurable)
- Retry Logic: Built-in retry mechanisms for API failures
- API Base URL: Automatically configured for development/production
- Proxy: Development proxy to backend on port 5000
The system includes robust error handling:
- Individual Sentence Failures: One failed sentence doesn't stop others
- API Retry Logic: Automatic retries for transient failures
- User Feedback: Clear error messages and status indicators
- Graceful Degradation: Partial results shown even with some failures
-
Enter a paragraph like:
Writing is both an art and a craft that requires constant practice and refinement. The best writers understand that their first draft is rarely their final product. Through careful revision and thoughtful editing, a piece of writing can be transformed from a rough collection of ideas into a polished work that communicates clearly and effectively with its intended audience. -
Click "Analyze Writing"
-
View results showing:
- Analysis for each of the 3 sentences
- Success rate and statistics
- Links to detailed FinChat sessions
- Individual sentence feedback
- Backend: Add new endpoints in
backend/app.py - Frontend: Add new components in
frontend/src/ - Styling: Update styles in
frontend/src/App.css
Create .env files for environment-specific configuration:
Backend (.env):
FINCHAT_URL=https://finchat-api.adgo.dev
MAX_WORKERS=3
AUTHOR=EB White
Frontend (.env):
REACT_APP_API_URL=http://localhost:5000
The application is configured for easy deployment to Vercel, which handles both the React frontend and Python backend as serverless functions.
- GitHub account with the repository
- Vercel account (free tier available)
-
Connect to Vercel:
- Go to vercel.com
- Sign in with your GitHub account
- Click "New Project"
- Import the
write-aidrepository
-
Configure Build Settings:
- Framework Preset: Other
- Root Directory: Leave empty (uses root)
- Build Command:
cd frontend && npm run build - Output Directory:
frontend/build - Install Command:
cd frontend && npm install
-
Deploy:
- Click "Deploy"
- Vercel will automatically build and deploy your application
- Your app will be available at
https://your-project-name.vercel.app
No additional environment variables are required for basic functionality.
- Frontend:
https://your-app.vercel.app/ - Backend API:
https://your-app.vercel.app/api/analyze - Health Check:
https://your-app.vercel.app/api/health
-
Use a WSGI server like Gunicorn:
pip install gunicorn gunicorn backend.app:app
-
Or deploy to platforms like:
- Heroku
- AWS Lambda
- Google Cloud Run
- DigitalOcean App Platform
-
Build the production bundle:
cd frontend && npm run build
-
Deploy to platforms like:
- Netlify
- AWS S3 + CloudFront
- GitHub Pages
MIT License - see LICENSE file for details.
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
For issues or questions:
- Check the FinChat API documentation in
finchat_readme.md - Review the error logs in the browser console and backend logs
- Open an issue in the repository