Thanks to visit codestin.com
Credit goes to github.com

Skip to content

πŸ’° Smart expense splitting app built with Next.js 15, Convex, and AI. Track shared expenses, split bills (equal/percentage/exact), manage groups, and get AI-powered spending insights. Perfect for roommates, trips, and group events! πŸš€

Nishant-0203/Mydues

Repository files navigation

πŸ’° Mydues

Split expenses smartly with friends

Next.js React Tailwind CSS Convex Clerk

Track shared expenses, split bills with precision, and settle up effortlessly with your friends, roommates, and family.

Features β€’ Tech Stack β€’ Getting Started β€’ Documentation


✨ Features

πŸ’Έ Smart Expense Splitting

  • Multiple split types: Equal, percentage, or exact amounts
  • Category tracking: 20+ expense categories (food, travel, utilities, etc.)
  • One-on-one & group expenses: Track with individuals or entire groups
  • Receipt details: Add descriptions, dates, and notes

πŸ‘₯ Group Management

  • Create unlimited groups: Roommates, trips, events, and more
  • Role-based access: Admin and member permissions
  • Member tracking: See who joined when
  • Group balances: Real-time debt calculations

πŸ’³ Settlement System

  • Easy payments: Record settlements between users
  • Settlement history: Track all past payments
  • Automated calculations: Know exactly who owes what
  • Related expenses: Link settlements to specific expenses

πŸ“Š Smart Dashboard

  • Balance overview: See all your debts and credits at a glance
  • Expense summaries: Monthly spending charts with Recharts
  • Quick actions: Add expenses or settle up in one click
  • Group overview: All your groups in one place

πŸ€– AI-Powered Insights

  • Monthly reports: AI-generated spending analysis via Google Gemini
  • Personalized recommendations: Get actionable financial advice
  • Spending patterns: Identify trends and unusual expenses
  • Category breakdown: See where your money goes

πŸ”” Smart Notifications

  • Payment reminders: Daily automated emails for outstanding debts
  • Real-time updates: Toast notifications for all actions
  • Email summaries: Monthly spending insights delivered to your inbox
  • Customizable alerts: Stay on top of your finances

πŸš€ Tech Stack

Next.js
Next.js 15
App Router + RSC
React
React 19
Latest features
Tailwind
Tailwind CSS 4
Modern styling
Convex
Convex
Backend + DB
Clerk
Clerk
Authentication

Core Technologies

Category Technologies
Frontend Next.js 15, React 19, Tailwind CSS 4, shadcn/ui, Radix UI, Framer Motion
Backend Convex (serverless backend & database), Inngest (background jobs)
Authentication Clerk (OAuth, email/password, session management)
AI & Email Google Gemini API, Resend (transactional emails)
Form Handling React Hook Form, Zod (validation)
UI Components Lucide Icons, Recharts, React Day Picker, Sonner (toasts)
Build Tools Turbopack, ESLint, PostCSS

🏁 Getting Started

Prerequisites

Installation

  1. Clone the repository

    git clone https://github.com/Nishant-0203/Mydues.git
    cd Mydues
  2. Install dependencies

    npm install
    # or
    yarn install
    # or
    pnpm install
  3. Set up environment variables

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

    # πŸ” Clerk Authentication
    NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_xxxxx
    CLERK_SECRET_KEY=sk_test_xxxxx
    
    # πŸ—„οΈ Convex Database
    NEXT_PUBLIC_CONVEX_URL=https://your-deployment.convex.cloud
    
    # πŸ“§ Resend Email Service
    RESEND_API_KEY=re_xxxxx
    
    # πŸ€– Google Gemini AI
    GEMINI_API_KEY=AIzaSyxxxxx
    
    # ⚑ Inngest (optional - for local testing)
    INNGEST_SIGNING_KEY=signkey-xxxxx
    INNGEST_EVENT_KEY=your-event-key
  4. Initialize Convex

    npx convex dev

    This will:

    • Create your Convex deployment
    • Generate the database schema
    • Provide your NEXT_PUBLIC_CONVEX_URL
  5. Configure Clerk

    • Create a Clerk application
    • Enable email/password authentication
    • Add your Clerk keys to .env.local
    • Configure redirect URLs in Clerk dashboard
  6. Start the development server

    npm run dev

    Open http://localhost:3000 in your browser

