How 86pushkar24/finconnect works
Project type and purpose
• Project Type: Full‑stack SaaS web application built with Next.js 13 (App Router), TypeScript, and TailwindCSS.
• Purpose: A fintech platform (“FinConnect”) that lets users securely authenticate, link multiple bank accounts via Plaid, view balances/transactions, and transfer funds between users via Dwolla. Data persistence and user management use Appwrite.
File structure
• Top‑level Next.js “app/” directory houses all routes and layouts:
• app/(auth): Sign‑in and Sign‑up pages (SSR, server actions).
• app/(root): Authenticated area – pages for dashboard (overview), My Banks, Transaction History, Payment Transfer.
• app/api: Example API route (sentry).
• “components/”: Reusable UI pieces (BankCard, Sidebar, Charts, Forms, UI primitives under components/ui).
• “lib/”: Server‑side actions and utilities:
• appwrite.ts – sets up Appwrite clients.
• plaid.ts – configures Plaid SDK.
• dwolla.actions.ts, bank.actions.ts, transaction.actions.ts, user.actions.ts – encapsulate calls to external services and database.
• “constants/” and “types/”: Shared constants and TypeScript types.
• Config files: next.config.mjs, tailwind.config.ts, tsconfig.json, Sentry configs, ESLint, PostCSS.
Key insights from the README
• Tech stack: Next.js (SSR & server actions), TypeScript, Appwrite (DB & Auth), Plaid (bank linking & transactions), Dwolla (fund transfers), Chart.js, React Hook Form + Zod, TailwindCSS, ShadCN UI.
• Core features: Authentication, Bank Linking, Real‑time Balances, Transaction History with pagination, Funds Transfer.
a. Main Components
• Client Browser (React UI)
• Next.js Server
• Page Routes & Layouts (app/)
• Server Actions & API Routes (lib/actions, app/api)
• Database & Auth: Appwrite service (Users, Banks, Transactions collections)
• External Financial APIs:
• Plaid – Link Token, Transactions Sync, Accounts API, Institution API
• Dwolla – Customer Creation, Funding Source, Transfers
• Monitoring: Sentry (client, server, edge)
• Static Assets & CDN (public/, Next.js asset handling)
b. Relationships & Data Flows
1. User Authentication:
Browser → Next.js Server → Appwrite Authentication API → Session Cookie
2. Bank Linking:
Browser (Plaid Link widget) ↔ Plaid Link API
Browser → Next.js Server (exchangePublicToken) → Plaid API → Dwolla API → Appwrite (store bank document)
3. Data Retrieval:
Browser → Next.js Server (server actions) → Appwrite (get bank list) + Plaid (accountsGet, transactionsSync) → Server → Browser
4. Funds Transfer:
Browser (PaymentTransferForm) → Next.js Server (createTransfer) → Dwolla API → Next.js Server (createTransaction) → Appwrite
5. Monitoring & Errors:
Any component → Sentry (client or server)
c. Architectural Patterns & Principles
• App Router with hierarchical layouts (app/(auth), app/(root))
• Server Actions for data fetching & mutations (colocated in lib/actions)
• Separation of concerns: UI components vs. service‑layer actions
• Externalization of secrets and environment variables (.env)
• Declarative styling with TailwindCSS and ShadCN
d. Key Technologies & Frameworks
• Next.js (App Router, Server Actions, SSR, API routes)
• TypeScript
• Appwrite (Database, Auth)
• Plaid SDK
• Dwolla‑V2 SDK
• React Hook Form + Zod (forms & validation)
• Chart.js
• TailwindCSS + ShadCN UI
• Sentry
Detailed but Concise
• Essential layers: Client → Next.js → External APIs → Database.
• Every major folder or module (UI, server actions, config).
• How data moves end‑to‑end for key flows (auth, link, fetch, transfer).