TenderNinja is a monorepo containing:
- a Next.js 16 web application (repo root)
- a FastAPI backend service (in
backend/) for processing tender documents via LLMs
./— Frontend (Next.js App Router, TypeScript)backend/— Backend API (FastAPI, Python)
Frontend:
- Next.js 16, React 19, TypeScript
- Tailwind CSS v4, HeroUI
- Supabase (auth/data access)
- Vitest + React Testing Library
Backend:
- Python 3.10+, FastAPI, Uvicorn
- Anthropic (Claude) integration
- Supabase integration
- Pytest
- Node.js v20+
- pnpm (the repo uses
pnpm@10.14.0) - Python 3.10+ (for
backend/)
pnpm installCreate .env.local in the repo root:
# Frontend
NEXT_PUBLIC_API_BASE_URL=http://127.0.0.1:8001
NEXT_PUBLIC_SUPABASE_URL=...
NEXT_PUBLIC_SUPABASE_ANON_KEY=...
# Server-only (used by Next.js server components / route handlers)
SUPABASE_SERVICE_ROLE_KEY=...Create backend/.env (or export env vars) for the backend:
ANTHROPIC_API_KEY=...
NEXT_PUBLIC_SUPABASE_URL=...
NEXT_PUBLIC_SUPABASE_ANON_KEY=...
SUPABASE_SERVICE_ROLE_KEY=...Note:
SUPABASE_SERVICE_ROLE_KEYis server-only. Do not expose it to the browser.
cd backend
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txtFrontend only:
pnpm devOpen http://localhost:3000.
Frontend + backend:
pnpm dev:allBackend only:
cd backend && make runThe API listens on http://localhost:8001.
Initiates the text processing pipeline.
-
Headers:
Authorization: Bearer token (Supabase JWT)Content-Type:application/json
-
Body:
{ "text": "Full text of the tender document to be processed..." } -
Response: Server-Sent Events (SSE) stream
- Events:
status,numbered_sentences,result,error - Data: JSON payload per event
- Events:
Frontend:
pnpm lintpnpm testpnpm buildpnpm dev(run the frontend only)pnpm dev:all(run frontend + backend together)
Backend:
cd backend && make testcd backend && make run
app/— Next.js routes.src/modules/— Feature modules (auth, chat, editor, settings).src/lib/— Shared libraries and clients.shared_components/— Reusable UI building blocks.
backend/app/— Main application code.core/— Core settings, logging, and exceptions.routers/— API route handlers (process.py,health.py).services/— Business logic and text processing pipeline.integrations/— External service clients (Anthropic, Supabase).models/— Pydantic data models.
backend/tests/— Test suite.
See AGENTS.md for architecture notes, conventions, and commands.
This repository is a monorepo, but the services are meant to deploy independently:
- Frontend: deploy on Vercel from the repo root (
./). - Backend: deploy anywhere that can run a Docker container (Render/Fly.io/Railway/VM, etc.), using
backend/Dockerfile.
The repo includes vercel.json with an ignoreCommand that skips Vercel builds when only backend/** (or other non-frontend) files changed. See scripts/vercel-ignore-frontend.sh.
Note: if you have multiple Vercel projects connected to the same repo, make sure only the frontend project exists (root directory
./). Do not create a Vercel project that points tobackend/.
Build and run locally:
docker build -t tenderninja-backend ./backend
docker run --rm -p 8001:8001 --env-file ./backend/.env tenderninja-backendThen set NEXT_PUBLIC_API_BASE_URL for the frontend to the backend URL (e.g. https://api.your-domain.com).
See LICENSE.