forked from cartsnitch/cartsnitch
782448a54a557d63288d0bcdc06887aa48c317f2
Replace hand-rolled JWT auth with Better-Auth session-based authentication. - Scaffold auth/ Node.js service with Better-Auth, bcrypt password compat, Postgres adapter mapped to existing users table - Add Alembic migration (002) creating sessions, accounts, verifications tables and migrating password hashes to accounts table - Update FastAPI auth dependency to validate sessions via shared DB (supports both cookie and Bearer token) - Remove registration/login/refresh endpoints from API gateway (now handled by Better-Auth service) - Update frontend to use better-auth/react client with httpOnly cookies (no tokens in localStorage or memory) - Rewrite auth store, Login, Register, Dashboard, Settings, ProtectedRoute to use session-based auth - Update all tests to create sessions directly in DB instead of JWT tokens Resolves CAR-27 See plan: CAR-26#document-plan Co-Authored-By: Paperclip <noreply@paperclip.ing>
CartSnitch Monorepo
CartSnitch is a self-hosted grocery price intelligence platform. This repo consolidates the core services and the flagship frontend PWA.
Services
| Directory | Service | Purpose |
|---|---|---|
/ (root) |
Frontend | React 18 PWA — mobile-first price intelligence UI |
api/ |
API Gateway | FastAPI — frontend-facing REST API |
common/ |
Common | Shared Python models, schemas, Alembic migrations |
receiptwitness/ |
ReceiptWitness | Purchase ingestion via retailer scrapers |
Quick Start
Frontend (root)
npm install
npm run dev # http://localhost:5173
npm run build # production build
npm run test # unit tests (Vitest)
Python Services
Each Python service uses uv and has its own pyproject.toml:
cd api # or common / receiptwitness
uv sync
uv run pytest
Development Workflow
- Never push directly to main. Always open a PR from a feature branch.
- Branch naming:
feature/<description>orfix/<description> - Conventional commits:
feat:,fix:,refactor:,docs:,chore:
Architecture
For full details see CLAUDE.md or the per-service CLAUDE.md in each subdirectory.
CartSnitch is a polyrepo-style monorepo: each service can be built and deployed independently, but sharing code between common/ and the other Python services is done via local path dependencies in pyproject.toml.
Description
Consumer savings platform with grocery coupon tracking, deal alerts, and price comparison
Languages
Python
85.2%
TypeScript
13.5%
Shell
0.5%
Dockerfile
0.5%
Mako
0.1%