Prerequisites
Before installing Screen Answerer, ensure you have the following:Node.js
Version 14.x or higherDownload Node.js
npm
Included with Node.jsVerify:
npm --versionGoogle Gemini API Key
Free tier availableGet API key
Modern browser
Chrome or Firefox recommendedFor screen capture support
Installation steps
Install dependencies
Install all required npm packages:This will install:
express- Web server framework@google/generative-ai- Google Gemini API clientcors- Cross-origin resource sharinghelmet- Security middlewaremulter- File upload handlingdotenv- Environment variable managementexpress-rate-limit- API rate limitingmarked- Markdown parsing
Installation typically takes 1-2 minutes depending on your internet connection.
Configure environment (optional)
While Screen Answerer can run without environment variables (API keys are configured through the UI), you can optionally create a
.env file:.env
Project structure
Understanding the codebase structure:Key files
server.js The main server file containing:- Express app configuration (server.js:10-13)
- Security middleware setup (server.js:14-43)
- API endpoints for question processing (server.js:274-474)
- Screen monitoring endpoint (server.js:319-386)
- Rate limiting logic (server.js:86-122)
- Tracks files being processed (history.js:6-10)
- Safely deletes temporary files (history.js:52-84)
- Cleans up stale entries (history.js:87-100)
- Settings modal with API key configuration
- Screen monitoring controls
- Theme switcher (dark/light mode)
- Model selection slider
- Real-time answer display
Configuration options
Server configuration
Modify these settings inserver.js:
server.js
Rate limiting
Adjust rate limits inserver.js:46-101:
server.js
File upload limits
Configure upload settings inserver.js:76-80:
server.js
Monitoring interval
Adjust screen capture frequency inpublic/index.html:994:
index.html
Security considerations
Screen Answerer includes several security features:Helmet.js
Content Security Policy headers to prevent XSS attacksConfigured in server.js:18-29
CORS
Cross-origin resource sharing controlsConfigured in server.js:30-34
Rate limiting
Global and per-IP rate limits100 requests per 15 minutes
File validation
Image-only uploads with size limitsMax 5MB per file
Content Security Policy
The application enforces strict CSP headers:server.js
Supported browsers
Screen Answerer works best with modern browsers:| Browser | Screen Monitoring | File Upload | Notes |
|---|---|---|---|
| Chrome | ✅ Excellent | ✅ Yes | Recommended |
| Firefox | ✅ Excellent | ✅ Yes | Recommended |
| Edge | ⚠️ Good | ✅ Yes | Some limitations |
| Safari | ⚠️ Limited | ✅ Yes | Screen capture may not work |
Running in production
For production deployments:Troubleshooting installation
npm install fails
npm install fails
Common causes:
- Outdated Node.js version
- Network connectivity issues
- Permission errors
Port already in use
Port already in use
Error: The server will automatically try the next port, but you may want to specify one manually.
EADDRINUSE: address already in use :::3000Solutions:Module not found errors
Module not found errors
Error:
Cannot find module '@google/generative-ai'Solutions:Permission denied errors
Permission denied errors
Error:
EACCES: permission deniedSolutions:Updating Screen Answerer
To update to the latest version:Next steps
Quick start
Configure your API key and answer your first question
Configuration
Explore advanced configuration options