Skip to content

GreatPika/TenderNinja

Repository files navigation

TenderNinja

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

Packages

  • ./ — Frontend (Next.js App Router, TypeScript)
  • backend/ — Backend API (FastAPI, Python)

Tech Stack

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

Getting Started

Prerequisites

  • Node.js v20+
  • pnpm (the repo uses pnpm@10.14.0)
  • Python 3.10+ (for backend/)

Install dependencies

pnpm install

Configure environment variables

Create .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_KEY is server-only. Do not expose it to the browser.

Backend setup

cd backend
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

Run

Frontend only:

pnpm dev

Open http://localhost:3000.

Frontend + backend:

pnpm dev:all

Backend only:

cd backend && make run

The API listens on http://localhost:8001.

API (Backend)

POST /process

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

Common Commands

Frontend:

  • pnpm lint
  • pnpm test
  • pnpm build
  • pnpm dev (run the frontend only)
  • pnpm dev:all (run frontend + backend together)

Backend:

  • cd backend && make test
  • cd backend && make run

Project Structure (Frontend)

  • app/ — Next.js routes.
  • src/modules/ — Feature modules (auth, chat, editor, settings).
  • src/lib/ — Shared libraries and clients.
  • shared_components/ — Reusable UI building blocks.

Project Structure (Backend)

  • 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.

Contributing

See AGENTS.md for architecture notes, conventions, and commands.

Deployment (Frontend + Backend)

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.

Prevent backend-only changes from triggering Vercel deployments

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 to backend/.

Backend deployment quickstart (Docker)

Build and run locally:

docker build -t tenderninja-backend ./backend
docker run --rm -p 8001:8001 --env-file ./backend/.env tenderninja-backend

Then set NEXT_PUBLIC_API_BASE_URL for the frontend to the backend URL (e.g. https://api.your-domain.com).

License

See LICENSE.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors