Skip to content

Repository files navigation

πŸ’° My Loan Plans

Turn financial chaos into a clear plan. Track all your loans, optimize payments, and see exactly when you'll be debt-free.

Next.js React TypeScript Prisma Supabase Tailwind CSS

🌐 Live Demo: www.myloanplans.com


✨ Features

🏦 Loan Management

  • Real-time Amortization Calculations - See your payment schedule instantly
  • Multiple Loan Plans - Track multiple loans simultaneously
  • One-time Payments - Simulate extra payments and see their impact
  • Payment Progress Tracking - Visual progress bars showing debt reduction
  • Recurring Extra Payments - Set up automatic additional payments

πŸ’΅ Budget Management

  • Account Tracking - Manage multiple bank accounts
  • Transaction History - Track income and expenses
  • Category Management - Organize expenses by categories
  • Recurring Expenses - Automate monthly bills and subscriptions
  • Financial Summary - Dashboard with income, expenses, and balance overview
  • Interactive Charts - Visualize spending patterns with Recharts

πŸ” Authentication & Data Persistence

  • Email-based Authentication - Secure login with email verification
  • Hybrid Data Storage - Supabase (PostgreSQL) for authenticated users, localStorage for guests
  • Guest Mode - Try the app without signing up
  • Data Migration - Seamless transition from guest to authenticated user

🎨 User Experience

  • Modern UI/UX - Beautiful, responsive design with Framer Motion animations
  • Dynamic Animations - Smooth, subtle animations throughout the interface
  • Glassmorphism Effects - Modern glass-like UI elements with backdrop blur
  • Gradient Design - Eye-catching gradient buttons and cards
  • Interactive Feedback - Hover effects and smooth transitions
  • Mobile Responsive - Works perfectly on all devices
  • Real-time Updates - Auto-save functionality with debouncing

πŸš€ Getting Started

Prerequisites

  • Node.js 18+ and npm
  • PostgreSQL Database (via Supabase or local)
  • Supabase Account (for production) or SQLite (for development)

Installation

  1. Clone the repository

    git clone https://github.com/cankilic-gh/myloanplans.git
    cd myloanplans
  2. Install dependencies

    npm install
  3. Set up environment variables

    Create a .env.local file in the root directory:

    # Database
    DATABASE_URL="postgresql://user:password@localhost:5432/myloanplans"
    
    # Supabase
    NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
    NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
    SUPABASE_SERVICE_ROLE_KEY=your_service_role_key
    
    # NextAuth
    NEXTAUTH_URL=http://localhost:3000
    NEXTAUTH_SECRET=your_nextauth_secret
    
    # Email (Resend)
    RESEND_API_KEY=your_resend_api_key
  4. Set up the database

    # Generate Prisma Client
    npx prisma generate
    
    # Run migrations
    npx prisma migrate dev
    
    # (Optional) Seed the database
    npx prisma db seed
  5. Run the development server

    npm run dev
  6. Open your browser

    Navigate to http://localhost:3000


πŸ“ Project Structure

myloanplans/
β”œβ”€β”€ app/                          # Next.js App Router
β”‚   β”œβ”€β”€ (dashboard)/              # Dashboard routes
β”‚   β”‚   β”œβ”€β”€ budget/              # Budget management
β”‚   β”‚   β”œβ”€β”€ loans/               # Loan calculator
β”‚   β”‚   └── settings/            # User settings
β”‚   β”œβ”€β”€ api/                     # API routes
β”‚   β”‚   β”œβ”€β”€ auth/                # Authentication endpoints
β”‚   β”‚   β”œβ”€β”€ budget/              # Budget API endpoints
β”‚   β”‚   └── loan-plans/          # Loan plans API endpoints
β”‚   β”œβ”€β”€ calculator/              # Calculator page
β”‚   β”œβ”€β”€ dashboard/               # Main dashboard
β”‚   └── page.tsx                 # Landing page
β”œβ”€β”€ components/                  # React components
β”‚   β”œβ”€β”€ budget/                  # Budget components
β”‚   β”œβ”€β”€ landing/                 # Landing page components
β”‚   └── ui/                      # Reusable UI components
β”œβ”€β”€ lib/                         # Utilities and helpers
β”‚   β”œβ”€β”€ api/                     # API client functions
β”‚   β”œβ”€β”€ prisma.ts                # Prisma client
β”‚   β”œβ”€β”€ storage.ts               # localStorage utilities
β”‚   └── supabase.ts              # Supabase client
β”œβ”€β”€ prisma/                      # Database schema and migrations
β”‚   β”œβ”€β”€ schema.prisma            # Prisma schema
β”‚   └── migrations/              # Database migrations
β”œβ”€β”€ utils/                       # Utility functions
β”‚   └── mortgageMath.ts          # Loan calculation logic
└── stores/                      # Zustand state management
    └── useUIStore.ts            # UI state store

πŸ›  Tech Stack

Frontend

  • Next.js 16.1 - React framework with App Router
  • React 19.2 - UI library
  • TypeScript 5.0 - Type safety
  • Tailwind CSS 4.0 - Utility-first CSS framework
  • Framer Motion - Animation library
  • Recharts - Chart library for data visualization
  • Lucide React - Icon library
  • Zustand - Lightweight state management

Backend

  • Next.js API Routes - Serverless API endpoints
  • Prisma 6.19 - Type-safe ORM
  • Supabase - PostgreSQL database and auth
  • NextAuth.js 5.0 - Authentication
  • Resend - Email service

Database

  • PostgreSQL (via Supabase) - Production database
  • SQLite (via Prisma) - Development database

πŸ“– Usage

Creating a Loan Plan

  1. Navigate to the Loans section
  2. Click "Add New Plan"
  3. Enter loan details:
    • Principal amount
    • Annual interest rate
    • Loan term (months)
    • Optional: Down payment, recurring extra payments
  4. View your amortization schedule and payment breakdown

Managing Budget

  1. Go to the Budget section
  2. Add accounts (checking, savings, etc.)
  3. Create categories for expenses
  4. Add transactions (income/expenses)
  5. Set up recurring expenses
  6. View financial summary and charts

Guest Mode vs. Authenticated

  • Guest Mode: Data stored in localStorage, works offline
  • Authenticated: Data synced to Supabase, accessible across devices
  • Migration: Guest data automatically migrates when you sign up

πŸ”§ Development

Available Scripts

# Development
npm run dev          # Start development server

# Production
npm run build        # Build for production
npm run start        # Start production server

# Code Quality
npm run lint         # Run ESLint

Database Management

# Create a new migration
npx prisma migrate dev --name migration_name

# Reset database (development only)
npx prisma migrate reset

# Open Prisma Studio (database GUI)
npx prisma studio

# Generate Prisma Client
npx prisma generate

🚒 Deployment

Vercel (Recommended)

  1. Push your code to GitHub
  2. Import project in Vercel
  3. Add environment variables
  4. Deploy!

Environment Variables for Production

Make sure to set all required environment variables in your deployment platform:

  • DATABASE_URL
  • NEXT_PUBLIC_SUPABASE_URL
  • NEXT_PUBLIC_SUPABASE_ANON_KEY
  • SUPABASE_SERVICE_ROLE_KEY
  • NEXTAUTH_URL
  • NEXTAUTH_SECRET
  • RESEND_API_KEY

πŸ“ License

This project is private and proprietary.


πŸ‘€ Author

Can Kilic


πŸ™ Acknowledgments

About

Financial planning tools with interactive data visualization. Calculate loans, compare plans, and make informed decisions.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages