├── .eslintrc.json ├── public └── icons │ ├── lines.png │ ├── arrow-up.svg │ ├── filter-lines.svg │ ├── plus.svg │ ├── arrow-left.svg │ ├── arrow-right.svg │ ├── fresh-fv.svg │ ├── search.svg │ ├── dollar.svg │ ├── logout.svg │ ├── hamburger.svg │ ├── deposit.svg │ ├── edit.svg │ ├── bank-transfer.svg │ ├── coins.svg │ ├── Paypass.svg │ ├── monitor.svg │ ├── home.svg │ ├── arrow-down.svg │ ├── credit-card.svg │ ├── shopping-bag.svg │ ├── google.svg │ ├── mastercard.svg │ ├── visa.svg │ ├── connect-bank.svg │ ├── tbfBakery.svg │ ├── dollar-circle.svg │ ├── a-coffee.svg │ ├── payment-transfer.svg │ ├── money-send.svg │ ├── loader.svg │ ├── transaction.svg │ ├── logo.svg │ ├── stripe.svg │ ├── spotify.svg │ ├── figma.svg │ └── jsm.svg ├── app ├── (root) │ ├── my-banks │ │ └── page.tsx │ ├── payment-transfer │ │ └── page.tsx │ ├── transaction-history │ │ └── page.tsx │ ├── layout.tsx │ └── page.tsx ├── (auth) │ ├── sign-in │ │ └── page.tsx │ ├── sign-up │ │ └── page.tsx │ └── layout.tsx ├── api │ └── sentry-example-api │ │ └── route.ts ├── layout.tsx └── globals.css ├── postcss.config.mjs ├── instrumentation.ts ├── components ├── AnimatedCounter.tsx ├── HeaderBox.tsx ├── ui │ ├── label.tsx │ ├── input.tsx │ ├── button.tsx │ ├── sheet.tsx │ └── form.tsx ├── DoughnutChart.tsx ├── TotalBalanceBox.tsx ├── Footer.tsx ├── Custominput.tsx ├── PlaidLink.tsx ├── Sidebar.tsx ├── BankCard.tsx ├── RightSidebar.tsx ├── MobileNav.tsx └── AuthForm.tsx ├── lib ├── plaid.ts ├── appwrite.ts ├── actions │ ├── dwolla.actions.ts │ └── user.actions.ts └── utils.ts ├── components.json ├── .gitignore ├── sentry.server.config.ts ├── tsconfig.json ├── sentry.edge.config.ts ├── sentry.client.config.ts ├── package.json ├── README.md ├── next.config.ts ├── tailwind.config.ts ├── constants └── index.ts └── types └── index.d.ts /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["next/core-web-vitals", "next/typescript"] 3 | } 4 | -------------------------------------------------------------------------------- /public/icons/lines.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NAVIN0507/project_banking/HEAD/public/icons/lines.png -------------------------------------------------------------------------------- /app/(root)/my-banks/page.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | 3 | const MyBanks = () => { 4 | return ( 5 |
MyBanks
6 | ) 7 | } 8 | 9 | export default MyBanks -------------------------------------------------------------------------------- /app/(root)/payment-transfer/page.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | 3 | const Transfer = () => { 4 | return ( 5 |
Transfer
6 | ) 7 | } 8 | 9 | export default Transfer -------------------------------------------------------------------------------- /postcss.config.mjs: -------------------------------------------------------------------------------- 1 | /** @type {import('postcss-load-config').Config} */ 2 | const config = { 3 | plugins: { 4 | tailwindcss: {}, 5 | }, 6 | }; 7 | 8 | export default config; 9 | -------------------------------------------------------------------------------- /app/(root)/transaction-history/page.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | 3 | const TransactionsHistory = () => { 4 | return ( 5 |
transactionshistory
6 | ) 7 | } 8 | 9 | export default TransactionsHistory -------------------------------------------------------------------------------- /public/icons/arrow-up.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /public/icons/filter-lines.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /public/icons/plus.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /app/(auth)/sign-in/page.tsx: -------------------------------------------------------------------------------- 1 | import AuthForm from '@/components/AuthForm' 2 | import React from 'react' 3 | 4 | const SignIn = () => { 5 | return ( 6 |
7 | 8 |
9 | ) 10 | } 11 | 12 | export default SignIn -------------------------------------------------------------------------------- /public/icons/arrow-left.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /public/icons/arrow-right.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /app/api/sentry-example-api/route.ts: -------------------------------------------------------------------------------- 1 | import { NextResponse } from "next/server"; 2 | 3 | export const dynamic = "force-dynamic"; 4 | 5 | // A faulty API route to test Sentry's error monitoring 6 | export function GET() { 7 | throw new Error("Sentry Example API Route Error"); 8 | return NextResponse.json({ data: "Testing Sentry Error..." }); 9 | } 10 | -------------------------------------------------------------------------------- /instrumentation.ts: -------------------------------------------------------------------------------- 1 | import * as Sentry from '@sentry/nextjs'; 2 | 3 | export async function register() { 4 | if (process.env.NEXT_RUNTIME === 'nodejs') { 5 | await import('./sentry.server.config'); 6 | } 7 | 8 | if (process.env.NEXT_RUNTIME === 'edge') { 9 | await import('./sentry.edge.config'); 10 | } 11 | } 12 | 13 | export const onRequestError = Sentry.captureRequestError; 14 | -------------------------------------------------------------------------------- /public/icons/fresh-fv.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /public/icons/search.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /components/AnimatedCounter.tsx: -------------------------------------------------------------------------------- 1 | 2 | 'use client'; 3 | import React from 'react' 4 | import CountUp from 'react-countup' 5 | 6 | const AnimatedCounter = ({amount} : {amount :number}) => { 7 | return ( 8 |
9 | 14 |
15 | ) 16 | } 17 | 18 | export default AnimatedCounter -------------------------------------------------------------------------------- /app/(auth)/sign-up/page.tsx: -------------------------------------------------------------------------------- 1 | import AuthForm from '@/components/AuthForm' 2 | import { getLoggedInUser } from '@/lib/actions/user.actions'; 3 | import React from 'react' 4 | 5 | const SignUp = async () => { 6 | const loggedInUser = await getLoggedInUser(); 7 | console.log(loggedInUser) 8 | return ( 9 |
10 | 11 |
12 | ) 13 | } 14 | 15 | export default SignUp -------------------------------------------------------------------------------- /components/HeaderBox.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | 3 | const HeaderBox = ({type ="title" , title , subtext , user}:HeaderBoxProps) => { 4 | return ( 5 |
6 |

7 | {title} 8 | {type == "greeting" && (  {user})} 9 |

10 |

{subtext}

11 |
12 | ) 13 | } 14 | 15 | export default HeaderBox -------------------------------------------------------------------------------- /public/icons/dollar.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /lib/plaid.ts: -------------------------------------------------------------------------------- 1 | import { headers } from 'next/headers' 2 | import {Configuration , PlaidApi , PlaidEnvironments } from 'plaid' 3 | const configuration = new Configuration({ 4 | basePath:PlaidEnvironments.sandbox, 5 | baseOptions:{ 6 | headers:{ 7 | 'PLAID-CLIENT-ID' : process.env.PLAID_CLIENT_ID, 8 | 'PLAID-SECRET':process.env.PLAID_SECRET, 9 | 'env':process.env.PLAID_ENV 10 | } 11 | } 12 | }) 13 | export const plaidClient = new PlaidApi(configuration); 14 | -------------------------------------------------------------------------------- /components.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://ui.shadcn.com/schema.json", 3 | "style": "default", 4 | "rsc": true, 5 | "tsx": true, 6 | "tailwind": { 7 | "config": "tailwind.config.ts", 8 | "css": "app/globals.css", 9 | "baseColor": "slate", 10 | "cssVariables": true, 11 | "prefix": "" 12 | }, 13 | "aliases": { 14 | "components": "@/components", 15 | "utils": "@/lib/utils", 16 | "ui": "@/components/ui", 17 | "lib": "@/lib", 18 | "hooks": "@/hooks" 19 | }, 20 | "iconLibrary": "lucide" 21 | } -------------------------------------------------------------------------------- /public/icons/logout.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /public/icons/hamburger.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /app/(auth)/layout.tsx: -------------------------------------------------------------------------------- 1 | import Image from "next/image"; 2 | 3 | export default function RootLayout({ 4 | children, 5 | }: Readonly<{ 6 | children: React.ReactNode; 7 | }>) { 8 | return ( 9 |
10 | 11 | {children} 12 |
13 |
14 | Auth image 18 |
19 |
20 |
21 | ); 22 | } 23 | -------------------------------------------------------------------------------- /public/icons/deposit.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /public/icons/edit.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /public/icons/bank-transfer.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.* 7 | .yarn/* 8 | !.yarn/patches 9 | !.yarn/plugins 10 | !.yarn/releases 11 | !.yarn/versions 12 | 13 | # testing 14 | /coverage 15 | 16 | # next.js 17 | /.next/ 18 | /out/ 19 | 20 | # production 21 | /build 22 | 23 | # misc 24 | .DS_Store 25 | *.pem 26 | 27 | # debug 28 | npm-debug.log* 29 | yarn-debug.log* 30 | yarn-error.log* 31 | 32 | # env files (can opt-in for committing if needed) 33 | .env* 34 | 35 | # vercel 36 | .vercel 37 | 38 | # typescript 39 | *.tsbuildinfo 40 | next-env.d.ts 41 | 42 | # Sentry Config File 43 | .env.sentry-build-plugin 44 | -------------------------------------------------------------------------------- /sentry.server.config.ts: -------------------------------------------------------------------------------- 1 | // This file configures the initialization of Sentry on the server. 2 | // The config you add here will be used whenever the server handles a request. 3 | // https://docs.sentry.io/platforms/javascript/guides/nextjs/ 4 | 5 | import * as Sentry from "@sentry/nextjs"; 6 | 7 | Sentry.init({ 8 | dsn: "https://b9093c1586c60581ac741bfad03a0389@o4508449109049344.ingest.de.sentry.io/4508449110818896", 9 | 10 | // Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control. 11 | tracesSampleRate: 1, 12 | 13 | // Setting this option to true will print useful information to the console while you're setting up Sentry. 14 | debug: false, 15 | }); 16 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES2017", 4 | "lib": ["dom", "dom.iterable", "esnext"], 5 | "allowJs": true, 6 | "skipLibCheck": true, 7 | "strict": true, 8 | "noEmit": true, 9 | "esModuleInterop": true, 10 | "module": "esnext", 11 | "moduleResolution": "bundler", 12 | "resolveJsonModule": true, 13 | "isolatedModules": true, 14 | "jsx": "preserve", 15 | "incremental": true, 16 | "plugins": [ 17 | { 18 | "name": "next" 19 | } 20 | ], 21 | "paths": { 22 | "@/*": ["./*"] 23 | } 24 | }, 25 | "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], 26 | "exclude": ["node_modules"] 27 | } 28 | -------------------------------------------------------------------------------- /public/icons/coins.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /public/icons/Paypass.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /public/icons/monitor.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /components/ui/label.tsx: -------------------------------------------------------------------------------- 1 | "use client" 2 | 3 | import * as React from "react" 4 | import * as LabelPrimitive from "@radix-ui/react-label" 5 | import { cva, type VariantProps } from "class-variance-authority" 6 | 7 | import { cn } from "@/lib/utils" 8 | 9 | const labelVariants = cva( 10 | "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70" 11 | ) 12 | 13 | const Label = React.forwardRef< 14 | React.ElementRef, 15 | React.ComponentPropsWithoutRef & 16 | VariantProps 17 | >(({ className, ...props }, ref) => ( 18 | 23 | )) 24 | Label.displayName = LabelPrimitive.Root.displayName 25 | 26 | export { Label } 27 | -------------------------------------------------------------------------------- /sentry.edge.config.ts: -------------------------------------------------------------------------------- 1 | // This file configures the initialization of Sentry for edge features (middleware, edge routes, and so on). 2 | // The config you add here will be used whenever one of the edge features is loaded. 3 | // Note that this config is unrelated to the Vercel Edge Runtime and is also required when running locally. 4 | // https://docs.sentry.io/platforms/javascript/guides/nextjs/ 5 | 6 | import * as Sentry from "@sentry/nextjs"; 7 | 8 | Sentry.init({ 9 | dsn: "https://b9093c1586c60581ac741bfad03a0389@o4508449109049344.ingest.de.sentry.io/4508449110818896", 10 | 11 | // Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control. 12 | tracesSampleRate: 1, 13 | 14 | // Setting this option to true will print useful information to the console while you're setting up Sentry. 15 | debug: false, 16 | }); 17 | -------------------------------------------------------------------------------- /public/icons/home.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /components/ui/input.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react" 2 | 3 | import { cn } from "@/lib/utils" 4 | 5 | const Input = React.forwardRef>( 6 | ({ className, type, ...props }, ref) => { 7 | return ( 8 | 17 | ) 18 | } 19 | ) 20 | Input.displayName = "Input" 21 | 22 | export { Input } 23 | -------------------------------------------------------------------------------- /components/DoughnutChart.tsx: -------------------------------------------------------------------------------- 1 | "use client" 2 | import React from 'react' 3 | import {Chart as ChartJs , ArcElement , Tooltip , Legend} from "chart.js"; 4 | import { Doughnut } from 'react-chartjs-2'; 5 | ChartJs.register(ArcElement , Tooltip , Legend); 6 | const DoughnutChart = ({accounts} : DoughnutChartProps)=> { 7 | const data = { 8 | datasets:[ 9 | { 10 | label:'Banks', 11 | data: [1250 , 2500 , 3750], 12 | backgroundColor:['#0747b6' , '#2265d8' ,'#2f91fa'] 13 | } 14 | ], 15 | labels:['Bank 1' , 'Bank 2 ' , 'Bank 3'] 16 | } 17 | return 29 | } 30 | 31 | export default DoughnutChart -------------------------------------------------------------------------------- /public/icons/arrow-down.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/layout.tsx: -------------------------------------------------------------------------------- 1 | import type { Metadata } from "next"; 2 | import {Inter , IBM_Plex_Serif} from "next/font/google"; 3 | import "./globals.css"; 4 | 5 | const inter = Inter({subsets:["latin"] , variable: '--font-inter'}); 6 | const ibmPlexSerif = IBM_Plex_Serif({subsets:["latin"] , 7 | weight:['400' ,'700'], 8 | variable:'--font-ibm-plex-serif' 9 | }) 10 | 11 | export const metadata: Metadata = { 12 | title: "Horizon", 13 | description: "Horizon is a modern banking platform for everyone.", 14 | icons:{ 15 | icon:'/icons/logo.svg' 16 | } 17 | }; 18 | 19 | export default function RootLayout({ 20 | children, 21 | }: Readonly<{ 22 | children: React.ReactNode; 23 | }>) { 24 | return ( 25 | 26 | 29 | {children} 30 | 31 | 32 | ); 33 | } 34 | -------------------------------------------------------------------------------- /public/icons/credit-card.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /app/(root)/layout.tsx: -------------------------------------------------------------------------------- 1 | 2 | import MobileNav from "@/components/MobileNav"; 3 | import Sidebar from "@/components/Sidebar"; 4 | import { getLoggedInUser } from "@/lib/actions/user.actions"; 5 | import Image from "next/image"; 6 | import { redirect } from "next/navigation"; 7 | export default async function RootLayout({ 8 | children, 9 | }: Readonly<{ 10 | children: React.ReactNode; 11 | }>) { 12 | 13 | const loogedIn = await getLoggedInUser(); 14 | if(!loogedIn) redirect("/sign-in") 15 | return ( 16 |
17 | 18 |
19 |
20 | logo 21 |
22 | 23 |
24 |
25 | {children} 26 |
27 | 28 |
29 | ); 30 | } 31 | -------------------------------------------------------------------------------- /public/icons/shopping-bag.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /components/TotalBalanceBox.tsx: -------------------------------------------------------------------------------- 1 | import { formatAmount } from '@/lib/utils' 2 | import React from 'react' 3 | import CountUp from 'react-countup' 4 | import AnimatedCounter from './AnimatedCounter' 5 | import DoughnutChart from './DoughnutChart' 6 | 7 | const TotalBalanceBox = ({accounts = [] , totalBanks , totalCurrentBalance}:TotlaBalanceBoxProps) => { 8 | return ( 9 |
10 |
11 | ; 12 |
13 |
14 |

15 | Bank Accounts: {totalBanks} 16 |

17 |
18 |

19 | Total Current Balance 20 |

21 |
22 | 23 | 24 |
25 |
26 |
27 |
28 | ) 29 | } 30 | 31 | export default TotalBalanceBox -------------------------------------------------------------------------------- /app/(root)/page.tsx: -------------------------------------------------------------------------------- 1 | import HeaderBox from '@/components/HeaderBox' 2 | import RightSidebar from '@/components/RightSidebar'; 3 | import TotalBalanceBox from '@/components/TotalBalanceBox'; 4 | import { getLoggedInUser } from '@/lib/actions/user.actions'; 5 | import React from 'react' 6 | 7 | const Home = async () => { 8 | const loggedIn = await getLoggedInUser(); 9 | 10 | return ( 11 |
12 |
13 |
14 | 20 | 25 |
26 | RECENT TRANSACTIONS 27 |
28 | 33 |
34 | ) 35 | } 36 | 37 | export default Home -------------------------------------------------------------------------------- /sentry.client.config.ts: -------------------------------------------------------------------------------- 1 | // This file configures the initialization of Sentry on the client. 2 | // The config you add here will be used whenever a users loads a page in their browser. 3 | // https://docs.sentry.io/platforms/javascript/guides/nextjs/ 4 | 5 | import * as Sentry from "@sentry/nextjs"; 6 | 7 | Sentry.init({ 8 | dsn: "https://b9093c1586c60581ac741bfad03a0389@o4508449109049344.ingest.de.sentry.io/4508449110818896", 9 | 10 | // Add optional integrations for additional features 11 | integrations: [ 12 | Sentry.replayIntegration(), 13 | ], 14 | 15 | // Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control. 16 | tracesSampleRate: 1, 17 | 18 | // Define how likely Replay events are sampled. 19 | // This sets the sample rate to be 10%. You may want this to be 100% while 20 | // in development and sample at a lower rate in production 21 | replaysSessionSampleRate: 1.0, 22 | 23 | // Define how likely Replay events are sampled when an error occurs. 24 | replaysOnErrorSampleRate: 1.0, 25 | 26 | // Setting this option to true will print useful information to the console while you're setting up Sentry. 27 | debug: false, 28 | }); 29 | -------------------------------------------------------------------------------- /lib/appwrite.ts: -------------------------------------------------------------------------------- 1 | // src/lib/server/appwrite.js 2 | "use server"; 3 | import { Client, Account, Users } from "node-appwrite"; 4 | import { cookies } from "next/headers"; 5 | import { Databases } from "node-appwrite"; 6 | 7 | export async function createSessionClient() { 8 | const client = new Client() 9 | .setEndpoint(process.env.NEXT_PUBLIC_APPWRITE_ENDPOINT!) 10 | .setProject(process.env.NEXT_PUBLIC_APPWRITE_PROJECT!); 11 | 12 | const session = (await cookies()).get("appwrite-session") 13 | if (!session || !session.value) { 14 | throw new Error("No session"); 15 | } 16 | 17 | client.setSession(session.value); 18 | 19 | return { 20 | get account() { 21 | return new Account(client); 22 | }, 23 | }; 24 | } 25 | 26 | export async function createAdminClient() { 27 | const client = new Client() 28 | .setEndpoint(process.env.NEXT_PUBLIC_APPWRITE_ENDPOINT!) 29 | .setProject(process.env.NEXT_PUBLIC_APPWRITE_PROJECT!) 30 | .setKey(process.env.NEXT_APPWRITE_KEY!); 31 | 32 | return { 33 | get account() { 34 | return new Account(client); 35 | }, 36 | get database(){ 37 | return new Databases(client); 38 | } , 39 | get users(){ 40 | return new Users(client); 41 | } 42 | }; 43 | } 44 | -------------------------------------------------------------------------------- /components/Footer.tsx: -------------------------------------------------------------------------------- 1 | 2 | import { logoutAccount } from '@/lib/actions/user.actions' 3 | import Image from 'next/image' 4 | import { useRouter } from 'next/navigation' 5 | import React from 'react' 6 | 7 | const Footer = ({user , type = "desktop"} : FooterProps) => { 8 | const router =useRouter(); 9 | const handlelogout = async()=>{ 10 | 11 | const loggedOut = await logoutAccount(); 12 | if(loggedOut){ 13 | router.push('/sign-in') 14 | } 15 | } 16 | return ( 17 |
18 |
19 |

20 | {user?.name[0]} 21 |

22 |
23 |
24 |

{user?.name}

25 |

{user?.email}

26 |
27 |
28 | logout 29 |
30 |
31 | ) 32 | } 33 | 34 | export default Footer -------------------------------------------------------------------------------- /public/icons/google.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /public/icons/mastercard.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /public/icons/visa.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "project_banking", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "dev": "next dev", 7 | "build": "next build", 8 | "start": "next start", 9 | "lint": "next lint" 10 | }, 11 | "dependencies": { 12 | "@hookform/resolvers": "^3.9.1", 13 | "@radix-ui/react-dialog": "^1.1.2", 14 | "@radix-ui/react-label": "^2.1.0", 15 | "@radix-ui/react-slot": "^1.1.0", 16 | "@sentry/nextjs": "^8.43.0", 17 | "chart.js": "^4.4.7", 18 | "class-variance-authority": "^0.7.1", 19 | "clsx": "^2.1.1", 20 | "dwolla-v2": "^3.4.0", 21 | "lucide-react": "^0.468.0", 22 | "next": "15.0.4", 23 | "node-appwrite": "^14.1.0", 24 | "plaid": "^30.0.0", 25 | "query-string": "^9.1.1", 26 | "react": "^18.3.1", 27 | "react-chartjs-2": "^5.2.0", 28 | "react-countup": "^6.5.3", 29 | "react-dom": "^18.3.1", 30 | "react-hook-form": "^7.54.0", 31 | "react-plaid-link": "^3.6.1", 32 | "tailwind-merge": "^2.5.5", 33 | "tailwindcss-animate": "^1.0.7", 34 | "zod": "^3.24.1" 35 | }, 36 | "devDependencies": { 37 | "@types/node": "^20", 38 | "@types/react": "^19", 39 | "@types/react-dom": "^19", 40 | "eslint": "^8", 41 | "eslint-config-next": "15.0.4", 42 | "postcss": "^8", 43 | "tailwindcss": "^3.4.1", 44 | "typescript": "^5" 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /public/icons/connect-bank.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /components/Custominput.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { FormControl, FormField, FormLabel, FormMessage } from './ui/form' 3 | import { Input } from './ui/input' 4 | import { Control, FieldPath } from 'react-hook-form' 5 | import { AuthFormSchema } from '@/lib/utils' 6 | import { z } from 'zod' 7 | const formSchema = AuthFormSchema('sign-up'); 8 | interface CustomInput{ 9 | control : Control>, 10 | name : FieldPath>, 11 | label : string, 12 | placeholder : string, 13 | } 14 | const Custominput = ({control , name , label , placeholder} :CustomInput) => { 15 | return ( 16 | ( 20 |
21 | {label} 22 |
23 | 24 | 25 | 26 | 27 |
28 |
29 | 30 | )} 31 | /> 32 | ) 33 | } 34 | 35 | export default Custominput -------------------------------------------------------------------------------- /public/icons/tbfBakery.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /public/icons/dollar-circle.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /components/PlaidLink.tsx: -------------------------------------------------------------------------------- 1 | import React, { useCallback, useState , useEffect} from 'react' 2 | import { Button } from './ui/button' 3 | import {PlaidLinkOptions , PlaidLinkOnSuccess, usePlaidLink} from 'react-plaid-link' 4 | import { StyledString } from 'next/dist/build/swc/types'; 5 | import { useRouter } from 'next/navigation'; 6 | import { createLinkToken, exchangePublicToken } from '@/lib/actions/user.actions'; 7 | const PlaidLink = ({user , variant}:PlaidLinkProps) => { 8 | const router = useRouter(); 9 | const [token, setToken] = useState(''); 10 | useEffect(()=>{ 11 | const getLinkToken = async () =>{ 12 | const data = await createLinkToken(user); 13 | setToken(data?.linkToken) 14 | } 15 | getLinkToken(); 16 | }, []) 17 | const onSuccess = useCallback(async (public_token :string)=>{ 18 | await exchangePublicToken({ 19 | publicToken: public_token, 20 | user, 21 | 22 | }) 23 | router.push('/'); 24 | } , [user]) 25 | const config: PlaidLinkOptions = { 26 | token, 27 | onSuccess 28 | } 29 | const {open , ready} = usePlaidLink(config) 30 | return ( 31 | <> 32 | {variant === 'primary' ? ( 33 | 36 | ):variant === 'ghost' ? ( 37 | 38 | ):( 39 | 40 | ) 41 | } 42 | 43 | ) 44 | } 45 | 46 | export default PlaidLink -------------------------------------------------------------------------------- /components/Sidebar.tsx: -------------------------------------------------------------------------------- 1 | 'use client' 2 | import Link from 'next/link' 3 | import Image from 'next/image' 4 | import React from 'react' 5 | import { sidebarLinks } from '@/constants' 6 | import { cn } from '@/lib/utils' 7 | import { usePathname } from 'next/navigation' 8 | import Footer from './Footer' 9 | 10 | const Sidebar = ({user} : SiderbarProps) => { 11 | const pathname = usePathname(); 12 | return ( 13 |
14 | 44 |
45 |
46 | ) 47 | } 48 | 49 | export default Sidebar -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app). 2 | 3 | ## Getting Started 4 | 5 | First, run the development server: 6 | 7 | ```bash 8 | npm run dev 9 | # or 10 | yarn dev 11 | # or 12 | pnpm dev 13 | # or 14 | bun dev 15 | ``` 16 | 17 | Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. 18 | 19 | You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file. 20 | 21 | This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel. 22 | 23 | ## Learn More 24 | 25 | To learn more about Next.js, take a look at the following resources: 26 | 27 | - [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. 28 | - [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. 29 | 30 | You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome! 31 | 32 | ## Deploy on Vercel 33 | 34 | The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. 35 | 36 | Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details. 37 | -------------------------------------------------------------------------------- /public/icons/a-coffee.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /public/icons/payment-transfer.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /public/icons/money-send.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /components/BankCard.tsx: -------------------------------------------------------------------------------- 1 | import { formatAmount } from '@/lib/utils' 2 | import { uid } from 'chart.js/helpers' 3 | import Image from 'next/image' 4 | import Link from 'next/link' 5 | import React from 'react' 6 | 7 | const BankCard = ({account , userName , showBalance = true} : CreditCardProps) => { 8 | return ( 9 |
10 | 11 |
12 |
13 |

14 | {userName || "Navin"} 15 |

16 |

17 | {formatAmount(account.currentBalance)} 18 |

19 |
20 |
21 |
22 |

23 | {userName} 24 |

25 |

26 | ●● / ●● 27 |

28 | 29 |
30 |

31 | ●●●● ●●●● ●●●● 1234 32 |

33 |
34 |
35 |
36 | pay 41 | Mastercard 48 |
49 | lines 56 | 57 | {/* COPY NUMBER */} 58 |
59 | ) 60 | } 61 | 62 | export default BankCard -------------------------------------------------------------------------------- /components/ui/button.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react" 2 | import { Slot } from "@radix-ui/react-slot" 3 | import { cva, type VariantProps } from "class-variance-authority" 4 | 5 | import { cn } from "@/lib/utils" 6 | 7 | const buttonVariants = cva( 8 | "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", 9 | { 10 | variants: { 11 | variant: { 12 | default: "bg-primary text-primary-foreground hover:bg-primary/90", 13 | destructive: 14 | "bg-destructive text-destructive-foreground hover:bg-destructive/90", 15 | outline: 16 | "border border-input bg-background hover:bg-accent hover:text-accent-foreground", 17 | secondary: 18 | "bg-secondary text-secondary-foreground hover:bg-secondary/80", 19 | ghost: "hover:bg-accent hover:text-accent-foreground", 20 | link: "text-primary underline-offset-4 hover:underline", 21 | }, 22 | size: { 23 | default: "h-10 px-4 py-2", 24 | sm: "h-9 rounded-md px-3", 25 | lg: "h-11 rounded-md px-8", 26 | icon: "h-10 w-10", 27 | }, 28 | }, 29 | defaultVariants: { 30 | variant: "default", 31 | size: "default", 32 | }, 33 | } 34 | ) 35 | 36 | export interface ButtonProps 37 | extends React.ButtonHTMLAttributes, 38 | VariantProps { 39 | asChild?: boolean 40 | } 41 | 42 | const Button = React.forwardRef( 43 | ({ className, variant, size, asChild = false, ...props }, ref) => { 44 | const Comp = asChild ? Slot : "button" 45 | return ( 46 | 51 | ) 52 | } 53 | ) 54 | Button.displayName = "Button" 55 | 56 | export { Button, buttonVariants } 57 | -------------------------------------------------------------------------------- /public/icons/loader.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /public/icons/transaction.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /components/RightSidebar.tsx: -------------------------------------------------------------------------------- 1 | 2 | import Link from 'next/link' 3 | import React from 'react' 4 | import Image from 'next/image' 5 | import BankCard from './BankCard' 6 | 7 | const RightSidebar = ({user , transactions , banks} :RightSidebarProps) => { 8 | return ( 9 | 63 | ) 64 | } 65 | 66 | export default RightSidebar -------------------------------------------------------------------------------- /components/MobileNav.tsx: -------------------------------------------------------------------------------- 1 | 'use client' 2 | import React from 'react' 3 | import Image from 'next/image' 4 | import { 5 | Sheet, 6 | SheetClose, 7 | SheetContent, 8 | SheetDescription, 9 | SheetHeader, 10 | SheetTitle, 11 | SheetTrigger, 12 | } from "@/components/ui/sheet" 13 | import Link from 'next/link' 14 | import { sidebarLinks } from '@/constants' 15 | import { usePathname } from 'next/navigation' 16 | import { cn } from '@/lib/utils' 17 | import Footer from './Footer' 18 | 19 | const MobileNav = ({user} : MobileNavProps) => { 20 | const pathname = usePathname(); 21 | return ( 22 |
23 | 24 | 25 | menu icon 31 | 32 | 33 | 34 | HoriZon Logo 41 |