🌱 Seed Database (Optional)

To populate your database with sample data:

npx convex run seed:seedDatabase

This creates:

  • Sample users
  • Test groups
  • Example expenses
  • Mock settlements

πŸ“œ NPM Scripts

Command Description
npm run dev Start development server with Turbopack
npm run build Build for production
npm start Start production server
npm run lint Run ESLint

πŸ” Authentication & Security

Clerk handles authentication with route protection via middleware.js. Protected routes (/dashboard, /expenses, /contacts, /groups, /person, /settlements) require authentication. Public routes: /, /sign-in, /sign-up.


πŸ—„οΈ Database Schema (Convex)

Tables

πŸ‘€ users

{
  name: string,
  email: string,
  tokenIdentifier: string,
  imageUrl?: string
}

Indexes: by_token, by_email, by_name
Search: search_name, search_email

πŸ’° expenses

{
  description: string,
  amount: number,
  category?: string,
  date: timestamp,
  paidByUserId: Id<"users">,
  splitType: "equal" | "percentage" | "exact",
  splits: [{
    userId: Id<"users">,
    amount: number,
    paid: boolean
  }],
  groupId?: Id<"groups">,
  createdBy: Id<"users">
}

Indexes: by_group, by_user_and_group, by_date

πŸ‘₯ groups

{
  name: string,
  description?: string,
  createdBy: Id<"users">,
  members: [{
    userId: Id<"users">,
    role: "admin" | "member",
    joinedAt: timestamp
  }]
}

πŸ’³ settlements

{
  amount: number,
  note?: string,
  date: timestamp,
  paidByUserId: Id<"users">,
  receivedByUserId: Id<"users">,
  groupId?: Id<"groups">,
  relatedExpenseIds?: Id<"expenses">[],
  createdBy: Id<"users">
}

Indexes: by_group, by_user_and_group, by_reciever_and_group, by_date


⚑ Background Jobs (Inngest)

πŸ“¬ Daily Payment Reminders (0 10 * * *)

Sends automated emails to users with outstanding debts via Resend API.

πŸ“Š Monthly Spending Insights (0 8 1 * *)

AI-powered spending analysis using Google Gemini. Generates personalized monthly reports with category breakdowns, spending patterns, and recommendations.

Setup: Deploy app β†’ Configure endpoint at Inngest dashboard β†’ Enable cron permissions


🎨 UI & Styling

Tailwind CSS 4 with PostCSS plugin for modern styling. shadcn/ui components built with Radix UI for accessibility. Purple/Blue gradient theme with Inter font. Includes Accordion, Avatar, Badge, Button, Calendar, Card, Dialog, Input, Select, Tabs, and more.


οΏ½ Expense Categories

Supports 20+ categories: πŸ• Food & Drink, β˜• Coffee, πŸ›’ Groceries, πŸ›οΈ Shopping, ✈️ Travel, πŸš— Transportation, 🏠 Housing, 🎬 Entertainment, 🎟️ Tickets, πŸ“‘ Utilities, πŸ’§ Water, πŸŽ“ Education, πŸ₯ Health, ❀️ Personal, 🎁 Gifts, πŸ“± Technology, πŸ’³ Bills & Fees, πŸ‘Ά Baby & Kids, 🎡 Music, πŸ“š Books, πŸ’Ό General


πŸš€ Deployment

Recommended Stack: Vercel (Frontend) + Convex (DB) + Clerk (Auth) + Resend (Email) + Inngest (Cron)

Steps: Deploy to Vercel β†’ Add env vars β†’ Run npx convex deploy β†’ Configure Clerk redirects β†’ Set Inngest endpoint

Checklist: βœ… Environment variables βœ… Clerk redirects βœ… Convex deployed βœ… Inngest verified βœ… Cron jobs enabled


πŸ“ License

Proprietary β€” All rights reserved. Private project not licensed for public use.


Built with ❀️ using Next.js, Convex, and modern web technologies

⭐ Star this repo if you find it helpful!

About

πŸ’° Smart expense splitting app built with Next.js 15, Convex, and AI. Track shared expenses, split bills (equal/percentage/exact), manage groups, and get AI-powered spending insights. Perfect for roommates, trips, and group events! πŸš€

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published