This guide walks you through running BrewLedger locally for development or evaluation.
- Node.js 18+
- npm (included with Node.js)
No database server is required—the API uses SQLite on disk.
git clone https://github.com/jackjusko/brewledger-oss.git
cd brewledger-ossCopy the example environment file to the repository root:
cp .env.example .envThe server reads .env from the repo root. Defaults work for local HTTP:
| Variable | Default | Purpose |
|---|---|---|
PORT |
3000 |
API server port |
HOST |
0.0.0.0 |
Bind address |
DB_PATH |
./server/database.sqlite |
SQLite database file |
API_BASE_URL |
http://localhost:3000 |
Server URL for email links |
RESET_BASE_URL |
http://localhost:5174/reset |
Password reset page URL |
You do not need Stripe, QuickBooks, SES, or OpenRouter keys for core brewery features. See .env.example for optional integrations.
During local development, the Vite dev server proxies /api requests to http://localhost:3000—you usually do not need a separate console .env file.
For production builds or custom API URLs, you can set Vite variables in platforms/console/.env.local or your shell:
# platforms/console/.env.local (optional)
VITE_API_BASE_URL=http://localhost:3000/api
VITE_PROXY_TARGET=http://localhost:3000Install packages for the server and web console:
cd server && npm install && cd ..
cd platforms/console && npm install && cd ../..Mobile app (optional):
cd platforms/brewledger-app && npm install && cd ../..From the server/ directory, create the SQLite schema:
cd server
node init_db.jsThis creates database.sqlite (or the path set in DB_PATH). Re-running on an existing database is safe for schema setup; see server migration scripts if you are upgrading an older deployment.
cd server
npm startThe API listens at http://localhost:3000. Leave this terminal running.
Open a second terminal:
cd platforms/console
npm run devThe console opens at http://localhost:5174.
- Open
http://localhost:5174in your browser. - Register a new organization (brewery name, your email, password).
- Log in with the credentials you just created.
- Explore the main areas:
- Dashboard — Overview, quick actions, low stock, recent activity
- Inventory — Items, locations, receive, consume, transfer, par levels
- Batches — Production batches, recipes, vessels, readings
- Reports — TTB Form 5130.9, removals, losses, serving rollup
- Settings — Organization, users, billing (if Stripe configured), integrations
New organizations start with an empty inventory. Add locations and items under Inventory, or receive stock to begin tracking.
If port 3000 or 5174 is taken, either stop the conflicting process or change PORT in .env (server) and update VITE_PROXY_TARGET in the console if needed.
- Confirm the server is running (
npm startinserver/). - In dev mode, the console proxies
/apitohttp://localhost:3000via Vite. If you changed the server port, setVITE_PROXY_TARGETaccordingly. - For production builds served separately from the API, set
VITE_API_BASE_URLto your API origin (e.g.https://brewery.example.com/api).
Run npm install again in platforms/console/. Ensure Node.js is 18 or newer (node -v).
Run node init_db.js from server/ before starting the server. Check that DB_PATH in .env points to a writable location.
- deployment.md — Run BrewLedger in production
- contributing.md — Run tests and submit changes
- ../FAQ.md — Optional integrations and mobile builds