Horizon

42 | 43 |
44 | 45 | 68 | 69 |
70 |
71 | 72 |
73 |
74 | 75 |
76 | ) 77 | } 78 | 79 | export default MobileNav -------------------------------------------------------------------------------- /next.config.ts: -------------------------------------------------------------------------------- 1 | import {withSentryConfig} from "@sentry/nextjs"; 2 | import type { NextConfig } from "next"; 3 | 4 | const nextConfig: NextConfig = { 5 | /* config options here */ 6 | }; 7 | 8 | export default withSentryConfig(withSentryConfig(nextConfig, { 9 | // For all available options, see: 10 | // https://github.com/getsentry/sentry-webpack-plugin#options 11 | 12 | org: "navin-zy", 13 | project: "javascript-nextjs", 14 | 15 | // Only print logs for uploading source maps in CI 16 | silent: !process.env.CI, 17 | 18 | // For all available options, see: 19 | // https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/ 20 | 21 | // Upload a larger set of source maps for prettier stack traces (increases build time) 22 | widenClientFileUpload: true, 23 | 24 | // Uncomment to route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers. 25 | // This can increase your server load as well as your hosting bill. 26 | // Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client- 27 | // side errors will fail. 28 | // tunnelRoute: "/monitoring", 29 | 30 | // Hides source maps from generated client bundles 31 | hideSourceMaps: true, 32 | 33 | // Automatically tree-shake Sentry logger statements to reduce bundle size 34 | disableLogger: true, 35 | 36 | // Enables automatic instrumentation of Vercel Cron Monitors. (Does not yet work with App Router route handlers.) 37 | // See the following for more information: 38 | // https://docs.sentry.io/product/crons/ 39 | // https://vercel.com/docs/cron-jobs 40 | automaticVercelMonitors: true, 41 | }), { 42 | // For all available options, see: 43 | // https://github.com/getsentry/sentry-webpack-plugin#options 44 | 45 | org: "navin-zy", 46 | project: "javascript-nextjs", 47 | 48 | // Only print logs for uploading source maps in CI 49 | silent: !process.env.CI, 50 | 51 | // For all available options, see: 52 | // https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/ 53 | 54 | // Upload a larger set of source maps for prettier stack traces (increases build time) 55 | widenClientFileUpload: true, 56 | 57 | // Uncomment to route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers. 58 | // This can increase your server load as well as your hosting bill. 59 | // Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client- 60 | // side errors will fail. 61 | // tunnelRoute: "/monitoring", 62 | 63 | // Hides source maps from generated client bundles 64 | hideSourceMaps: true, 65 | 66 | // Automatically tree-shake Sentry logger statements to reduce bundle size 67 | disableLogger: true, 68 | 69 | // Enables automatic instrumentation of Vercel Cron Monitors. (Does not yet work with App Router route handlers.) 70 | // See the following for more information: 71 | // https://docs.sentry.io/product/crons/ 72 | // https://vercel.com/docs/cron-jobs 73 | automaticVercelMonitors: true, 74 | }); 75 | module.exports = { 76 | reactStrictMode: true, 77 | devIndicators: { 78 | autoPrerender: false, 79 | }, 80 | }; -------------------------------------------------------------------------------- /tailwind.config.ts: -------------------------------------------------------------------------------- 1 | import type { Config } from "tailwindcss"; 2 | 3 | const config = { 4 | darkMode: ["class"], 5 | content: [ 6 | "./pages/**/*.{ts,tsx}", 7 | "./components/**/*.{ts,tsx}", 8 | "./app/**/*.{ts,tsx}", 9 | "./src/**/*.{ts,tsx}", 10 | "./constants/**/*.{ts,tsx}", 11 | ], 12 | prefix: "", 13 | theme: { 14 | container: { 15 | center: true, 16 | padding: "2rem", 17 | screens: { 18 | "2xl": "1400px", 19 | }, 20 | }, 21 | extend: { 22 | colors: { 23 | fill: { 24 | 1: "rgba(255, 255, 255, 0.10)", 25 | }, 26 | bankGradient: "#0179FE", 27 | indigo: { 28 | 500: "#6172F3", 29 | 700: "#3538CD", 30 | }, 31 | success: { 32 | 25: "#F6FEF9", 33 | 50: "#ECFDF3", 34 | 100: "#D1FADF", 35 | 600: "#039855", 36 | 700: "#027A48", 37 | 900: "#054F31", 38 | }, 39 | pink: { 40 | 25: "#FEF6FB", 41 | 100: "#FCE7F6", 42 | 500: "#EE46BC", 43 | 600: "#DD2590", 44 | 700: "#C11574", 45 | 900: "#851651", 46 | }, 47 | blue: { 48 | 25: "#F5FAFF", 49 | 100: "#D1E9FF", 50 | 500: "#2E90FA", 51 | 600: "#1570EF", 52 | 700: "#175CD3", 53 | 900: "#194185", 54 | }, 55 | sky: { 56 | 1: "#F3F9FF", 57 | }, 58 | black: { 59 | 1: "#00214F", 60 | 2: "#344054", 61 | }, 62 | gray: { 63 | 25: "#FCFCFD", 64 | 200: "#EAECF0", 65 | 300: "#D0D5DD", 66 | 500: "#667085", 67 | 600: "#475467", 68 | 700: "#344054", 69 | 900: "#101828", 70 | }, 71 | }, 72 | backgroundImage: { 73 | "bank-gradient": "linear-gradient(90deg, #0179FE 0%, #4893FF 100%)", 74 | "gradient-mesh": "url('/icons/gradient-mesh.svg')", 75 | "bank-green-gradient": 76 | "linear-gradient(90deg, #01797A 0%, #489399 100%)", 77 | }, 78 | boxShadow: { 79 | form: "0px 1px 2px 0px rgba(16, 24, 40, 0.05)", 80 | chart: 81 | "0px 1px 3px 0px rgba(16, 24, 40, 0.10), 0px 1px 2px 0px rgba(16, 24, 40, 0.06)", 82 | profile: 83 | "0px 12px 16px -4px rgba(16, 24, 40, 0.08), 0px 4px 6px -2px rgba(16, 24, 40, 0.03)", 84 | creditCard: "8px 10px 16px 0px rgba(0, 0, 0, 0.05)", 85 | }, 86 | fontFamily: { 87 | inter: "var(--font-inter)", 88 | "ibm-plex-serif": "var(--font-ibm-plex-serif)", 89 | }, 90 | keyframes: { 91 | "accordion-down": { 92 | from: { height: "0" }, 93 | to: { height: "var(--radix-accordion-content-height)" }, 94 | }, 95 | "accordion-up": { 96 | from: { height: "var(--radix-accordion-content-height)" }, 97 | to: { height: "0" }, 98 | }, 99 | }, 100 | animation: { 101 | "accordion-down": "accordion-down 0.2s ease-out", 102 | "accordion-up": "accordion-up 0.2s ease-out", 103 | }, 104 | }, 105 | }, 106 | plugins: [require("tailwindcss-animate")], 107 | } satisfies Config; 108 | 109 | export default config; 110 | -------------------------------------------------------------------------------- /lib/actions/dwolla.actions.ts: -------------------------------------------------------------------------------- 1 | "use server"; 2 | 3 | import { Client } from "dwolla-v2"; 4 | 5 | const getEnvironment = (): "production" | "sandbox" => { 6 | const environment = process.env.DWOLLA_ENV as string; 7 | 8 | switch (environment) { 9 | case "sandbox": 10 | return "sandbox"; 11 | case "production": 12 | return "production"; 13 | default: 14 | throw new Error( 15 | "Dwolla environment should either be set to `sandbox` or `production`" 16 | ); 17 | } 18 | }; 19 | const appKey = "nm6D9mZoZMsR3iM3eBRQcfL0euonEsV8kKvwppD7yfEec6S7QB" 20 | const appSecret = "oIHpEl7ZWucyHURnJR1xtN5jiuRSAZc2mFmtf7tih4RZcawfkr" 21 | const dwollaClient = new Client({ 22 | 23 | environment: getEnvironment(), 24 | key: appKey, 25 | secret: appSecret, 26 | }); 27 | 28 | // Create a Dwolla Funding Source using a Plaid Processor Token 29 | export const createFundingSource = async ( 30 | options: CreateFundingSourceOptions 31 | ) => { 32 | try { 33 | return await dwollaClient 34 | .post(`customers/${options.customerId}/funding-sources`, { 35 | name: options.fundingSourceName, 36 | plaidToken: options.plaidToken, 37 | }) 38 | .then((res) => res.headers.get("location")); 39 | } catch (err) { 40 | console.error("Creating a Funding Source Failed: ", err); 41 | } 42 | }; 43 | 44 | export const createOnDemandAuthorization = async () => { 45 | try { 46 | const onDemandAuthorization = await dwollaClient.post( 47 | "on-demand-authorizations" 48 | ); 49 | const authLink = onDemandAuthorization.body._links; 50 | return authLink; 51 | } catch (err) { 52 | console.error("Creating an On Demand Authorization Failed: ", err); 53 | } 54 | }; 55 | 56 | export const createDwollaCustomer = async ( 57 | newCustomer: NewDwollaCustomerParams 58 | ) => { 59 | try { 60 | return await dwollaClient.post("customers", newCustomer) 61 | .then((res) => res.headers.get("location")); 62 | 63 | } catch (err) { 64 | console.error("Creating a Dwolla Customer Failed: ", err); 65 | } 66 | }; 67 | 68 | export const createTransfer = async ({ 69 | sourceFundingSourceUrl, 70 | destinationFundingSourceUrl, 71 | amount, 72 | }: TransferParams) => { 73 | try { 74 | const requestBody = { 75 | _links: { 76 | source: { 77 | href: sourceFundingSourceUrl, 78 | }, 79 | destination: { 80 | href: destinationFundingSourceUrl, 81 | }, 82 | }, 83 | amount: { 84 | currency: "INR", 85 | value: amount, 86 | }, 87 | }; 88 | return await dwollaClient 89 | .post("transfers", requestBody) 90 | .then((res) => res.headers.get("location")); 91 | } catch (err) { 92 | console.error("Transfer fund failed: ", err); 93 | } 94 | }; 95 | 96 | export const addFundingSource = async ({ 97 | dwollaCustomerId, 98 | processorToken, 99 | bankName, 100 | }: AddFundingSourceParams) => { 101 | try { 102 | // create dwolla auth link 103 | const dwollaAuthLinks = await createOnDemandAuthorization(); 104 | 105 | // add funding source to the dwolla customer & get the funding source url 106 | const fundingSourceOptions = { 107 | customerId: dwollaCustomerId, 108 | fundingSourceName: bankName, 109 | plaidToken: processorToken, 110 | _links: dwollaAuthLinks, 111 | }; 112 | return await createFundingSource(fundingSourceOptions); 113 | } catch (err) { 114 | console.error("Transfer fund failed: ", err); 115 | } 116 | }; -------------------------------------------------------------------------------- /constants/index.ts: -------------------------------------------------------------------------------- 1 | export const sidebarLinks = [ 2 | { 3 | imgURL: "/icons/home.svg", 4 | route: "/", 5 | label: "Home", 6 | }, 7 | { 8 | imgURL: "/icons/dollar-circle.svg", 9 | route: "/my-banks", 10 | label: "My Banks", 11 | }, 12 | { 13 | imgURL: "/icons/transaction.svg", 14 | route: "/transaction-history", 15 | label: "Transaction History", 16 | }, 17 | { 18 | imgURL: "/icons/money-send.svg", 19 | route: "/payment-transfer", 20 | label: "Transfer Funds", 21 | }, 22 | ]; 23 | 24 | // good_user / good_password - Bank of America 25 | export const TEST_USER_ID = "6627ed3d00267aa6fa3e"; 26 | 27 | // custom_user -> Chase Bank 28 | // export const TEST_ACCESS_TOKEN = 29 | // "access-sandbox-da44dac8-7d31-4f66-ab36-2238d63a3017"; 30 | 31 | // custom_user -> Chase Bank 32 | export const TEST_ACCESS_TOKEN = 33 | "access-sandbox-229476cf-25bc-46d2-9ed5-fba9df7a5d63"; 34 | 35 | export const ITEMS = [ 36 | { 37 | id: "6624c02e00367128945e", // appwrite item Id 38 | accessToken: "access-sandbox-83fd9200-0165-4ef8-afde-65744b9d1548", 39 | itemId: "VPMQJKG5vASvpX8B6JK3HmXkZlAyplhW3r9xm", 40 | userId: "6627ed3d00267aa6fa3e", 41 | accountId: "X7LMJkE5vnskJBxwPeXaUWDBxAyZXwi9DNEWJ", 42 | }, 43 | { 44 | id: "6627f07b00348f242ea9", // appwrite item Id 45 | accessToken: "access-sandbox-74d49e15-fc3b-4d10-a5e7-be4ddae05b30", 46 | itemId: "Wv7P6vNXRXiMkoKWPzeZS9Zm5JGWdXulLRNBq", 47 | userId: "6627ed3d00267aa6fa3e", 48 | accountId: "x1GQb1lDrDHWX4BwkqQbI4qpQP1lL6tJ3VVo9", 49 | }, 50 | ]; 51 | 52 | export const topCategoryStyles = { 53 | "Food and Drink": { 54 | bg: "bg-blue-25", 55 | circleBg: "bg-blue-100", 56 | text: { 57 | main: "text-blue-900", 58 | count: "text-blue-700", 59 | }, 60 | progress: { 61 | bg: "bg-blue-100", 62 | indicator: "bg-blue-700", 63 | }, 64 | icon: "/icons/monitor.svg", 65 | }, 66 | Travel: { 67 | bg: "bg-success-25", 68 | circleBg: "bg-success-100", 69 | text: { 70 | main: "text-success-900", 71 | count: "text-success-700", 72 | }, 73 | progress: { 74 | bg: "bg-success-100", 75 | indicator: "bg-success-700", 76 | }, 77 | icon: "/icons/coins.svg", 78 | }, 79 | default: { 80 | bg: "bg-pink-25", 81 | circleBg: "bg-pink-100", 82 | text: { 83 | main: "text-pink-900", 84 | count: "text-pink-700", 85 | }, 86 | progress: { 87 | bg: "bg-pink-100", 88 | indicator: "bg-pink-700", 89 | }, 90 | icon: "/icons/shopping-bag.svg", 91 | }, 92 | }; 93 | 94 | export const transactionCategoryStyles = { 95 | "Food and Drink": { 96 | borderColor: "border-pink-600", 97 | backgroundColor: "bg-pink-500", 98 | textColor: "text-pink-700", 99 | chipBackgroundColor: "bg-inherit", 100 | }, 101 | Payment: { 102 | borderColor: "border-success-600", 103 | backgroundColor: "bg-green-600", 104 | textColor: "text-success-700", 105 | chipBackgroundColor: "bg-inherit", 106 | }, 107 | "Bank Fees": { 108 | borderColor: "border-success-600", 109 | backgroundColor: "bg-green-600", 110 | textColor: "text-success-700", 111 | chipBackgroundColor: "bg-inherit", 112 | }, 113 | Transfer: { 114 | borderColor: "border-red-700", 115 | backgroundColor: "bg-red-700", 116 | textColor: "text-red-700", 117 | chipBackgroundColor: "bg-inherit", 118 | }, 119 | Processing: { 120 | borderColor: "border-[#F2F4F7]", 121 | backgroundColor: "bg-gray-500", 122 | textColor: "text-[#344054]", 123 | chipBackgroundColor: "bg-[#F2F4F7]", 124 | }, 125 | Success: { 126 | borderColor: "border-[#12B76A]", 127 | backgroundColor: "bg-[#12B76A]", 128 | textColor: "text-[#027A48]", 129 | chipBackgroundColor: "bg-[#ECFDF3]", 130 | }, 131 | default: { 132 | borderColor: "", 133 | backgroundColor: "bg-blue-500", 134 | textColor: "text-blue-700", 135 | chipBackgroundColor: "bg-inherit", 136 | }, 137 | }; 138 | -------------------------------------------------------------------------------- /components/ui/sheet.tsx: -------------------------------------------------------------------------------- 1 | "use client" 2 | 3 | import * as React from "react" 4 | import * as SheetPrimitive from "@radix-ui/react-dialog" 5 | import { cva, type VariantProps } from "class-variance-authority" 6 | import { X } from "lucide-react" 7 | 8 | import { cn } from "@/lib/utils" 9 | 10 | const Sheet = SheetPrimitive.Root 11 | 12 | const SheetTrigger = SheetPrimitive.Trigger 13 | 14 | const SheetClose = SheetPrimitive.Close 15 | 16 | const SheetPortal = SheetPrimitive.Portal 17 | 18 | const SheetOverlay = React.forwardRef< 19 | React.ElementRef, 20 | React.ComponentPropsWithoutRef 21 | >(({ className, ...props }, ref) => ( 22 | 30 | )) 31 | SheetOverlay.displayName = SheetPrimitive.Overlay.displayName 32 | 33 | const sheetVariants = cva( 34 | "fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500", 35 | { 36 | variants: { 37 | side: { 38 | top: "inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top", 39 | bottom: 40 | "inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom", 41 | left: "inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm", 42 | right: 43 | "inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm", 44 | }, 45 | }, 46 | defaultVariants: { 47 | side: "right", 48 | }, 49 | } 50 | ) 51 | 52 | interface SheetContentProps 53 | extends React.ComponentPropsWithoutRef, 54 | VariantProps {} 55 | 56 | const SheetContent = React.forwardRef< 57 | React.ElementRef, 58 | SheetContentProps 59 | >(({ side = "right", className, children, ...props }, ref) => ( 60 | 61 | 62 | 67 | {children} 68 | 69 | 70 | Close 71 | 72 | 73 | 74 | )) 75 | SheetContent.displayName = SheetPrimitive.Content.displayName 76 | 77 | const SheetHeader = ({ 78 | className, 79 | ...props 80 | }: React.HTMLAttributes) => ( 81 |
88 | ) 89 | SheetHeader.displayName = "SheetHeader" 90 | 91 | const SheetFooter = ({ 92 | className, 93 | ...props 94 | }: React.HTMLAttributes) => ( 95 |
102 | ) 103 | SheetFooter.displayName = "SheetFooter" 104 | 105 | const SheetTitle = React.forwardRef< 106 | React.ElementRef, 107 | React.ComponentPropsWithoutRef 108 | >(({ className, ...props }, ref) => ( 109 | 114 | )) 115 | SheetTitle.displayName = SheetPrimitive.Title.displayName 116 | 117 | const SheetDescription = React.forwardRef< 118 | React.ElementRef, 119 | React.ComponentPropsWithoutRef 120 | >(({ className, ...props }, ref) => ( 121 | 126 | )) 127 | SheetDescription.displayName = SheetPrimitive.Description.displayName 128 | 129 | export { 130 | Sheet, 131 | SheetPortal, 132 | SheetOverlay, 133 | SheetTrigger, 134 | SheetClose, 135 | SheetContent, 136 | SheetHeader, 137 | SheetFooter, 138 | SheetTitle, 139 | SheetDescription, 140 | } 141 | -------------------------------------------------------------------------------- /components/ui/form.tsx: -------------------------------------------------------------------------------- 1 | "use client" 2 | 3 | import * as React from "react" 4 | import * as LabelPrimitive from "@radix-ui/react-label" 5 | import { Slot } from "@radix-ui/react-slot" 6 | import { 7 | Controller, 8 | ControllerProps, 9 | FieldPath, 10 | FieldValues, 11 | FormProvider, 12 | useFormContext, 13 | } from "react-hook-form" 14 | 15 | import { cn } from "@/lib/utils" 16 | import { Label } from "@/components/ui/label" 17 | 18 | const Form = FormProvider 19 | 20 | type FormFieldContextValue< 21 | TFieldValues extends FieldValues = FieldValues, 22 | TName extends FieldPath = FieldPath 23 | > = { 24 | name: TName 25 | } 26 | 27 | const FormFieldContext = React.createContext( 28 | {} as FormFieldContextValue 29 | ) 30 | 31 | const FormField = < 32 | TFieldValues extends FieldValues = FieldValues, 33 | TName extends FieldPath = FieldPath 34 | >({ 35 | ...props 36 | }: ControllerProps) => { 37 | return ( 38 | 39 | 40 | 41 | ) 42 | } 43 | 44 | const useFormField = () => { 45 | const fieldContext = React.useContext(FormFieldContext) 46 | const itemContext = React.useContext(FormItemContext) 47 | const { getFieldState, formState } = useFormContext() 48 | 49 | const fieldState = getFieldState(fieldContext.name, formState) 50 | 51 | if (!fieldContext) { 52 | throw new Error("useFormField should be used within ") 53 | } 54 | 55 | const { id } = itemContext 56 | 57 | return { 58 | id, 59 | name: fieldContext.name, 60 | formItemId: `${id}-form-item`, 61 | formDescriptionId: `${id}-form-item-description`, 62 | formMessageId: `${id}-form-item-message`, 63 | ...fieldState, 64 | } 65 | } 66 | 67 | type FormItemContextValue = { 68 | id: string 69 | } 70 | 71 | const FormItemContext = React.createContext( 72 | {} as FormItemContextValue 73 | ) 74 | 75 | const FormItem = React.forwardRef< 76 | HTMLDivElement, 77 | React.HTMLAttributes 78 | >(({ className, ...props }, ref) => { 79 | const id = React.useId() 80 | 81 | return ( 82 | 83 |
84 | 85 | ) 86 | }) 87 | FormItem.displayName = "FormItem" 88 | 89 | const FormLabel = React.forwardRef< 90 | React.ElementRef, 91 | React.ComponentPropsWithoutRef 92 | >(({ className, ...props }, ref) => { 93 | const { error, formItemId } = useFormField() 94 | 95 | return ( 96 |