Corporate Truth Terminal is a market intelligence app that analyzes public company signals from jobs, reviews, pricing pages, news, and stored watchlist history. It produces truth scores, predictive intelligence, competitor battle maps, sentinel risk alerts, and natural-language answers over monitored companies.
The application lives in truth-terminal/.
- Frontend: Next.js 14, React, TypeScript, Tailwind CSS, Framer Motion
- Backend: FastAPI, SQLite, Anthropic Claude, Bright Data, Resend
- Deployment: Vercel frontend, Railway backend
truth-terminal/
├── backend/ # FastAPI API service
├── frontend/ # Next.js app
├── README.md
└── start.sh # Local dev helper
- Company analysis from a single domain input
- Watchlist monitoring with alerts
- Competitor Battle Map
- Natural-language agent queries over stored intelligence
- Sentinel Mode collapse-pattern warning system
- Predictive intelligence cards
- Railway-ready backend health checks and CORS
cd truth-terminal/backend
cp .env.example .env
pip install -r requirements.txt
PORT=8000 uvicorn main:app --reload --host 0.0.0.0 --port "$PORT"The backend will expose:
GET /
GET /health
POST /analyze
POST /battle-map
POST /query
GET /query/history
POST /watchlist
GET /watchlist
DELETE /watchlist/{company}
GET /predictions/{domain}
GET /sentinel/{domain}
cd truth-terminal/frontend
cp .env.example .env.local
npm install
npm run devSet the frontend API URL in frontend/.env.local:
NEXT_PUBLIC_API_URL=http://localhost:8000Open the local URL printed by Next.js.
ANTHROPIC_API_KEY=your_anthropic_key_here
BRIGHTDATA_API_TOKEN=your_brightdata_token_here
BRIGHTDATA_API_KEY=your_brightdata_key_here
BRIGHTDATA_ZONE=your_brightdata_zone_here
BRIGHTDATA_SERP_ZONE=your_brightdata_serp_zone_here
RESEND_API_KEY=your_resend_key_here
COGNEE_API_KEY=your_cognee_key_here
FRONTEND_URL=https://your-vercel-domain.vercel.app
CORS_ORIGINS=http://localhost:3000,https://your-vercel-domain.vercel.app
DATABASE_PATH=/data/truth_terminal.db
PORT=3000Notes:
ANTHROPIC_API_KEYis required for synthesis, battle maps, sentinel mode, and agent queries.BRIGHTDATA_API_TOKENorBRIGHTDATA_API_KEYis required for scraping.RESEND_API_KEYis only required for email alerts.DATABASE_PATH=/data/truth_terminal.dbis recommended on Railway with a mounted volume.
Use these Railway settings:
Root Directory: truth-terminal/backend
Build Command: pip install -r requirements.txt
Start Command: uvicorn main:app --host 0.0.0.0 --port $PORT
Health Check Path: /health
The backend includes:
railway.jsonProcfileruntime.txt
After Railway deploys, copy the Railway public URL.
Set this environment variable in Vercel:
NEXT_PUBLIC_API_URL=https://your-railway-backend-domain.up.railway.appSet these environment variables in Railway so the deployed Vercel frontend can call the API:
FRONTEND_URL=https://your-vercel-domain.vercel.app
CORS_ORIGINS=http://localhost:3000,https://your-vercel-domain.vercel.appThe CORS origin should not include a trailing slash.
From truth-terminal/:
./start.shOptional ports:
PORT=8000 FRONTEND_PORT=3000 ./start.shBackend:
curl http://localhost:8000/
curl http://localhost:8000/healthExpected health response:
{"status":"healthy"}Frontend:
cd truth-terminal/frontend
npm run buildThe app uses SQLite. For production on Railway, attach a volume and set:
DATABASE_PATH=/data/truth_terminal.dbWithout a persistent volume, watchlist entries and analysis history may be lost across deploys or container restarts.
Do not commit:
backend/.envfrontend/.env.localfrontend/.next/frontend/node_modules/backend/truth_terminal.db