A web application that helps students understand complex text through AI-powered simplification, vocabulary extraction, and summarization.
- Text Simplification: Converts complex text to different reading levels (3rd grade, middle school, high school, college)
- Vocabulary Extraction: Identifies difficult words with simple definitions and examples
- Smart Summarization: Generates concise summaries of the main points
- Text-to-Speech: Read simplified text aloud using browser speech synthesis
- Clean UI: Student-friendly interface with intuitive controls
- Real-time Processing: Fast AI-powered text analysis
- Frontend: React 18 with modern hooks
- Backend: Node.js with Express
- AI: Google Gemini 1.5 Flash for text processing
- Styling: Custom CSS with utility classes
- API: RESTful API with error handling
- Node.js (v16 or higher)
- npm or yarn
- Google Gemini API key (free!)
-
Clone and install dependencies:
git clone <repository-url> cd reading-companion npm run install-all
-
Set up environment variables:
cd server cp env.example .envEdit
.envand add your Gemini API key:GEMINI_API_KEY=your_gemini_api_key_here PORT=3001 NODE_ENV=development -
Start the application:
npm run dev
This will start both the backend server (port 3001) and frontend (port 3000).
-
Open your browser: Navigate to
http://localhost:3000
- Enter Text: Paste or type complex text in the input area
- Choose Reading Level: Select your target reading level from the dropdown
- Configure Options: Choose whether to include a summary
- Process: Click "Simplify Text" to analyze your text
- Review Results: View simplified text, vocabulary, and summary in organized tabs
Process text for simplification, vocabulary, and summarization.
Request:
{
"text": "Your complex text here...",
"readingLevel": "middle-school",
"includeSummary": true
}Response:
{
"simplifiedText": "Simplified version...",
"vocabulary": [
{
"word": "complex",
"definition": "hard to understand",
"example": "This is a complex problem.",
"difficulty": "intermediate"
}
],
"summary": "Main points summary..."
}Extract vocabulary only from text.
Request:
{
"text": "Your text here..."
}- 3rd Grade: Simple sentences, basic words, short phrases
- Middle School: Clear explanations, moderate complexity
- High School: More sophisticated language, complex concepts
- College: Academic language, specialized terminology
lexia/
├── client/ # React frontend
│ ├── src/
│ │ ├── components/ # React components
│ │ ├── services/ # API services
│ │ └── App.js # Main app component
├── server/ # Express backend
│ ├── routes/ # API routes
│ ├── services/ # Business logic
│ └── index.js # Server entry point
└── package.json # Root package.json
npm run dev- Start both frontend and backend in development modenpm run server- Start only the backend servernpm run client- Start only the frontendnpm run build- Build the frontend for production
- New Components: Add to
client/src/components/ - API Endpoints: Add to
server/routes/ - Services: Add business logic to
server/services/
GEMINI_API_KEY: Your Google Gemini API key (required)PORT: Server port (default: 3001)NODE_ENV: Environment (development/production)
- Reading Levels: Modify
readingLevelConfigsinserver/services/textProcessor.js - Styling: Update
client/src/App.cssandclient/src/index.css - API Timeout: Adjust timeout in
client/src/services/api.js
-
"API key not configured"
- Ensure your
.envfile has the correctGEMINI_API_KEY - Restart the server after adding the key
- Ensure your
-
"Unable to connect to server"
- Check that the backend is running on port 3001
- Verify no firewall is blocking the connection
-
Slow processing
- Large texts may take longer to process
- Consider breaking long texts into smaller sections
The app includes comprehensive error handling for:
- Network connectivity issues
- API quota limits
- Invalid input validation
- Server errors
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
MIT License - see LICENSE file for details.
For issues and questions:
- Check the troubleshooting section
- Review the API documentation
- Open an issue on GitHub
Happy Reading with Lexia! 📚✨