Scalar Core
Software has never been easier to start — or easier to turn into a mess. AI makes it fast to add code, but it doesn't stop dependencies, frameworks, and abstractions from piling up as an app grows. Scalar is a deliberately simple foundation — Python, server-rendered HTML, SQLite, no build step — meant to be read top to bottom and understood, so you have somewhere sane to point an AI coding tool (or your own hands) without the mess compounding.
A small single-tenant CRM template — Clients, Tasks, comments, attachments, notifications, and a read/write Ask AI chat assistant — meant as a starting point to fork and build on, not as a product of its own.
Server-rendered Bottle + peewee
over SQLite. No build step, no Node, and no pip install needed for the app
itself — bottle and peewee are vendored as plain .py files under
vendor/ (MIT-licensed; see vendor/LICENSE.*). Styling comes from the
oat.css design-system library (also vendored),
retthemed in static/style.css.
- What's built: DOCUMENTATION.md
- Working on this app? Read AGENTS.md first — in particular, DOCUMENTATION.md needs updating alongside most changes.
Requirements
- Python 3.10+ (the code uses
X | Nonetype syntax). - No external services required to run it. Optional integrations (AI chat, outbound email) degrade gracefully when unconfigured — see Configuration below.
Quick start
cp .env.example .env # optional — sensible defaults work without it
python3 app.py
Then open http://localhost:8000 and register the first account (it becomes the team's owner, and gets a couple of sample clients/tasks seeded in).
Dev server with autoreload
python3 app.py alone doesn't reload on code changes. For that, run it
under gunicorn instead:
pip install gunicorn # the one thing here that isn't vendored
make # same as: make run
HOST/PORT/WORKERS are overridable, e.g. make PORT=8080. Template and
static file edits show up on the next request either way, without a
restart (app.py's DEBUG flag) — only .py changes need the
gunicorn --reload (or a manual restart, if running python3 app.py
directly).
Configuration
Everything is optional — copy .env.example to .env and fill in only
what you need. Full reference in
DOCUMENTATION.md § Configuration reference.
Highlights:
- Ask AI works out of the box against a local Ollama
install (
OLLAMA_HOST/OLLAMA_MODEL); setOPENAI_API_KEYto use an OpenAI-compatible cloud API instead. - Invite/password-reset emails need
RESEND_API_KEY— without it, the app shows the invite/reset link directly in the UI instead of emailing it, so the flow still works for local dev. SECRET_KEYhas a dev-only default; set a real value before deploying anywhere real (it signs the session cookie).
Project layout
app.py # Bottle app factory, hooks, template rendering, entrypoint
pages/ # every route (no blueprints — one file per feature area)
models.py # peewee models + ensure_schema() (the whole "migrations" story)
utils.py # session/CSRF/password hashing/email/flash — hand-rolled, stdlib only
ai.py # Ask AI: tool-calling agent loop + Markdown renderer
templates/ # Bottle SimpleTemplate (.html) views
static/ # style.css (app-specific) + vendor/ (oat.css/js, bottle, peewee)
uploads/ # attachment storage (gitignored; see UPLOAD_FOLDER)
See DOCUMENTATION.md for what each page/feature actually does, and AGENTS.md for conventions to follow when changing any of this.
Scalar Pro & Enterprise
This repo (Scalar Core) is the free, MIT-licensed foundation. Two other apps build on that same foundation, each its own separate source repo — not a license key that unlocks this one:
- Scalar Pro — the same foundation grown into role-shaped workflows (sales, ops, product) for running a whole small company.
- Scalar Enterprise — builds further on top of Pro.
Both repos are public — free to read, modify, and run for non-commercial use (evaluation, personal projects, learning). Commercial use requires a one-time Commercial License; see pricing at getscalar.dev.