solix-backend

Solix backend

FastAPI + MongoDB API for the Solix Technologies site (frontend/ there). Deployed separately because GitHub Pages only serves static files — it cannot run this service.

What works without extra setup

Once deployed with a database and the four required secrets below, everything works except two optional Emergent-platform integrations:

Everything else — lead capture forms, the admin dashboard (/admin, login ADMIN_EMAIL/ADMIN_PASSWORD), newsroom, press-release PDF downloads — works fully with just MongoDB configured.

Lead intelligence, content publishing and caching

Sol, the AI concierge

Sol answers visitors in the site’s chat widget on free-tier models.

Set at least one key (Groq alone is enough):

Provider Env var Default models (override with)
Groq GROQ_API_KEY openai/gpt-oss-120b,openai/gpt-oss-20b (SOL_GROQ_MODELS)
Google Gemini GEMINI_API_KEY gemini-2.5-flash,gemini-2.5-flash-lite (SOL_GEMINI_MODELS)
Mistral MISTRAL_API_KEY mistral-small-latest (SOL_MISTRAL_MODELS)
OpenRouter OPENROUTER_API_KEY CHAT_MODELS (or SOL_OPENROUTER_MODELS)
OpenAI (paid) OPENAI_API_KEY OPENAI_MODEL (default gpt-4o-mini)
Any OpenAI-compatible server SOL_CUSTOM_BASE_URL, SOL_CUSTOM_API_KEY, SOL_CUSTOM_MODELS —

SOL_PROVIDER_ORDER (default gemini,groq,mistral,openrouter,openai,custom) sets the order among the providers that have keys. With Groq only, free limits (per model: 30 requests/min, 1,000/day, 8K tokens/min, 200K tokens/day) cover roughly 100+ visitor messages a day. Free tiers may use prompts to improve their models; switch to a paid key (same variables) before handling sensitive customer data.

Deploy (Render, free tier)

  1. Database: create a free cluster at https://www.mongodb.com/cloud/atlas, add a database user, allow network access from anywhere (0.0.0.0/0), and copy the connection string.
  2. In the Render dashboard, New > Blueprint, point it at this repo — render.yaml defines the service.
  3. When prompted, fill in the secrets Render marks as required:
    • MONGO_URL — the Atlas connection string from step 1
    • ADMIN_EMAIL / ADMIN_PASSWORD — your admin login for /admin
    • (JWT_SECRET is generated for you; DB_NAME and CORS_ORIGINS default to sensible values — edit render.yaml if you need different ones)
  4. Deploy. Render gives you a URL like https://solix-backend.onrender.com.
  5. In the Website repo, add that URL as a repository variable named BACKEND_URL (Settings → Secrets and variables → Actions → Variables), then re-run the “Deploy frontend to GitHub Pages” workflow so the frontend build picks it up.

Any other Python host (Railway, Fly.io, a VM) works too — the Dockerfile here builds and runs the same service; just set the same environment variables (see .env.example).

Local development

cp .env.example .env   # fill in MONGO_URL, JWT_SECRET, ADMIN_EMAIL, ADMIN_PASSWORD
pip install -r requirements.txt
uvicorn server:app --reload

Content management, migration and gated asset emails