How anasattoum/safe-spend works
Safe Spend is a personal-finance web application: users manage transactions and categories, review balances and spending analytics, and consult currency-exchange and gold-price information. The graph shows those product areas and the sampled server-side data path through API handlers, domain actions, and Prisma. The README documents major capabilities that the excerpts do not trace to their data providers; those areas are included without guessed integration edges.
Main entry points: index.tsx Dashboard · user.ts User and session · prisma.ts Application database · get-history.ts History calculations
Components 20
User experience
- Account access
src/app/[locale]/(auth)/sign-in/page.tsx - Dashboard
src/sections/dashboard/index.tsx
Finance workflows
- Transactions
src/sections/transactions/index.tsx - Transaction actions
src/actions/transaction.ts - Categories
src/sections/categories/index.tsx - Category actions
src/actions/category.ts - Currency exchanges
src/sections/exchanges/index.tsx - Exchange actions
src/actions/exchange.ts - Currency tools
src/sections/currency/index.tsx
Financial insights
- History calculations
src/lib/get-history.ts - Balance calculations
src/lib/get-balance-stats.tsx - Market information
src/sections/gold-today/index.tsx - SYP rates
src/sections/syrian-pound-today/index.tsx
Server and persistence
- History API
src/app/api/history/data/route.ts - Transaction API
src/app/api/transactions/route.ts - Exchange API
src/app/api/exchanges/route.ts - Statistics APIs
src/app/api/statistics/total/route.ts - User and session
src/actions/user.ts - Application database
src/lib/prisma.ts
Other components
- Finance user
Connections 25
- Finance user → Account access: signs in
README.md - Finance user → Dashboard: manages finances
README.md - Dashboard → Transactions: opens
src/sections/dashboard/index.tsx - Dashboard → Categories: opens
src/sections/dashboard/index.tsx - Dashboard → Currency exchanges: opens
- Dashboard → Transaction actions: uses
src/sections/dashboard/index.tsx - Dashboard → Categories: renders
src/sections/dashboard/index.tsx - Transactions → Transaction actions: manages
- Categories → Category actions: manages
- Currency exchanges → Exchange actions: manages
- Exchange actions → Application database: writes exchanges
src/actions/exchange.ts - Transaction API → User and session: authenticates
src/app/api/transactions/route.ts - Transaction API → Application database: reads transactions
src/app/api/transactions/route.ts - Exchange API → User and session: authenticates
src/app/api/exchanges/route.ts - Exchange API → Application database: reads exchanges
src/app/api/exchanges/route.ts - History API → User and session: authenticates
src/app/api/history/data/route.ts - History API → History calculations: requests history
src/app/api/history/data/route.ts - Statistics APIs → User and session: authenticates
src/app/api/statistics/total/route.ts - Statistics APIs → History calculations: requests balances
src/app/api/statistics/total/route.ts - History calculations → Application database: queries data
src/lib/get-history.ts - History calculations → Balance calculations: uses calculations
src/lib/get-history.ts - User and session → Application database: reads and writes
src/actions/user.ts - Finance user → Currency tools: converts currencies
README.md - Finance user → Market information: checks gold prices
README.md - Finance user → SYP rates: checks exchange rates
README.md