Dietinator is a personal, local-first calorie tracker. Pull requests and issues are welcome. A few ground rules keep the project healthy.
- Local-first always. The diary must keep working with no network. Never
let a YAZIO failure block a local write. Keep the offline e2e suite green
with
pnpm run test:e2e. - No ads, no tracking, no analytics SDKs. Error monitoring and metrics must be opt-in and privacy-preserving.
- Respect the unofficial API. The
yazionpm package is a reverse-engineered client of an API we do not own. Do not productize, redistribute, or abuse the client. Keep the local paths intact when you change the integration, because the API can break without notice. - No secrets in the repo. Never commit credentials, tokens, or
.envfiles. CI runs a gitleaks secret scan on every push.
nvm use # 22, see .nvmrc
pnpm install
pnpm start # Metro and Expo through the wrapper script, never raw npx expoFor web UI iteration, use pnpm run dev:web and pnpm run test:e2e:dev.
All gates must pass before merging.
pnpm run typecheck
pnpm run lint
pnpm run format:check
pnpm test
pnpm run test:e2e # builds the web export. YAZIO specs skip without credentialsPre-commit, Husky runs lint-staged with eslint fix and prettier on staged files.
- TypeScript
strict. Useimport typefor type-only imports. - SQLite booleans are
INTEGER0 or 1. Dates areYYYY-MM-DDkeys withtoDateKey. - Screens live in
app, UI insrc/components, logic insrc/servicesandsrc/db. Route files include no SQL or YAZIO calls. - Styling uses gluestack-ui components with NativeWind classes. Design tokens live in
src/theme.ts. - Prettier with ESLint enforces the style with no semicolons and double quotes.
Use Conventional Commits with a scope, for example feat(diary): ..., fix(sync): ...,
and ci(workflows): .... Keep changes focused and reviewable.
- Unit tests. Jest with jest-expo runs in
src/__tests__withpnpm test. Pureutilsfunctions and service logic with mocked DB modules are covered. Add tests for new pure logic. - E2E. Playwright runs against the web export in
e2eat phone viewport for local-first flows. YAZIO specs run only with credentials in.env.local. - Schema changes. Add a case to
src/db/__tests__/database.test.tspinning the new migration SQL.