Cookest
Backend API

Getting Started

Running the Cookest Rust API locally

Getting Started

Prerequisites

ToolMinimum versionInstall
Rust1.78+rustup update stable
PostgreSQL15+postgresql.org
Ollamalatestollama.ai (optional β€” for AI features)
popplerlatestbrew install poppler / apt install poppler-utils (optional β€” for PDF pipeline)

PostgreSQL extensions required:

CREATE EXTENSION IF NOT EXISTS pg_trgm;
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";

Setup

# 1. Enter the api directory
cd api

# 2. Copy environment template
cp .env.example .env
# Edit .env β€” at minimum set DATABASE_URL and JWT_SECRET

# 3. Create the database
createdb cookest

# 4. Start the server (runs migrations automatically)
cargo run
# Server starts on http://0.0.0.0:8080

Build for production

cargo build --release
./target/release/cookest-api

Docker (optional)

FROM rust:1.78-slim as builder
WORKDIR /app
COPY . .
RUN cargo build --release

FROM debian:bookworm-slim
COPY --from=builder /app/target/release/cookest-api /usr/local/bin/
CMD ["cookest-api"]

Verifying the server

curl http://localhost:8080/api/ingredients?q=chicken
# Returns a JSON array of matching ingredients

Development tips

  • Hot reload: Install cargo-watch (cargo install cargo-watch) and run cargo watch -x run
  • Logs: Set RUST_LOG=debug in your .env for verbose output
  • Migrations: Run on every cargo run β€” safe to restart freely

On this page