Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/elecodes/TenderCheck-AI/llms.txt

Use this file to discover all available pages before exploring further.

Self-hosting TenderCheck AI gives you complete control over your data, lets you run the platform under a custom domain, and ensures that tender documents and proposal PDFs never leave your own infrastructure. All you need is a machine capable of running Docker, a Turso database (the free tier is sufficient), and a Google AI Studio API key for Gemini 2.5 Flash.

Prerequisites

Docker Compose Configuration

The repository ships with a docker-compose.yml that defines the backend service and wires it to your local source tree for development use:
services:
  backend:
    build:
      context: ./backend
      dockerfile: Dockerfile
      target: builder
    image: tendercheck-backend-dev
    ports:
      - "3000:3000"
    volumes:
      - ./backend:/app
      - /app/node_modules
    command: npm run dev
    environment:
      - NODE_ENV=development
      - PORT=3000
The backend service builds from backend/Dockerfile using a multi-stage Node.js 20 Alpine image. The volume mount (./backend:/app) enables live code reload during development. For a production deployment, remove the volume mount and set NODE_ENV=production — the container will run the compiled dist/ output instead. The backend/Dockerfile itself uses a two-stage build pattern:
  • Builder stage (node:20-alpine): installs all dependencies, compiles TypeScript, then prunes to production-only packages.
  • Runner stage (node:20-alpine): copies only the compiled dist/, node_modules, and package.json from the builder and runs as the non-root node user.

Environment Variables

Create a backend/.env file with the following variables before running docker-compose up:
VariableRequiredDescriptionExample
TURSO_DB_URLYesTurso database connection URLlibsql://tendercheck-ai.turso.io
TURSO_AUTH_TOKENYesTurso auth token from turso db tokens createeyJh...
GOOGLE_GENAI_API_KEYYesPrimary Gemini API key from Google AI StudioAIzaSy...
GOOGLE_API_KEYYesStandard Google AI key (required by Genkit 1.28.0+)AIzaSy...
JWT_SECRETYesSecret used to sign and verify JWT session tokensa-long-random-string-32-chars+
ALLOWED_ORIGINSYesComma-separated list of allowed CORS originshttp://localhost:3000,https://yourdomain.com
LANGCHAIN_API_KEYNoLangSmith API key for AI observability and tracingls__...
LANGCHAIN_TRACING_V2NoEnable LangSmith tracing (true / false)true
LANGCHAIN_PROJECTNoLangSmith project nameTenderCheckAI
SENTRY_DSNNoSentry DSN for error monitoringhttps://...@sentry.io/...

Build and Run

1

Clone the Repository

git clone https://github.com/elecodes/TenderCheck-AI.git
cd TenderCheck-AI
2

Create the Backend Environment File

cp backend/.env.example backend/.env
Open backend/.env in your editor and fill in all required values (see the table above). At minimum you need TURSO_DB_URL, TURSO_AUTH_TOKEN, GOOGLE_GENAI_API_KEY, GOOGLE_API_KEY, JWT_SECRET, and ALLOWED_ORIGINS.
3

Build and Start the Containers

docker-compose up --build
Docker Compose will:
  1. Build the backend image using backend/Dockerfile.
  2. Mount your local backend/ directory into the container.
  3. Start the Express server with npm run dev.
  4. The backend becomes available at http://localhost:3000 (the compose file maps container port 3000 → host port 3000 and sets PORT=3000 for the Docker development environment).
The database schema initialises automatically on first start — no manual migration is needed.
4

Start the Frontend

The Docker Compose file covers the backend only. Run the frontend separately:
cd frontend
npm install
npm run dev
When running the backend via Docker Compose (port 3000), Vite’s default port 3000 will already be occupied. Set VITE_PORT=3001 or configure server.port in vite.config.ts to use a free port for the frontend, and update ALLOWED_ORIGINS in backend/.env to match.
For a fully containerised production setup, build the frontend static assets (npm run build) and serve the frontend/dist/ directory via Nginx or any static file server alongside the backend container.

Production Hardening

Before exposing TenderCheck AI to the internet, apply the following hardening measures:
  • Set NODE_ENV=production in backend/.env and in the Docker Compose environment block to enable production-mode Express optimisations and stricter error handling.
  • Use a strong JWT_SECRET of at least 32 random characters. Generate one with openssl rand -hex 32.
  • Set ALLOWED_ORIGINS precisely — list only the exact frontend domain (e.g., https://tenders.yourdomain.com). Wildcard or localhost entries must be removed from production configuration.
  • Enable HTTPS via a reverse proxy. Place Nginx or Caddy in front of the backend container and terminate TLS there. Neither the backend nor the frontend serves HTTPS natively.
  • Consider adding a SENTRY_DSN for real-time error monitoring and alerting. The backend integrates @sentry/node with profiling — simply set the DSN environment variable to activate it.
  • Do not commit backend/.env to version control. Use Docker secrets, a secrets manager (e.g., AWS Secrets Manager, HashiCorp Vault), or your CI/CD platform’s environment variable injection for production credentials.
Google AI Studio Free Tier — Data Policy: When GOOGLE_GENAI_API_KEY belongs to a Google Cloud project without a billing account attached, you are on the Free Tier. Under this tier, Google may use your API request data (including the text extracted from your tender and proposal PDFs) to improve their models.If your use case involves confidential procurement documents, attach a billing account to your Google Cloud project to switch to the Pay-as-you-go tier, under which your data is not used for model training. Review pricing details and tier conditions in the Vercel deployment guide and the GCP Billing Console.

Health Check

The backend exposes a /health endpoint that returns a JSON status object and the current server timestamp. Use it to verify the container started correctly and to configure uptime monitors or load-balancer health probes:
curl http://localhost:3000/health
A healthy response looks like:
{
  "status": "OK",
  "timestamp": "2025-01-15T10:30:00.000Z"
}
The repository also includes a root-level Dockerfile for GPU/Ollama on-premise deployments (NVIDIA CUDA + Ubuntu 22.04). That image bundles the full frontend and backend, pre-pulls the Mistral and nomic-embed-text models via Ollama, and uses start.sh as the container entrypoint. It is separate from the backend/Dockerfile used by docker-compose.yml.

Cloud Deployment Alternatives

If you prefer a fully managed cloud deployment instead of self-hosting:
  • Deploy to Vercel → — the recommended path for the frontend and backend as serverless functions, with automatic CI/CD from GitHub.
  • Deploy with Docker on Render → — deploy the backend as a Docker Web Service on Render with Turso as the persistent database layer.

Build docs developers (and LLMs) love