freshcrate
Home > Frameworks > ai-project-template

ai-project-template

Starter app for building AI SaaS (RAG, Agentic workflow) applications

Description

Starter app for building AI SaaS (RAG, Agentic workflow) applications

README

MLExpert AI App Starter

Monorepo boilerplate for AI SaaS apps. See PRD.md for the full spec and TODO.md for progress.

Prerequisites

  • uv (installs Python 3.12 automatically)
  • Node.js 20+ and npm
  • Git

Install

# Backend deps (creates .venv and installs dev group)
uv sync --project backend

# Frontend deps
npm --prefix frontend install

# Install git hooks (one-time)
uv run --project backend pre-commit install

Run

Backend

uv run --project backend uvicorn app.main:app --reload --app-dir backend

Runs at http://localhost:8000.

Backend API

Method Endpoint Description
GET /healthz Liveness check
POST /api/v1/documents Upload a .txt, .md, or .pdf (≤ 5 MB)
GET /api/v1/documents List uploaded documents (metadata only)
DELETE /api/v1/documents/{id} Remove a document
POST /api/v1/threads Create a thread (optionally attach documents)
GET /api/v1/threads List threads
GET /api/v1/threads/{id} Get thread with messages
DELETE /api/v1/threads/{id} Delete a thread
POST /api/v1/chat/stream Stream chat response (Vercel AI SDK data-stream format)

See client.py for a CLI tool to upload, list, and delete documents:

uv run --project backend python client.py upload file.txt
uv run --project backend python client.py list
uv run --project backend python client.py delete <doc-id>

Frontend

npm --prefix frontend run dev

Visit http://localhost:3000.

Test & lint

Run every check (FE + BE)

uv run --project backend pre-commit run --all-files && npm --prefix frontend run typecheck

This covers: YAML/JSON validation, ruff check + ruff format, ESLint, backend pytest, and frontend TypeScript typecheck (tsc isn't in pre-commit because it's too slow to run on every commit).

Individual checks

# Backend
uv run --project backend pytest
uv run --project backend ruff check backend
uv run --project backend ruff format backend

# Frontend
npm --prefix frontend run lint
npm --prefix frontend run typecheck

Pre-commit runs automatically on git commit. If a hook fails, fix the issue, re-stage, and commit again.

Environment variables

Copy .env.example to .env and fill in your keys. AI_PROVIDER + MODEL_NAME control which LLM is used (ollama, openai, or anthropic).

API types for the frontend

The backend exposes an OpenAPI schema at http://localhost:8000/openapi.json. The frontend can generate typed clients from it using openapi-typescript.

Layout

.
ā”œā”€ā”€ PRD.md                    # Product requirements
ā”œā”€ā”€ TODO.md                   # Progress tracker
ā”œā”€ā”€ README.md                 # You are here
ā”œā”€ā”€ .env.example              # Environment variables template
ā”œā”€ā”€ .pre-commit-config.yaml   # yaml/json/ruff/eslint/pytest hooks
ā”œā”€ā”€ backend/
│   ā”œā”€ā”€ pyproject.toml        # uv-managed deps, pytest config
│   ā”œā”€ā”€ client.py             # CLI tool to upload/list/delete documents
│   ā”œā”€ā”€ app/
│   │   ā”œā”€ā”€ main.py           # FastAPI app, CORS, router mounts
│   │   ā”œā”€ā”€ schemas.py        # Pydantic request/response models
│   │   ā”œā”€ā”€ state.py          # In-memory dataclasses (Document, Thread, etc.)
│   │   ā”œā”€ā”€ core/
│   │   │   └── config.py     # Env-driven settings
│   │   ā”œā”€ā”€ routers/
│   │   │   ā”œā”€ā”€ health.py     # GET /healthz
│   │   │   ā”œā”€ā”€ documents.py  # Upload, list, delete documents
│   │   │   ā”œā”€ā”€ threads.py    # Create, list, get, delete threads
│   │   │   └── chat.py       # Streaming chat endpoint
│   │   └── services/
│   │       ā”œā”€ā”€ parse.py      # Text extraction (txt/md/pdf)
│   │       ā”œā”€ā”€ llm.py        # get_llm() provider factory
│   │       ā”œā”€ā”€ graph.py      # LangGraph single-node workflow
│   │       └── sse.py        # Vercel AI SDK data-stream encoder
│   └── tests/                # pytest (asyncio_mode = "auto")
└── frontend/
    ā”œā”€ā”€ package.json
    ā”œā”€ā”€ src/app/              # Next.js App Router
    └── ...

Release History

VersionChangesUrgencyDate
0.0.0No release found — using repo HEADHigh4/21/2026

Dependencies & License Audit

Loading dependencies...

Similar Packages

SurfSenseAn open source, privacy focused alternative to NotebookLM for teams with no data limit's. Join our Discord: https://discord.gg/ejRNvftDp9v0.0.19
FlowiseBuild AI Agents, Visuallyflowise@3.1.2
multi-agent-orchestration-frameworkModular multi-agent orchestration framework powered by LangGraph and FastAPI.v0.1.0
langgraphBuild resilient language agents as graphs.1.1.9
restaiRESTai is an AIaaS (AI as a Service) open-source platform. Supports many public and local LLM suported by Ollama/vLLM/etc. Precise embeddings usage, tuning, analytics etc. Built-in image/audio generatv6.1.45