This repository contains two main parts:
server/— Node.js backend (Express + Prisma + MongoDB) providing expenses CRUD and OCR endpoints.mobile/— Expo (React Native) mobile app (MVP) that uploads receipts, uses the server OCR, and stores expenses locally when offline.
This README summarizes how to run the project locally and where to look for important files.
- Environment
- Copy the example env to a working
.envat the repo root or set environment variables in your shell.
cp .env.example .env
# Edit .env to point DATABASE_URL and API_URL as neededImportant variables in .env:
PORT— server port (default 4000)DATABASE_URL— MongoDB connection string used by PrismaAPI_URL— base URL used by the mobile app to reach the server (e.g. http://localhost:4000)OCR_LANG— optional Tesseract language code (defaults toeng)
- Start the server (development)
cd server
npm install
# generate Prisma client after setting DATABASE_URL
npx prisma generate
# start server in dev mode
npm run devNote: npx prisma db push requires a live MongoDB DATABASE_URL. For local testing you can use a free MongoDB Atlas cluster or a local MongoDB instance.
- Run the mobile app (development)
cd mobile
npm install
export API_URL=http://localhost:4000 # or the host IP reachable by your device/emulator
npm run startRun via the Expo UI (a to open Android, i for iOS simulator, w for web).
server/— backend implementation, routes underserver/routes/, controllers underserver/controllers/, Prisma schema inserver/prisma/.mobile/— Expo app; the active mobile code is the minimal MVP inmobile/app/,mobile/components/, andmobile/services/.mobile/backup-<timestamp>/— backups of files removed during pruning.
- The repo was pruned to keep a minimal mobile MVP. Any files you miss were moved to
mobile/backup-<timestamp>/. - The server uses Prisma with the MongoDB provider. Make sure
DATABASE_URLin.envpoints to a MongoDB instance before runningnpx prisma generateornpx prisma db push. - OCR is implemented on the server (Tesseract). The mobile app uploads images to
/ocrand receives parsed text.
- If Prisma generate fails: check
DATABASE_URL, and runnpx prisma generateagain after the variable is set. - If the mobile app can't reach the server: ensure
API_URLis reachable from the device/emulator (use host machine IP if needed).
For development questions, open an issue or see the code in server/ and mobile/.
This repository includes a .pre-commit-config.yaml at the project root to run common checks before commits.
Recommended quickstart for contributors:
- Install
pre-commit(Python required):
pip install --user pre-commit- Install the git hook for this repository (run once per clone):
pre-commit install- Run all hooks against the entire repository (optional but useful before first push):
pre-commit run --all-filesNotes:
- The config runs small format/cleanup hooks (trailing whitespace, EOF fixer, YAML checks) and
prettierfor many frontend file types. - It also contains local hooks that call
npm run lintundermobile/andserver/. Those hooks require Node/npm installed and the respectivenode_modulespresent. You can install dependencies withcd mobile && npm installandcd server && npm install. - If you prefer to use a Node-native hook manager (e.g. Husky) instead of the Python
pre-commitframework, we can add that as a follow-up.
Apache-2.0