Personal net worth tracker available as a Telegram Mini App and a standalone web application. Track your assets, monitor prices, visualize portfolio performance, and set price alerts.
- Portfolio management β Create named portfolios, add assets with quantities
- Real-time & historical prices β Daily snapshots from Ecotrust, visualized with charts
- Price alerts β Set threshold alerts and get notified when prices move
- Net worth breakdown β See your portfolio split by asset category
- Telegram Mini App β Works natively inside Telegram on mobile β open app
- Standalone web app β Also runs as a regular browser app with Telegram login widget
- English + Persian β next-intl with RTL when the active locale is
fa
- Bot: @CheghadrAppBot
- Mini App: Open in Telegram
| Layer | Technology |
|---|---|
| Framework | Next.js 16 (App Router, Turbopack) |
| Language | TypeScript 5 (strict) |
| API | tRPC v11 + TanStack React Query v5 |
| Database | Prisma 7 + Neon (serverless PostgreSQL) |
| Auth | NextAuth v5 (Telegram strategy) |
| UI | HeroUI v3 + Tailwind CSS v4 |
| Charts | Recharts |
| State | Jotai |
| i18n | next-intl |
| Testing | Vitest + Testing Library |
| Linting | Biome |
| Telegram | @telegram-apps/sdk |
- Node.js 20+
- pnpm 9+ (
npm install -g pnpm) - A Neon PostgreSQL database (neon.tech β free tier works)
- A Telegram Bot created via @BotFather
# 1. Clone the repository
git clone https://github.com/47vigen/cheghadr.git
cd cheghadr
# 2. Install dependencies
pnpm install
# 3. Configure environment variables
cp .env.example .env
# Edit .env with your values (see Environment Variables section below)
# 4. Push the database schema
pnpm db:push
# 5. Start the development server
pnpm devThe app will be available at http://localhost:3000.
Telegram login widget will show "Bot domain invalid" in local dev β this is expected. Use
DEV_TELEGRAM_USER_IDin.envto bypass authentication during development.
Copy .env.example to .env and fill in the values:
| Variable | Description | Required |
|---|---|---|
DATABASE_URL |
Neon PostgreSQL connection string (pooled) | Yes |
DIRECT_URL |
Neon direct connection (for migrations) | No |
NEXTAUTH_SECRET |
Random secret, min 32 chars β openssl rand -base64 32 |
Yes |
NEXTAUTH_URL |
App URL β http://localhost:3000 for local dev |
Yes |
TELEGRAM_BOT_TOKEN |
Bot token from @BotFather | Yes |
CRON_SECRET |
Random secret; external scheduler must send Authorization: Bearer β¦ to /api/cron/* |
Yes |
NEXT_PUBLIC_ECOTRUST_API_URL |
Ecotrust price API base URL | Yes |
NEXT_PUBLIC_TELEGRAM_BOT_USERNAME |
Bot username from @BotFather (without @) | Yes |
DEV_TELEGRAM_USER_ID |
Development only: bypass Telegram auth with this user ID | No |
SKIP_ENV_VALIDATION |
Set to 1 to skip env validation (CI, Docker) |
No |
| Script | Description |
|---|---|
pnpm dev |
Start development server (Turbopack + Node debugger) |
pnpm build |
Build for production |
pnpm start |
Start production server |
pnpm check |
Run typecheck + lint |
pnpm typecheck |
TypeScript type check |
pnpm lint |
Biome lint |
pnpm lint:fix |
Biome lint with auto-fix |
pnpm test |
Run unit tests |
pnpm test:watch |
Run tests in watch mode |
pnpm db:push |
Sync Prisma schema to database |
pnpm db:migrate |
Run Prisma migrations (dev) |
pnpm db:studio |
Open Prisma Studio |
pnpm db:seed |
Seed the database |
pnpm swagger:gen |
Regenerate Ecotrust API types from OpenAPI spec |
src/
βββ app/ # Next.js App Router pages and API routes
β βββ (app)/ # Authenticated route group
β βββ api/
β βββ auth/ # NextAuth route
β βββ cron/ # Cron HTTP routes (prices, portfolio); production triggered via cron-job.org
β βββ trpc/ # tRPC endpoint
βββ components/ # Feature-based UI components
βββ server/ # Backend: tRPC routers, auth, cron jobs, DB
βββ trpc/ # React Query + tRPC client setup
βββ providers/ # React context providers
βββ hooks/ # Custom React hooks
βββ lib/ # Domain utilities (prices, alerts, formatting)
βββ types/ # Shared TypeScript types and Zod schemas
βββ styles/ # Global CSS and theme variables
prisma/
βββ schema.prisma # Data model
βββ migrations/ # SQL migrations (e.g. default column changes)
βββ seed.ts # Database seed script
docs/
βββ cron-scheduling.md # Production cron-job.org URLs, schedules, auth
βββ phase-1-plan.md # Architecture and product context
Schedulers call /api/cron/prices and /api/cron/portfolio with Authorization: Bearer $CRON_SECRET. We use cron-job.org instead of Vercel Cron. Full table and expressions: docs/cron-scheduling.md.
This project uses HeroUI (not shadcn/ui). For new primitives, follow existing patterns under src/components/ui/ and refer to the HeroUI documentation.
Contributions are welcome! Please read CONTRIBUTING.md and the Code of Conduct before participating.
This project uses price data provided by Ecotrust (Ψ§Ϊ©ΩΨͺΨ±Ψ§Ψ³Ψͺ). We gratefully acknowledge their API service which powers the real-time and historical price features in this app. Ecotrust retains full copyright and ownership of their data and API. Please respect their terms of service when using or forking this project.
To report a security vulnerability, please see SECURITY.md. Do not open a public GitHub issue for security concerns.
This project is licensed under the MIT License β Copyright (c) 2026 47vigen