Inspired by Cleo AI — but private, local, and Persian-first.
BudgetMate is a privacy-first personal finance app inspired by Cleo AI, built specifically for Persian-speaking users. Unlike Cleo, it never connects to any bank account — you manually enter your budget, track expenses, set savings goals, and chat with an AI advisor that gives money advice in Persian based on your data.
- 🔒 100% Privacy — no bank integration, your data stays on your machine
- 🇮🇷 Persian-first — full RTL UI, Jalali calendar, Persian numerals throughout
- 🤖 AI-powered — chat with a financial advisor that knows your budget and spending
- 🔌 Pluggable AI — switch between OpenClaw, Ollama (local), or Anthropic with a single env var
- 👨💼 Built-in admin panel — manage users, view stats, block accounts
- 📱 Mobile-first responsive design — works beautifully on any screen size
Add your screenshots here
- 🔐 Phone + OTP login (mock OTP for development:
123456) - 📊 Dashboard with budget summary, spending pie chart, and 7-day trend
- 💸 Transaction tracking with categories, filters, and search
- 🎯 Savings goals with progress tracking and contributions
- 💬 AI chat with streaming responses, grounded in your real financial data
- 📅 Jalali calendar support throughout
- 🌙 Smooth animations and modern gradient UI
- 📈 Stats dashboard — total users, active users, transaction counts
- 👥 User management — search, view details, block/unblock
- 📋 Activity logs — full audit trail of important actions
- 🔒 Separate admin authentication with its own JWT scope
- 🚀 FastAPI backend with auto-generated OpenAPI docs
- ⚡ Server-Sent Events (SSE) for streaming AI responses
- 🗄️ SQLAlchemy 2.x + Alembic migrations
- 🎨 Next.js 14 App Router with React Server Components
- 💅 shadcn/ui components, fully customized for RTL
- ✅ Type-safe end-to-end (TypeScript + Pydantic v2)
┌────────────────────────────────────────────────────────────┐
│ Next.js 14 Frontend │
│ (App Router · TypeScript · Tailwind · shadcn/ui · RTL) │
└────────────────────────┬───────────────────────────────────┘
│ REST + SSE
↓
┌────────────────────────────────────────────────────────────┐
│ FastAPI Backend │
│ (Auth · Budgets · Transactions · Goals · Chat · Admin) │
└──┬──────────────────────┬──────────────────────────────────┘
│ │
↓ ↓
┌─────────┐ ┌─────────────────────────────────┐
│ SQLite │ │ AI Provider (pluggable) │
│ DB │ │ ┌──────────┐ ┌──────────┐ │
└─────────┘ │ │ OpenClaw │ │ Ollama │ │
│ └──────────┘ └──────────┘ │
│ ┌──────────────────────────┐ │
│ │ Anthropic │ │
│ └──────────────────────────┘ │
└─────────────────────────────────┘
- FastAPI 0.115 — modern async Python web framework
- SQLAlchemy 2.x — ORM with full type support
- Alembic — database migrations
- Pydantic v2 — data validation
- python-jose — JWT authentication
- bcrypt — password hashing
- httpx — async HTTP for AI provider calls
- sse-starlette — Server-Sent Events for streaming
- Next.js 14 (App Router)
- TypeScript 5
- TailwindCSS 3.4 (with logical properties for RTL)
- shadcn/ui — accessible component primitives
- lucide-react — icon library
- recharts — charts and data visualization
- zustand — state management
- axios — HTTP client
- react-hook-form + zod — form validation
- dayjs + jalaliday — Jalali calendar
- @fontsource/vazirmatn — Persian web font
- Python 3.11 or higher
- Node.js 20 or higher
- Git
- Windows PowerShell or any Unix-like shell
git clone https://github.com/yourusername/budgetmate.git
cd budgetmatecd backend
# Install dependencies (no venv needed)
pip install --user fastapi "uvicorn[standard]" sqlalchemy alembic pydantic "pydantic-settings" "python-jose[cryptography]" "passlib[bcrypt]" bcrypt httpx python-dotenv sse-starlette python-multipart
# Or use requirements.txt
pip install --user -r requirements.txtCreate backend/.env:
OPENCLAW_URL=http://your-openclaw-host:port
OPENCLAW_TOKEN=your_token_here
AI_PROVIDER=openclaw
PRIMARY_MODEL=ollama/gemma4:26b
FALLBACK_MODELS=ollama/qwen3-coder:30b,ollama/qwen3-coder:latest,ollama/gemma3:12b,ollama/qwen3:14b,openai/gpt-4o-mini
ADMIN_USERNAME=admin
ADMIN_PASSWORD=your_secure_admin_password
OTP_MOCK_CODE=123456
JWT_SECRET=<generate with: python -c "import secrets; print(secrets.token_hex(32))">
JWT_ALGORITHM=HS256
DATABASE_URL=sqlite:///./budgetmate.db
CORS_ORIGINS=http://localhost:3000Development SQLite note: backend/budgetmate.db is the canonical local database. Relative SQLite URLs are normalized by the backend config relative to backend/, so starting FastAPI or Alembic from the repo root or from backend/ uses the same DB file. A root-level budgetmate.db may exist from older relative-path runs and should not be deleted unless you explicitly decide to clean it up.
Run migrations and start the server:
alembic upgrade head
python -m uvicorn app.main:app --reload --port 8000Backend will be available at: http://localhost:8000
API docs: http://localhost:8000/docs
In a new terminal:
cd frontend
npm installCreate frontend/.env.local:
NEXT_PUBLIC_API_URL=http://localhost:8000/api/v1Run the dev server:
npm run devFrontend will be available at: http://localhost:3000
- Open http://localhost:3000
- Enter any phone number (e.g.,
09120000000) - Use OTP code:
123456 - You're in! Set a budget, add transactions, chat with the AI.
For the admin panel:
- Open http://localhost:3000/admin
- Username:
admin - Password: (whatever you set in
.env)
BudgetMate supports three AI providers. Change AI_PROVIDER in backend/.env and restart the server:
AI_PROVIDER=openclaw
OPENCLAW_URL=http://your-host:port
OPENCLAW_TOKEN=your_tokenMake sure Ollama is running:
ollama serve
ollama pull gemma4:26bThen:
AI_PROVIDER=ollama
PRIMARY_MODEL=gemma4:26bAI_PROVIDER=anthropic
ANTHROPIC_API_KEY=sk-ant-...
PRIMARY_MODEL=claude-sonnet-4-5budgetmate/
├── backend/
│ ├── app/
│ │ ├── core/ # config, auth, security, seed
│ │ ├── db.py # SQLAlchemy Base + engine
│ │ ├── models/ # User, Budget, Transaction, Goal, ...
│ │ ├── schemas/ # Pydantic request/response models
│ │ ├── routers/ # auth, budgets, transactions, chat, admin, ...
│ │ ├── services/
│ │ │ └── ai.py # AI provider abstraction
│ │ └── main.py # FastAPI app entry
│ ├── alembic/ # database migrations
│ ├── .env # backend secrets (gitignored)
│ └── requirements.txt
├── frontend/
│ ├── src/
│ │ ├── app/ # Next.js App Router pages
│ │ ├── components/ # UI components + shadcn/ui
│ │ ├── lib/ # api client, formatters, utils
│ │ └── store/ # zustand stores
│ ├── .env.local # frontend env (gitignored)
│ └── package.json
├── docker-compose.yml # one-command full stack
├── CLAUDE.md # AI agent resume guide
└── README.md
Run the full stack with one command:
docker compose up --buildBackend on :8000, frontend on :3000.
All API endpoints are documented and testable at http://localhost:8000/docs (Swagger UI).
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/v1/auth/request-otp |
Request OTP for a phone number |
POST |
/api/v1/auth/verify-otp |
Verify OTP and get JWT |
POST |
/api/v1/auth/admin/login |
Admin login |
GET |
/api/v1/me |
Current user info |
GET |
/api/v1/budgets/current |
Get current month budget |
GET |
/api/v1/transactions/summary |
Spending summary for current month |
POST |
/api/v1/chat/message |
Send a message to AI |
GET |
/api/v1/chat/stream |
Stream AI response (SSE) |
GET |
/api/v1/admin/stats |
Admin dashboard stats |
# Backend smoke test
cd backend
python -m pytest
# Frontend type check + build
cd frontend
npm run build- Real SMS OTP integration (Kavenegar, Twilio)
- Recurring transactions
- Multi-currency support
- Budget categories with custom rules
- Export to CSV / Excel
- Receipt OCR via vision models
- Mobile apps (React Native)
- PostgreSQL support for production
- Telegram bot integration
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feat/amazing-feature) - Commit your changes (
git commit -m 'feat: add amazing feature') - Push to the branch (
git push origin feat/amazing-feature) - Open a Pull Request
For major changes, please open an issue first to discuss what you'd like to change.
This project is licensed under the MIT License — see the LICENSE file for details.
- Inspired by Cleo AI — the original AI finance assistant
- Built with FastAPI and Next.js
- Persian font: Vazirmatn by Saber Rastikerdar
- Icons: Lucide
- UI components: shadcn/ui
بادجتمیت یک اپلیکیشن مدیریت مالی شخصی است که با الهام از Cleo AI ساخته شده، اما با تمرکز کامل بر حریم خصوصی و زبان فارسی. برخلاف Cleo، هیچگاه به حساب بانکی شما متصل نمیشود — شما بهصورت دستی بودجهتان را وارد میکنید، هزینهها را ثبت میکنید، اهداف پسانداز تعریف میکنید و با دستیار هوشمندی که از دادههای مالی شما باخبر است، به فارسی گفتوگو میکنید.
- 🔒 حریم خصوصی کامل — هیچ اتصال بانکی نیست، دادهها روی سیستم شما باقی میمانند
- 🇮🇷 فارسی از پایه — رابط راستچین کامل، تقویم جلالی، اعداد فارسی
- 🤖 هوش مصنوعی مالی — مشاوره مبتنی بر بودجه و خرجهای واقعی شما
- 🔌 هوش مصنوعی قابل سوئیچ — بین OpenClaw، Ollama (محلی) یا Anthropic
- 👨💼 پنل ادمین داخلی — مدیریت کاربران، آمار، بلاک کردن
- 📱 طراحی موبایلاول — روی هر اندازه صفحهای زیبا است
- 🔐 ورود با شماره موبایل و کد OTP (کد آزمایشی:
۱۲۳۴۵۶) - 📊 داشبورد با خلاصه بودجه، نمودار دایرهای و روند ۷ روز اخیر
- 💸 ثبت و مدیریت تراکنشها با دستهبندی، فیلتر و جستجو
- 🎯 اهداف پسانداز با نمودار پیشرفت
- 💬 گفتوگو با هوش مصنوعی، پاسخهای جاری (streaming)
- 📅 پشتیبانی کامل از تقویم جلالی
- 🌙 انیمیشنهای نرم و رابط مدرن
- 📈 داشبورد آمار — تعداد کاربران، کاربران فعال، تراکنشها
- 👥 مدیریت کاربران — جستجو، مشاهده جزئیات، بلاک/آنبلاک
- 📋 لاگ فعالیتها
- Python نسخه ۳.۱۱ یا بالاتر
- Node.js نسخه ۲۰ یا بالاتر
- Git
git clone https://github.com/yourusername/budgetmate.git
cd budgetmatecd backend
pip install --user -r requirements.txtفایل backend/.env را با مقادیر مناسب پر کنید (نمونه در بخش انگلیسی).
alembic upgrade head
python -m uvicorn app.main:app --reload --port 8000بکاند روی http://localhost:8000 در دسترس است.
مستندات API: http://localhost:8000/docs
در ترمینال جدید:
cd frontend
npm installفایل frontend/.env.local بسازید:
NEXT_PUBLIC_API_URL=http://localhost:8000/api/v1npm run devفرانتاند روی http://localhost:3000 در دسترس است.
۱. به http://localhost:3000 بروید
۲. هر شماره موبایلی را وارد کنید (مثلاً ۰۹۱۲۰۰۰۰۰۰۰)
۳. کد OTP: ۱۲۳۴۵۶
۴. وارد داشبورد میشوید!
برای پنل ادمین:
۱. http://localhost:3000/admin
۲. نام کاربری: admin
۳. رمز عبور: (مقداری که در .env تنظیم کردید)
سه provider پشتیبانی میشود. متغیر AI_PROVIDER را در backend/.env تغییر دهید و سرور را restart کنید:
openclaw(پیشفرض) — سرور OpenClaw اختصاصیollama— Ollama محلی رویlocalhost:11434anthropic— Claude از Anthropic (نیاز به API key)
از مشارکت شما استقبال میشود! مراحل:
۱. مخزن را Fork کنید
۲. شاخه جدید بسازید (git checkout -b feat/something)
۳. تغییرات را commit کنید
۴. push کنید و Pull Request باز کنید
این پروژه تحت لایسنس MIT منتشر شده است.





