To use the full OCR functionality with real API services, you need to set up the following environment variables:
- Go to LlamaIndex Cloud to get your API key
- Used for document parsing and text extraction
- Go to Groq Console to get your API key
- Used for text summarization
- Used to configure the connection to the Flask OCR backend
- Defaults to
http://localhost:5000if not set
-
Copy the example environment file:
cp .env.example .env.local
-
Edit the
.env.localfile and add your actual API keys:LLAMAPARSE_API_KEY=your_actual_llamaparse_key_here GROQ_API_KEY=your_actual_groq_key_here FLASK_BACKEND_URL=http://localhost:5000
Set the environment variables directly in your production environment:
export LLAMAPARSE_API_KEY=your_actual_llamaparse_key_here
export GROQ_API_KEY=your_actual_groq_key_here
export FLASK_BACKEND_URL=https://your-flask-backend-url.comnpm run devThe frontend will run on http://localhost:3000 or http://localhost:3001 if port 3000 is occupied.
cd flask-backend
python app.pyThe backend will run on http://localhost:5000.
- Never commit your actual API keys to version control
- The
.envand.env.localfiles are included in.gitignoreto prevent accidental commits - Always use environment variables for sensitive information
- The application includes fallback mechanisms that use mock data when API keys are not available
- Start both the frontend and backend servers
- Navigate to the upload page in your browser
- Upload a document file (PDF, TXT, DOCX, PNG, JPG)
- The file will be processed and the extracted text will appear in the OCR preview section