-
Notifications
You must be signed in to change notification settings - Fork 30
Install and Configuration
Mohammed Fathy edited this page Sep 20, 2025
·
1 revision
This guide walks you through installing CrystalLens for the first time and creating your initial system administrator account.
- Python 3.10+
- Git
- (Optional) Ollama if using local LLM: https://ollama.com
- (Optional) Apify account + token for scraping: https://apify.com
- (Optional) Google API key if using Gemini
git clone https://github.com/SecFathy/CrystalLens.git
cd CrystalLenspython3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtCopy the sample env file and edit as needed.
cp .env.example .envKey variables in .env:
-
DATABASE_URL(optional for dev; SQLite is fine) -
SECRET_KEY(set to a strong random value in production) -
APIFY_API_TOKEN(required for scraping) -
OLLAMA_API_URL,OLLAMA_MODEL(for local LLM) -
GOOGLE_API_KEY(for Gemini) -
ANALYSIS_PROVIDER(ollamaorgemini— can also be set in Settings)
You can seed an admin via interactive prompts or via environment variables.
Interactive (prompts for username, email, password):
python scripts/seed_admin.pyNon‑interactive (environment variables):
export ADMIN_USERNAME="admin"
export ADMIN_EMAIL="admin@example.com"
export ADMIN_PASSWORD="change-this-strong-password"
python scripts/seed_admin.py
# Unset after seeding if desired
unset ADMIN_USERNAME ADMIN_EMAIL ADMIN_PASSWORDThe admin will be created with role system_admin.
python run.py
# Open http://127.0.0.1:5000 in your browser- Log in with the admin account you just created.
- Go to
Settings(navbar) →Analysis Settings.- Choose Provider:
Ollama(local) orGemini(cloud). - If Gemini: enter
GOOGLE_API_KEYand click "Test Gemini". - Optionally set Single vs. Staged mode, assessment dimensions, and per‑section overrides.
- Choose Provider:
- Add Employees → Add Social Accounts (Twitter/Facebook profile URLs)
- Start Scraping from the Employee page
- After scraping completes, Start AI Analysis
- If login fails or redirects back to login: ensure admin exists (rerun seed script).
- If scraping fails: verify
APIFY_API_TOKENand Apify actor availability. - If Ollama analysis fails: ensure
ollama serveis running and the model is pulled (check/api/tags). - If Gemini analysis fails: ensure
GOOGLE_API_KEYis correct and Provider is set toGeminiin Settings. - Check
System(navbar) → System Status for quick diagnostics.
- Use PostgreSQL with a strong
DATABASE_URLand TLS via reverse proxy. - Set a strong
SECRET_KEYand secure cookie/session settings. - Keep
.envand secrets out of version control (already.gitignored). - Restrict admin access and review
AuditLogregularly.
- See the README for roadmap, architecture, and provider notes.
- Open issues or PRs with improvements.