Installation & Setup
Installation & Setup
Section titled “Installation & Setup”This guide is for IT administrators and technical teams responsible for deploying Querri in your organization. It covers installation, configuration, and initial setup.
Prerequisites
Section titled “Prerequisites”Before installing Querri, ensure you have:
- Docker and Docker Compose installed on your host system
- Access to required external services:
- OpenAI API (for AI capabilities)
- WorkOS (for authentication and SSO)
- MongoDB (database)
- Fine-Grained Authorization (FGA) service (for permissions)
- Sufficient system resources (CPU, memory, storage)
- Network access for users who will access Querri
Architecture Overview
Section titled “Architecture Overview”Querri is deployed as a multi-service application using Docker Compose:
Core Services
Section titled “Core Services”Frontend (SvelteKit):
- User interface and client-side application
- Serves the chat interface, dashboards, and all UI components
- Communicates with the backend API
Backend (FastAPI):
- REST API for all data operations
- Handles AI agent orchestration
- Manages data connectors and step execution
- Processes authentication and authorization
Supporting Services:
- MongoDB: Primary database for projects, steps, and metadata
- FGA Service: Fine-grained authorization engine for permissions
- Worker Processes: Background job processing for long-running analyses
Installation Steps
Section titled “Installation Steps”1. Clone or Download Querri
Section titled “1. Clone or Download Querri”Obtain the Querri deployment package and navigate to the deployment directory:
cd /path/to/querri-stack2. Configure Environment Variables
Section titled “2. Configure Environment Variables”Create a .env file in the deployment directory with the required configuration:
# Authentication (WorkOS)WORKOS_API_KEY=your_workos_api_keyWORKOS_CLIENT_ID=your_workos_client_idWORKOS_REDIRECT_URI=https://your-domain.com/auth/callback
# AI ServicesOPENAI_API_KEY=your_openai_api_keyOPENAI_MODEL=gpt-4 # or your preferred model
# DatabaseMONGODB_URI=mongodb://mongodb:27017/querriMONGODB_DATABASE=querri
# Authorization (FGA)FGA_STORE_ID=your_fga_store_idFGA_API_URL=https://api.fga.devFGA_API_TOKEN=your_fga_api_token
# ApplicationAPP_ENV=productionAPP_SECRET_KEY=your_secure_random_secret_keyALLOWED_ORIGINS=https://your-domain.com
# FrontendPUBLIC_API_URL=https://your-domain.com/api
# Optional: Email/NotificationsSMTP_HOST=smtp.example.comSMTP_PORT=587SMTP_USER=your_smtp_userSMTP_PASSWORD=your_smtp_password3. Review Docker Compose Configuration
Section titled “3. Review Docker Compose Configuration”Examine the docker-compose.yml file to understand the service architecture:
services: frontend: # SvelteKit application # Exposed on port 3000
backend: # FastAPI application # Exposed on port 8000
mongodb: # Database service # Data persisted in volumes
fga: # Authorization service # Fine-grained access controlCustomize resource limits, port mappings, or volume mounts as needed for your infrastructure.
4. Deploy with Docker Compose
Section titled “4. Deploy with Docker Compose”Start all services:
docker-compose up -dThis will:
- Pull required Docker images
- Create and start all containers
- Initialize networks and volumes
- Begin health checks
Monitor the deployment:
docker-compose logs -fWait for all services to report healthy status.
5. Initialize the Database
Section titled “5. Initialize the Database”The backend service will automatically run database migrations on first startup. Verify successful migration:
docker-compose exec backend python -m alembic current6. Configure Fine-Grained Authorization
Section titled “6. Configure Fine-Grained Authorization”Initialize the FGA authorization model:
docker-compose exec backend python scripts/init_fga.pyThis creates the permission model for:
- Project access control
- Resource sharing
- User roles and capabilities
7. Verify Service Health
Section titled “7. Verify Service Health”Check that all services are running correctly:
# Check service statusdocker-compose ps
# Verify backend API healthcurl http://localhost:8000/health
# Verify frontend is servingcurl http://localhost:3000/All services should return healthy status codes.
Initial Admin Account Setup
Section titled “Initial Admin Account Setup”Create the First Admin User
Section titled “Create the First Admin User”- Access the Querri application in your browser:
https://your-domain.com - Log in using WorkOS authentication
- The first user to log in will automatically be granted admin privileges
Alternatively, manually promote a user to admin:
docker-compose exec backend python scripts/promote_admin.py user@example.comConfigure Organization Settings
Section titled “Configure Organization Settings”As an admin, configure organization-wide settings:
- Navigate to Settings > Organization
- Set:
- Organization name and branding
- Default permissions for new users
- Data retention policies
- Feature flags (dashboards, automations, etc.)
Post-Installation Configuration
Section titled “Post-Installation Configuration”Set Up Data Connectors
Section titled “Set Up Data Connectors”Configure available data connectors for your users:
- Go to Settings > Data Connectors
- Enable and configure connectors:
- Database connectors (PostgreSQL, MySQL, etc.)
- Cloud storage (S3, Google Cloud Storage)
- API integrations
- File upload settings
Configure User Authentication
Section titled “Configure User Authentication”Set up SSO and user provisioning:
-
In WorkOS dashboard, configure:
- SAML/OIDC providers
- User directory sync
- Just-in-time provisioning
-
Test authentication flows with test users
Set Up Monitoring and Logging
Section titled “Set Up Monitoring and Logging”Configure monitoring for production:
# View aggregated logsdocker-compose logs
# Export logs to external system# Configure in docker-compose.yml logging driversConsider integrating with:
- Application performance monitoring (APM) tools
- Log aggregation services
- Uptime monitoring
- Error tracking (Sentry, etc.)
Backup and Recovery
Section titled “Backup and Recovery”Database Backups
Section titled “Database Backups”Set up automated MongoDB backups:
# Manual backupdocker-compose exec mongodb mongodump --out=/backup
# Restore from backupdocker-compose exec mongodb mongorestore /backupConfigure automated backups with your backup solution or cron jobs.
Configuration Backups
Section titled “Configuration Backups”Regularly backup:
.envfile (store securely)docker-compose.ymland any customizations- FGA authorization model
- SSL certificates and keys
Scaling and Performance
Section titled “Scaling and Performance”Horizontal Scaling
Section titled “Horizontal Scaling”To handle increased load:
-
Scale Backend Workers:
Terminal window docker-compose up -d --scale backend=3 -
Add Load Balancer: Configure a reverse proxy (nginx, Traefik) to distribute traffic
-
Database Replication: Set up MongoDB replica sets for high availability
Performance Tuning
Section titled “Performance Tuning”- Monitor resource usage:
docker stats - Adjust worker processes based on CPU cores
- Configure caching layers (Redis) if needed
- Optimize database indexes for common queries
Security Considerations
Section titled “Security Considerations”Network Security
Section titled “Network Security”- Use HTTPS/TLS for all external connections
- Configure firewall rules to restrict service access
- Use private networks for inter-service communication
- Implement rate limiting on API endpoints
Secrets Management
Section titled “Secrets Management”- Never commit
.envfiles to version control - Use secrets management tools (Vault, AWS Secrets Manager)
- Rotate API keys and credentials regularly
- Use environment-specific configurations
Access Control
Section titled “Access Control”- Enable FGA for all resources
- Review and audit permissions regularly
- Implement least-privilege access
- Monitor authentication logs for anomalies
Troubleshooting
Section titled “Troubleshooting”Common Issues
Section titled “Common Issues”Services Won’t Start:
- Check Docker logs:
docker-compose logs [service] - Verify environment variables are set correctly
- Ensure ports aren’t already in use
Database Connection Errors:
- Verify MongoDB is running:
docker-compose ps mongodb - Check connection string in
.env - Ensure network connectivity between services
Authentication Failures:
- Verify WorkOS configuration
- Check redirect URIs match exactly
- Review WorkOS dashboard for error logs
FGA Permission Errors:
- Reinitialize FGA model:
python scripts/init_fga.py - Verify FGA service is reachable
- Check FGA store ID and credentials
Getting Help
Section titled “Getting Help”For deployment issues:
- Review Docker Compose logs
- Check service health endpoints
- Consult the full documentation
- Contact Querri support with log files and configuration details
Next Steps
Section titled “Next Steps”After successful installation:
- Share the Querri URL with your users
- Provide access to the Quick Start Guide
- Set up user training sessions
- Monitor usage and performance
- Plan for regular maintenance and updates
Your Querri instance is now ready for use! Users can begin analyzing data immediately.