This guide provides complete instructions for running the Document-Analyzer-Operator Platform without Docker.
- Prerequisites
- Quick Start
- Detailed Setup
- Platform-Specific Instructions
- Production Deployment
- Troubleshooting
| Software | Version | Purpose |
|---|---|---|
| Python | 3.11+ | Backend runtime |
| Node.js | 18+ | Frontend runtime |
| PostgreSQL | 16+ | Database |
| Redis | 7+ | Cache and sessions |
| Git | Latest | Version control |
| Software | Purpose |
|---|---|
| Qdrant | Vector database for embeddings |
| Neo4j | Graph database for knowledge |
| Temporal | Workflow orchestration |
| MinIO | S3-compatible file storage |
| PM2 | Process manager for production |
# 1. Install prerequisites
cd scripts
.\install_prerequisites.bat
# 2. Setup the application
cd ..
.\setup.bat
# 3. Start all services
.\start.bat
# Access services:
# - Frontend: http://localhost:3000
# - Backend API: http://localhost:8000/docs# 1. Install prerequisites
cd scripts
chmod +x install_prerequisites.sh
./install_prerequisites.sh
# 2. Setup the application
cd ..
chmod +x setup.sh
./setup.sh
# 3. Start all services
./start.sh
# Access services:
# - Frontend: http://localhost:3000
# - Backend API: http://localhost:8000/docs# 1. Install prerequisites
cd scripts
chmod +x install_prerequisites.sh
sudo ./install_prerequisites.sh
# 2. Setup the application
cd ..
chmod +x setup.sh
./setup.sh
# 3. Start all services
./start.sh
# Access services:
# - Frontend: http://localhost:3000
# - Backend API: http://localhost:8000/docs# Install Python
choco install python --version=3.11
# Install Node.js
choco install nodejs-lts
# Install PostgreSQL
choco install postgresql16
# Install Redis
choco install redis-64
# Install Poetry (Python package manager)
(Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | python -
# Restart terminal after installation# Install Homebrew if not installed
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Install Python
brew install python@3.11
# Install Node.js
brew install node@18
# Install PostgreSQL
brew install postgresql@16
# Install Redis
brew install redis
# Install Poetry
curl -sSL https://install.python-poetry.org | python3 -
# Start services
brew services start postgresql@16
brew services start redis# Update system
sudo apt update && sudo apt upgrade -y
# Install Python and dependencies
sudo apt install -y python3.11 python3.11-venv python3-pip postgresql postgresql-contrib redis-server git curl
# Install Node.js
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt install -y nodejs
# Install Poetry
curl -sSL https://install.python-poetry.org | python3 -
# Start services
sudo systemctl start postgresql
sudo systemctl start redis
sudo systemctl enable postgresql
sudo systemctl enable redis# Login to PostgreSQL
psql -U postgres
# Create database and user
CREATE DATABASE document_analyzer;
CREATE USER document_user WITH PASSWORD 'your_secure_password';
GRANT ALL PRIVILEGES ON DATABASE document_analyzer TO document_user;
\q
# Or use the automated script
cd backend/scripts
./setup_database.sh# Check if Redis is running
redis-cli ping
# Should return: PONG
# If not running, start it:
# Linux
sudo systemctl start redis
# macOS
brew services start redis
# Windows (if installed as service)
net start Rediscd backend
# Copy environment file
cp .env.example .env
# Edit .env and set:
# - DATABASE_URL=postgresql://document_user:your_password@localhost:5432/document_analyzer
# - REDIS_URL=redis://localhost:6379
# - SECRET_KEY=<generate with: openssl rand -hex 32>
# - ENCRYPTION_KEY=<generate with: python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())">
# Install dependencies
poetry install
# Run database migrations
poetry run alembic upgrade head
# Test the setup
poetry run uvicorn app.main:app --reloadcd frontend
# Copy environment file
cp .env.example .env.local
# Edit .env.local and set:
# - NEXT_PUBLIC_API_URL=http://localhost:8000
# - NEXT_PUBLIC_WS_URL=ws://localhost:8000
# Install dependencies
npm install
# Start development server
npm run dev# Check backend health
curl http://localhost:8000/api/v1/health
# Check frontend
curl http://localhost:3000
# Both should return valid responsesUse PM2 to run as background services:
# Install PM2
npm install -g pm2
# Start backend
cd backend
pm2 start ecosystem.config.js --only backend
# Start frontend
cd frontend
pm2 start ecosystem.config.js --only frontend
# Save PM2 configuration
pm2 save
# Setup PM2 to start on Windows boot
pm2 startupCreate scheduled tasks to start services on boot:
# Create backend task
$action = New-ScheduledTaskAction -Execute "C:\Path\to\backend\run_native.bat"
$trigger = New-ScheduledTaskTrigger -AtStartup
Register-ScheduledTask -TaskName "DocumentAnalyzer-Backend" -Action $action -Trigger $trigger -RunLevel Highest
# Create frontend task
$action = New-ScheduledTaskAction -Execute "C:\Path\to\frontend\run_native.bat"
$trigger = New-ScheduledTaskTrigger -AtStartup
Register-ScheduledTask -TaskName "DocumentAnalyzer-Frontend" -Action $action -Trigger $trigger -RunLevel HighestCreate plist files for launchd:
# Backend service
cat > ~/Library/LaunchAgents/com.documentanalyzer.backend.plist << EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.documentanalyzer.backend</string>
<key>ProgramArguments</key>
<array>
<string>/path/to/backend/run_native.sh</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
</dict>
</plist>
EOF
# Load and start
launchctl load ~/Library/LaunchAgents/com.documentanalyzer.backend.plist
launchctl start com.documentanalyzer.backend# Copy service files
sudo cp scripts/systemd/*.service /etc/systemd/system/
# Reload systemd
sudo systemctl daemon-reload
# Enable services to start on boot
sudo systemctl enable document-analyzer-backend
sudo systemctl enable document-analyzer-frontend
# Start services
sudo systemctl start document-analyzer-backend
sudo systemctl start document-analyzer-frontend
# Check status
sudo systemctl status document-analyzer-backend
sudo systemctl status document-analyzer-frontend
# View logs
sudo journalctl -u document-analyzer-backend -f# Install PM2 globally
npm install -g pm2
# Setup backend
cd backend
pm2 start ecosystem.config.js
pm2 save
# Setup frontend
cd frontend
pm2 start ecosystem.config.js
pm2 save
# Setup PM2 startup
pm2 startup
pm2 savePM2 Commands:
# View status
pm2 status
# View logs
pm2 logs
# Restart services
pm2 restart all
# Stop services
pm2 stop all
# Monitor
pm2 monit# Services are already configured in scripts/systemd/
sudo cp scripts/systemd/*.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable document-analyzer-backend document-analyzer-frontend
sudo systemctl start document-analyzer-backend document-analyzer-frontend# Install supervisor
sudo apt install supervisor
# Create config
cat > /etc/supervisor/conf.d/document-analyzer.conf << EOF
[program:document-analyzer-backend]
command=/path/to/backend/run_native.sh
directory=/path/to/backend
autostart=true
autorestart=true
stderr_logfile=/var/log/document-analyzer/backend.err.log
stdout_logfile=/var/log/document-analyzer/backend.out.log
[program:document-analyzer-frontend]
command=/path/to/frontend/run_native.sh
directory=/path/to/frontend
autostart=true
autorestart=true
stderr_logfile=/var/log/document-analyzer/frontend.err.log
stdout_logfile=/var/log/document-analyzer/frontend.out.log
EOF
# Start services
sudo supervisorctl reread
sudo supervisorctl update
sudo supervisorctl start allProblem: Cannot connect to PostgreSQL
Solution:
# Check if PostgreSQL is running
# Linux
sudo systemctl status postgresql
# macOS
brew services list
# Windows
Get-Service postgresql*
# Start if not running
sudo systemctl start postgresql # Linux
brew services start postgresql # macOS
# Check connection
psql -U document_user -d document_analyzer -h localhostProblem: Cannot connect to Redis
Solution:
# Check if Redis is running
redis-cli ping
# Should return PONG
# Start Redis
sudo systemctl start redis # Linux
brew services start redis # macOS
net start Redis # WindowsProblem: Port 8000 or 3000 already in use
Solution:
# Find process using port
# Linux/macOS
lsof -i :8000
lsof -i :3000
# Windows
netstat -ano | findstr :8000
netstat -ano | findstr :3000
# Kill process
kill -9 <PID>
# Or change port in .env filesProblem: ModuleNotFoundError
Solution:
cd backend
poetry install
poetry run python -m pip install --upgrade pipProblem: Incompatible Node.js version
Solution:
# Check version
node --version
# Should be 18+
# Update if needed
# Windows: choco upgrade nodejs-lts
# macOS: brew upgrade node
# Linux: curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash - && sudo apt install -y nodejsProblem: Cannot execute shell scripts
Solution:
# Make scripts executable
chmod +x setup.sh start.sh stop.sh
chmod +x backend/*.sh
chmod +x frontend/*.sh
chmod +x scripts/*.sh# Check all services
cd backend/scripts
./health_check.sh
# Check backend API
curl http://localhost:8000/api/v1/health
# Expected response: {"status":"ok","timestamp":"..."}
# Check frontend
curl http://localhost:3000
# Should return HTML# Backend logs
tail -f backend/logs/app.log
# Frontend logs
tail -f frontend/logs/*.log
# PM2 logs
pm2 logs
# Systemd logs (Linux)
journalctl -u document-analyzer-backend -f
journalctl -u document-analyzer-frontend -fcd backend
# Check migration status
poetry run alembic current
# Upgrade to latest
poetry run alembic upgrade head
# If errors, reset and reapply
poetry run alembic downgrade base
poetry run alembic upgrade headEdit postgresql.conf:
shared_buffers = 256MB
effective_cache_size = 1GB
maintenance_work_mem = 64MB
max_connections = 100
Edit redis.conf:
maxmemory 512mb
maxmemory-policy allkeys-lru
appendonly yes
In .env:
# Enable production mode
APP_ENV=production
APP_DEBUG=false
# Optimize workers
UVICORN_WORKERS=4Build for production:
cd frontend
npm run build
npm run start# Linux (ufw)
sudo ufw allow 5432/tcp # PostgreSQL
sudo ufw allow 6379/tcp # Redis
sudo ufw allow 8000/tcp # Backend API
sudo ufw allow 3000/tcp # Frontend
sudo ufw enableUse nginx or Apache as reverse proxy with Let's Encrypt:
# Install nginx
sudo apt install nginx
# Configure SSL
sudo certbot --nginx -d yourdomain.com# Set secure permissions on .env files
chmod 600 backend/.env
chmod 600 frontend/.env.local
# Never commit .env files
# Add to .gitignore# PM2 monitoring
pm2 monit
# System resources
htop
# Database monitoring
psql -U document_user -d document_analyzer -c "SELECT * FROM pg_stat_activity;"# Install lnav for log navigation
sudo apt install lnav
# View all logs
lnav backend/logs/*.log frontend/logs/*.log- Main Documentation: docs/README.md
- Docker Setup: README.md (Docker section)
- LLM Provider Setup: LLM_SETUP_GUIDE.md
- API Documentation: http://localhost:8000/docs
Version: 1.0.0
Last Updated: 2026-03-13
Status: Production Ready