How masud5957/cryptofd-new works
cryptoFD is a crypto fixed-deposit investment platform with user dashboards, wallet and withdrawal flows, referrals, and an administrative portal. The principal user workflow is authentication, viewing account activity, and managing fixed deposits or wallet requests; background-worker code indicates separate earnings and transaction-processing responsibilities. The source index and excerpts support the web, authentication, data, and admin relationships shown. Worker internals and several unsampled features are represented at subsystem level; their unverified connections are omitted.
Main entry points: route.ts Wallet and withdrawals · index.ts Worker runtime · page.tsx Account dashboard · auth Authentication routes
Components 25
User experience
- Sign-in and signup
app/auth - Account dashboard
app/dashboard/page.tsx - Fixed deposits
app/dashboard - Wallet interface
app/dashboard/wallet/page.tsx - Referral program
app/dashboard/referral/referral-client.tsx
Application services
- Authentication routes
app/api/auth - Identity and sessions
lib/auth.ts - Wallet and withdrawals
app/api/wallet/route.ts - User data queries
lib/queries.ts - Application database
lib/db.ts - Email notifications
lib/email.ts
Administration
- Admin sign-in
app/admin-login/page.tsx - Admin portal
app/admin - Admin authentication
lib/admin-auth.ts - Admin reporting
lib/admin-queries.ts - Admin operations
lib/admin-actions.ts - Admin API routes
app/api/admin
Background processing
- Worker runtime
backend-worker/src/index.ts - FD earnings processor
backend-worker/src/fdEarningsProcessor.ts - Transaction scanner
backend-worker/src/scanner.ts - Wallet sweep services
backend-worker/src/sweepService.ts - Withdrawal executor
backend-worker/src/withdrawalExecutor.ts - Worker database access
backend-worker/src/db.ts
Other components
- User
- Crypto network
Connections 33
- User → Sign-in and signup: signs up
app/auth/sign-up/page.tsx - Sign-in and signup → Authentication routes: submits credentials
- Authentication routes → Identity and sessions: uses identity
app/api/auth/login/route.ts - Authentication routes → Application database: reads and writes
app/api/auth/register/route.ts - Authentication routes → Email notifications: sends email
app/api/auth/register/route.ts - Identity and sessions → Application database: loads user
lib/auth.ts - User → Account dashboard: opens account
app/dashboard/page.tsx - Account dashboard → Identity and sessions: checks session
app/dashboard/page.tsx - Account dashboard → User data queries: loads account data
app/dashboard/page.tsx - Account dashboard → Fixed deposits: opens deposit features
- User → Wallet interface: manages funds
- Wallet interface → Wallet and withdrawals: requests wallet actions
- Wallet and withdrawals → Identity and sessions: checks user
app/api/wallet/route.ts - Wallet and withdrawals → Application database: reads and updates
app/api/wallet/route.ts - Wallet and withdrawals → Email notifications: notifies withdrawal
app/api/wallet/route.ts - Wallet and withdrawals → Crypto network: derives deposit address
- User → Referral program: views referral program
app/dashboard/referral/referral-client.tsx - Referral program → Sign-in and signup: links to signup
app/dashboard/referral/referral-client.tsx - User → Admin sign-in: signs in as admin
app/admin-login/page.tsx - Admin sign-in → Admin authentication: authenticates
app/admin-login/page.tsx - Admin sign-in → Admin portal: opens portal
app/admin-login/page.tsx - Admin portal → Admin reporting: loads analytics
app/admin/analytics/page.tsx - Admin portal → Admin operations: invokes controls
app/admin/analytics/withdrawal-toggle.tsx - Admin API routes → Admin authentication: checks admin access
app/api/admin/trading-stats/route.ts - Admin API routes → Application database: reads and writes
app/api/admin/trading-stats/route.ts - Worker runtime → FD earnings processor: dispatches processing
- Worker runtime → Transaction scanner: dispatches scanning
- Worker runtime → Wallet sweep services: dispatches sweeps
- Worker runtime → Withdrawal executor: dispatches withdrawals
- FD earnings processor → Worker database access: uses persistence
- Transaction scanner → Worker database access: uses persistence
- Wallet sweep services → Crypto network: moves crypto
- Withdrawal executor → Crypto network: executes transfers