Skip to content

pavan6cs/SwiftSplit

Repository files navigation

SwiftSplit πŸ’°

A modern, real-time expense splitting app built with Next.js and Firebase.

Split bills with friends effortlessly! Track expenses, manage groups, and settle up with ease.

Next.js TypeScript Firebase License

SwiftSplit Banner


✨ Features

  • πŸš€ Real-time Updates - See changes instantly across all devices
  • πŸ‘₯ Group Management - Create and manage expense groups
  • πŸ’Έ Bill Splitting - Split expenses equally or by custom amounts
  • πŸ“Š Analytics - Visualize spending patterns with charts
  • πŸ” Secure Authentication - Firebase Auth with email/password
  • 🎨 Beautiful UI - Modern design with Tailwind CSS and Radix UI
  • πŸ“± Responsive - Works perfectly on mobile and desktop
  • πŸŒ™ Dark Mode - Easy on the eyes (coming soon)
  • πŸ’Ύ Offline Support - Continue tracking expenses without internet

πŸš€ Quick Start

Prerequisites

Installation

  1. Clone the repository

    git clone https://github.com/pavan6cs/SwiftSplit.git
    cd SwiftSplit
  2. Install dependencies

    npm install
  3. Set up Firebase

    • Create a new Firebase project at Firebase Console
    • Enable Authentication (Email/Password)
    • Enable Firestore Database
    • Copy your Firebase config
  4. Configure environment variables

    cp .env.example .env.local

    Edit .env.local with your Firebase credentials:

    NEXT_PUBLIC_FIREBASE_API_KEY=your_api_key
    NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=your_project.firebaseapp.com
    NEXT_PUBLIC_FIREBASE_PROJECT_ID=your_project_id
    NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=your_project.appspot.com
    NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=your_sender_id
    NEXT_PUBLIC_FIREBASE_APP_ID=your_app_id
  5. Set up Firestore Security Rules

    In Firebase Console β†’ Firestore Database β†’ Rules, add:

    rules_version = '2';
    service cloud.firestore {
      match /databases/{database}/documents {
        match /users/{userId} {
          allow read: if request.auth != null;
          allow write: if request.auth.uid == userId;
        }
        match /groups/{groupId} {
          allow read, write: if request.auth != null && 
            request.auth.uid in resource.data.members;
        }
        match /bills/{billId} {
          allow read, write: if request.auth != null;
        }
        match /activities/{activityId} {
          allow read: if request.auth != null && 
            request.auth.uid in resource.data.involved;
        }
      }
    }
    
  6. Run the development server

    npm run dev
  7. Open your browser

    http://localhost:9002
    

πŸ“ Project Structure

SwiftSplit/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ app/                    # Next.js app directory
β”‚   β”‚   β”œβ”€β”€ dashboard/          # Dashboard page
β”‚   β”‚   β”œβ”€β”€ groups/             # Group management pages
β”‚   β”‚   β”œβ”€β”€ profile/            # User profile
β”‚   β”‚   └── page.tsx            # Landing/auth page
β”‚   β”œβ”€β”€ components/             # React components
β”‚   β”‚   β”œβ”€β”€ modals/             # Dialog components
β”‚   β”‚   β”œβ”€β”€ pages/              # Page-specific components
β”‚   β”‚   β”œβ”€β”€ layout/             # Layout components
β”‚   β”‚   └── ui/                 # UI components (Radix/shadcn)
β”‚   β”œβ”€β”€ context/                # React context providers
β”‚   β”‚   └── AuthContext.tsx     # Authentication state
β”‚   β”œβ”€β”€ hooks/                  # Custom React hooks
β”‚   β”‚   β”œβ”€β”€ data/               # Data fetching hooks
β”‚   β”‚   └── calculations/       # Calculation hooks
β”‚   β”œβ”€β”€ lib/                    # Utilities and helpers
β”‚   β”‚   β”œβ”€β”€ utils/              # Utility functions
β”‚   β”‚   β”œβ”€β”€ firebase.ts         # Firebase configuration
β”‚   β”‚   └── types.ts            # TypeScript types
β”‚   └── ai/                     # AI features (Genkit)
β”œβ”€β”€ public/                     # Static assets
β”œβ”€β”€ .env.example                # Environment variables template
β”œβ”€β”€ next.config.ts              # Next.js configuration
β”œβ”€β”€ tailwind.config.ts          # Tailwind CSS configuration
└── tsconfig.json               # TypeScript configuration

πŸ› οΈ Tech Stack

Frontend

Backend & Database

  • BaaS: Firebase
  • Database: Firestore (NoSQL)
  • Authentication: Firebase Auth
  • Hosting: Firebase Hosting / Vercel

Development

  • Package Manager: npm
  • Linting: ESLint
  • Type Checking: TypeScript

🎯 Key Features Explained

1. Real-time Expense Tracking

  • Create bills and split them among group members
  • Support for equal splits or custom amounts
  • Track who owes whom with real-time balance updates

2. Group Management

  • Create multiple groups for different friend circles
  • Add/remove members dynamically
  • View group analytics and spending patterns

###3. Smart Balances

  • Automatic calculation of who owes whom
  • Simplified settlement suggestions
  • Direct friend-to-friend expenses

4. Activity Feed

  • Track all group activities
  • See who added what expense
  • Monitor settlements and payments

5. User Profiles

  • Manage personal information
  • View expense history
  • Track all group memberships

πŸ”’ Security

This project implements several security best practices:

  • βœ… Environment variables for sensitive data
  • βœ… Firebase security rules for database access control
  • βœ… User-friendly error messages (no system info leakage)
  • βœ… Input validation with Zod
  • βœ… Password reset functionality
  • ⚠️ See SECURITY.md for details

Important: Never commit .env.local or any files containing secrets!


πŸ“š Documentation


🀝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ› Bug Reports & Feature Requests

Found a bug? Have a feature idea? Please open an issue!

Security Issues

Please report security vulnerabilities to pavankumar6cs@gmail.com instead of opening public issues.


πŸ“ Scripts

# Development
npm run dev          # Start development server (port 9002)

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

# Code Quality
npm run lint         # Run ESLint
npm run typecheck    # Run TypeScript compiler check

# AI Features (optional)
npm run genkit:dev   # Start Genkit development

🌐 Deployment

Vercel (Recommended)

Deploy with Vercel

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

Firebase Hosting

# Install Firebase CLI
npm install -g firebase-tools

# Login to Firebase
firebase login

# Initialize hosting
firebase init hosting

# Deploy
npm run build
firebase deploy

πŸ—ΊοΈ Roadmap

  • Basic expense tracking
  • Group management
  • Real-time updates
  • User authentication
  • Analytics dashboard
  • Dark mode
  • Push notifications
  • Export to CSV/PDF
  • Multiple currencies
  • Receipt scanning (AI)
  • Mobile app (React Native)

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ‘ Acknowledgments


πŸ“§ Contact

Pavan Kumar - @pavan6cs - pavankumar6cs@gmail.com

Project Link: https://github.com/pavan6cs/SwiftSplit


⭐ Star History

If you find this project useful, please consider giving it a star!

Star History Chart


Made with ❀️ by Pavan Kumar

About

Bill split app created using firestudio & Antigravity

Resources

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages