This is the refactored monorepo structure for UILensAI, eliminating code duplication and providing a clean separation of concerns.
packages/
├── core/ # Shared analysis logic and utilities
├── cli/ # Command Line Interface
├── api/ # Vercel API service
└── worker/ # Fly.io worker service
The core package contains all shared analysis modules and utilities:
- analyze/: All analysis modules (UI, performance, security, etc.)
- capture/: Screenshot capture functionality
- report/: Report generation
- storage/: File storage utilities
- utils/: Shared utility functions
- config/: Configuration files
- schemas/: JSON schemas
The command-line interface package:
- Imports from
@uilensai/core - Your reliable CLI that has been working well
- No changes to functionality, just cleaner imports
The Vercel API service package:
- API-specific middleware and services
- MCP integration
- WebEvo integration
- Authentication and rate limiting
The Fly.io worker service package:
- Background job processing
- Worker-specific services
- Dockerfile and deployment configuration
From the root directory:
# Run CLI
npm run cli -- --url https://example.com
# Start API development server
npm run api:dev
# Start worker
npm run worker:start
# Install all dependencies
npm run install:all- No Code Duplication: Single source of truth for all analysis logic
- Clean Separation: Environment-specific code is properly isolated
- Easy Maintenance: Bug fixes only need to be applied once
- Consistent Versioning: All packages share the same core logic
- Better Testing: Shared code can be tested independently
- The original
src/andfly-worker/directories have been moved tobackup/ - All shared analysis code is now in
packages/core/ - Import paths have been updated to use
@uilensai/core - Lazy loading prevents initialization issues with AI clients
| Variable | Description |
|---|---|
OPENROUTER_API_KEY |
API key for OpenRouter (all AI calls route through OpenRouter) |
| Variable | Description |
|---|---|
INNGEST_EVENT_KEY |
Inngest Cloud event key — enables durable scan pipeline with retry and observability. If not set, scans execute directly (legacy path). |
INNGEST_SIGNING_KEY |
Inngest Cloud signing key — for webhook signature verification. |
NEON_DATABASE_URL |
Neon PostgreSQL connection string — enables persistent scan result storage. If not set, results are returned in-memory only. |
See packages/worker/.env.example for a template.