Skip to main content

Project Structure

Resibibo is organized as a pnpm monorepo with two main applications.

resibibo/
├── apps/
│ ├── server/ # Django Backend
│ │ ├── project_config/ # Django settings, urls, wsgi
│ │ ├── common/ # Shared models, pagination, permissions
│ │ ├── users/ # Custom user model, auth endpoints
│ │ ├── categories/ # Default + custom categories (18 seeded)
│ │ ├── transactions/ # Transactions + line items
│ │ ├── budgets/ # Budget management
│ │ ├── recurring/ # Recurring rules + generation
│ │ ├── receipts/ # Receipt OCR + AI parsing
│ │ ├── agent/ # AI chat with function calling
│ │ ├── sync/ # E2E encrypted data sync
│ │ ├── conftest.py # Shared pytest fixtures
│ │ ├── Dockerfile
│ │ ├── manage.py
│ │ └── pyproject.toml
│ │
│ ├── mobile-client/ # React Native Frontend
│ │ ├── src/
│ │ │ ├── api/ # Axios client + react-query hooks
│ │ │ ├── app/ # Expo Router file-based screens
│ │ │ ├── components/ # Shared components (ui/ for primitives)
│ │ │ ├── db/ # Drizzle ORM: schema, repositories, hooks
│ │ │ ├── lib/ # Auth, i18n, sync engine, notifications
│ │ │ ├── translations/ # i18n JSON files
│ │ │ └── types/ # Shared TypeScript types
│ │ ├── drizzle.config.ts
│ │ ├── Dockerfile
│ │ └── package.json
│ │
│ └── docs/ # Docusaurus documentation site

├── docs/ # Planning documents (PRD, technical spec)
├── packages/ # Shared libraries (future)
├── docker-compose.yml
├── Justfile # Unified task runner
├── pnpm-workspace.yaml
├── .env.example
└── README.md

Server Apps

Each Django app lives in apps/server/ and follows a consistent structure:

app_name/
├── __init__.py
├── apps.py
├── models.py # Django models
├── serializers.py # DRF serializers
├── views.py # DRF viewsets / API views
├── urls.py # URL routing
├── admin.py # Admin registration (optional)
├── tests/ # App-specific tests (optional)
├── services/ # Business logic (optional, used by receipts + agent)
└── management/
└── commands/ # Management commands (optional, used by categories + recurring)

Mobile Client Structure

src/
├── api/ # Server API layer (Axios + React Query)
│ ├── common/ # Axios client, JWT interceptor, token refresh
│ ├── auth/ # login, register, refresh, me
│ ├── categories/ # Fetch server categories
│ ├── receipts/ # Upload, get, confirm, list
│ ├── agent/ # AI chat + quick actions
│ └── sync/ # E2E encrypted sync
├── app/ # Expo Router screens (file-based routing)
│ ├── (app)/ # Tab screens (home, expenses, scan, budget, settings)
│ ├── transaction/ # Detail + add/edit
│ ├── budget/ # Detail + add/edit
│ ├── recurring/ # List, detail, add/edit
│ └── receipt/ # Review + confirm
├── components/ # UI components grouped by feature
│ ├── ui/ # Shared primitives (icons, currency, dialogs)
│ └── ... # Feature-specific components
├── db/ # Offline-first database layer
│ ├── schema/ # Drizzle ORM table definitions
│ ├── repositories/ # CRUD operations
│ ├── hooks/ # React Query hooks (react-query-kit)
│ ├── migrations/ # Auto-generated SQL
│ ├── client.ts # SQLite + Drizzle setup
│ ├── provider.tsx # Migration runner
│ └── seed.ts # Default categories seeder
├── lib/ # Utilities and stores
│ ├── auth/ # Auth store, tokens
│ ├── sync/ # Encryption, sync engine, auto-sync
│ └── ...
└── translations/ # i18n JSON files