An app to translate complex legal and medical documents into an EasyRead format for individuals with intellectual disabilities to have greater autonomy
A document processing app that converts complex legal documents into EasyRead format for individuals with intellectual disabilities. Built with Node.js/Express backend and Expo React Native mobile app.
Before you begin, ensure you have the following installed on your Mac:
- Node.js (version 16 or higher recommended)
- npm (comes with Node.js)
To check if you have them installed:
node --version
npm --versionIf not installed, download from: https://nodejs.org/
npm install -g expo-cliOr use npx (no installation needed):
npx expo --version- Sign up at https://platform.openai.com/
- Create an API key from https://platform.openai.com/api-keys
- Never put this key in the mobile app or in any
EXPO_PUBLIC_*variable (those values ship in the client bundle). Usebackend/.envlocally and your host’s secret store in production (e.g. Railway variables).
easyread/
├── backend/ # Node.js/Express backend server
│ ├── .env # Environment variables (API key)
│ ├── server.mjs # Main server file
│ └── ...
└── mobile/ # Expo React Native mobile app
├── src/ # Source code
└── ...
-
Navigate to backend directory:
cd easyread/backend -
Install dependencies:
npm install
-
Create
.envfile: Copybackend/.env.exampletobackend/.envand setOPENAI_API_KEYand optional vars. Do not commit.env. -
Initialize the database: The database will be created automatically when you start the server.
-
Navigate to mobile directory:
cd easyread/mobile -
Install dependencies:
npm install
-
Install Expo CLI (if not already installed):
npm install -g expo-cli
-
Configure backend URL (mobile): Copy
mobile/.env.exampletomobile/.envand adjust:- Test against hosted API (default): set
EXPO_PUBLIC_BACKEND_URLto your HTTPS API (same host asdefaultPublicBackend.json/eas.json). - Simulator/emulator + local
npm startbackend: setEXPO_PUBLIC_USE_LOCAL_BACKEND=true(and leaveEXPO_PUBLIC_BACKEND_URLunset) so Android emulator uses10.0.2.2:4000and iOS simulator uses127.0.0.1:4000. - Physical device + local backend: set
EXPO_PUBLIC_BACKEND_URL=http://YOUR_LAN_IP:4000(phone must reach that IP).
Resolution order and release safety are implemented in
mobile/src/backendResolution.js(local/LAN URLs are ignored in release builds).To find your Mac's LAN IP:
ipconfig getifaddr en0
- Test against hosted API (default): set
cd easyread/backend
npm startYou should see:
EasyRead backend listening on port 4000
The server will run on http://localhost:4000
cd easyread/mobile
npm startOr using Expo CLI:
npx expo startThis will open the Expo development tools. You can then:
- Press
wto open in web browser - Press
ato open in Android emulator (requires Android Studio) - Scan QR code with Expo Go app on your phone (iOS/Android)
- Start backend server
- Start mobile app with
npm start - Press
wto open in browser - App will open at
http://localhost:8081orhttp://localhost:19006
- Install Expo Go app on your phone:
- iOS: App Store
- Android: Google Play Store
- Ensure phone and Mac are on the same Wi-Fi network
- Set
EXPO_PUBLIC_BACKEND_URL=http://YOUR_MAC_LAN_IP:4000inmobile/.env - Start backend server
- Start mobile app
- Scan QR code with Expo Go app
- Install Android Studio from https://developer.android.com/studio
- Set up Android SDK and create an emulator
- Set
ANDROID_HOMEenvironment variable:export ANDROID_HOME=$HOME/Library/Android/sdk export PATH=$PATH:$ANDROID_HOME/emulator export PATH=$PATH:$ANDROID_HOME/tools export PATH=$PATH:$ANDROID_HOME/tools/bin export PATH=$PATH:$ANDROID_HOME/platform-tools
- Start emulator from Android Studio
- Start mobile app and press
a
Port 4000 already in use:
# Find process using port 4000
lsof -ti:4000
# Kill the process
kill -9 $(lsof -ti:4000)OpenAI API key error:
- Verify
.envfile exists ineasyread/backend/ - Check that
OPENAI_API_KEYis set correctly - Restart the backend server after updating
.env
Database errors:
- Delete
easyread/backend/easyread.dband restart server (will recreate)
Web app not opening:
- Manually open
http://localhost:8081orhttp://localhost:19006in browser - Or press
wagain in the Expo terminal
Cannot connect to backend:
- Verify backend is running on port 4000
- Check
EXPO_PUBLIC_BACKEND_URL/EXPO_PUBLIC_USE_LOCAL_BACKENDinmobile/.env(seebackendResolution.js) - For physical device, ensure Mac and phone are on same network
Missing dependencies:
cd easyread/mobile
npm install
npx expo install expo-asset expo-linear-gradientAndroid SDK not found:
- Install Android Studio
- Set
ANDROID_HOMEenvironment variable (see Option 3 above)
- Document Import: Upload PDFs, take photos, or paste text
- EasyRead Conversion: Automatically converts documents to EasyRead format
- Chunked Reading: Documents are split into manageable chunks
- Previous Files: View and manage previously processed documents
- Settings: Adjust text size and language (English/Spanish)
- Bilingual Support: Full UI in English and Spanish
GET /documents- List all documentsGET /documents/:docId- Get document detailsGET /documents/:docId/chunks/:i- Get specific chunkPOST /documents- Upload/create documentDELETE /documents- Delete all documentsDELETE /documents/:docId- Delete specific document
- Backend uses SQLite database (
easyread.db) - EasyRead translations are generated using OpenAI GPT-4o
- All EasyRead translations are stored in the database
- Background processing generates EasyRead for all chunks automatically
If you encounter issues:
- Check backend logs in Terminal 1 for errors
- Check mobile app logs in Terminal 2 or browser console
- Verify environment variables are set correctly
- Restart both servers after making changes
- Clear cache if needed:
cd easyread/mobile npx expo start -c
For issues or questions, check:
- Backend terminal for server errors
- Browser console (F12) for web app errors
- Expo terminal for mobile app errors
Happy coding! 🚀