Given a user query, the app conducts a web search, downloads the top N resulting web pages, then analyzes those pages with an LLM.
The LLM can be any smaller, consumer-grade with at least 5k context window (assuming each web page ~1k tokens).
To take advantage of the configured build steps, our recommended tools are:
- run
justin the terminal to see available recipes. We support recipes to launch the app in dev, staging and production modes.- dev: run app as two processes on localhost
- both processes can be exited with
Ctrl-Cin the terminal
- both processes can be exited with
- staging: run app inside a docker container as a single http service, fronted by
nginx- the single http service
docker runs in the foreground,Ctrl-Cto stop container
- the single http service
- production: a variant of staging with diff env vars
- the single http service will respond to platform-specific terminate/kill signals
- generally the platforms will rotate in a new container instance when you deploy a new version and directing traffic there when the container is ready/healthy.
- dev: run app as two processes on localhost
- required: pre-fill
.env.*files prior to starting app instances- e.g. if testing in staging, fill out
frontend/.env.stagingthenjust build-image-staging && just runto take your app into the container and launch the server onhttp://localhost:30000
- e.g. if testing in staging, fill out
Refer to the justfile for step by step recipes. The following describes the requirements if you choose to re-implement in a different environment.
-
cd backend cp .env.example .env -
In
backend/.env, fill inGOOGLE_SEARCH_API_KEYandGOOGLE_SEARCH_ENGINE_IDcredentials from Google Custom Search API. -
Fill in
GROQ_API_KEYcredentials from Groq. -
Setup virtual environment, packages, and deploy the server
uv venv . .venv/bin/activate uv pip install -r requirements.txt python app.pyThis is fine for dev testing.
-
Wherever you run this backend, you need to define env var
DOMAINS_ALLOWto match the frontend domain the browser sees.For production, check
docker/for example containerized/cloud process management scripts.You may choose to do add-on engineering with
supervisord,nginxor a variety of modifications.Furthermore, in production environments you should set the secrets according the platform best practices, you should expect a secrets get/set API or CLI, e.g. in our Fly.io example you would use
fly secrets set|unsetprior to deploying your app.
The React app can be compiled into a static site you can serve with nginx, npx serve or your choice of framework.
-
cd frontend -
Update
REACT_APP_API_URLinconstants.jsto point to your server -
Install Bun TL;DR:
curl -fsSL https://bun.com/install | bash, or usenpx bunif you already havenpxbun install bun run build:dev bun run build:staging bun run build:prodThere are justfile recipes for all of the above.
-
In dev testing, to start the server:
just frontend-dev PORT=30000 bun start ./build-[dev|staging|prod] -
In staging the docker app on your host, to start the server:
Fill in values in
frontend/.env.staging. Refer to the justfile recipes for implementation details.just run
git add -uyour modified files and runpre-committo performrufflint/format checks
- Clarify the pre-existing Cloudfront deployment strategy for the frontend
- Create
./deployment/cloudflareexample for Cloudflare Containers