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

Skip to content

This project is still in development. Always use dummy (random) email and password so it will not affect if data gets corrupts

Notifications You must be signed in to change notification settings

SANDEEPNEGI07/SplitFree

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

65 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ’° SplitFree - Expense Splitting Application

A modern, full-stack expense splitting application built with Flask and React, designed to help friends and groups manage shared expenses with ease.

License: MIT Python React Flask

🌟 Overview

SplitFree simplifies expense management for groups by automatically calculating who owes whom and how much. Whether you're splitting restaurant bills, shared apartment expenses, or travel costs, SplitFree handles the complex calculations and keeps everyone informed about their financial obligations.

πŸš€ Features

πŸ“± Key Features

Feature Description
πŸ” Authentication Secure login/signup with JWT tokens
πŸ‘₯ Group Management Create groups, add/remove members
οΏ½ Group Invitations Invite members via email or shareable codes
πŸ”— Invite Codes Generate SPLIT-ABC123 format codes for easy joining
οΏ½πŸ’³ Expense Tracking Add expenses, automatic equal splitting
πŸ’° Balance Calculation Real-time who-owes-whom calculations
πŸ“Š Settlement System Record payments between members
πŸ“± Responsive Design Works on desktop and mobile
  • πŸ‘₯ Create Groups - Organize expenses with roommates, friends, or travel buddies
  • οΏ½ Invite Members - Send email invitations or share SPLIT-ABC123 codes
  • πŸ”“ Public/Private Groups - Control group visibility and joining methods
  • οΏ½πŸ’³ Add Expenses - Record shared costs and automatically split them equally
  • πŸ’° Track Balances - See who owes what at a glance
  • πŸ“Š Settle Up - Record payments and keep balances updated
  • πŸ”’ Stay Secure - JWT authentication keeps your data safe

πŸ› οΈ Tech Stack

Backend

  • 🐍 Python - Programming language
  • 🌢️ Flask - Web framework
  • πŸ—„οΈ SQLAlchemy - Database ORM
  • πŸ” JWT - Authentication
  • πŸ“š Swagger - API documentation
  • 🐳 Docker - Containerization

Frontend

  • βš›οΈ React 18 - UI library
  • 🎨 CSS3 - Styling
  • 🌐 Axios - HTTP client
  • πŸ›£οΈ React Router - Navigation

Database

  • πŸ’Ύ SQLite - Development database
  • 🐘 PostgreSQL - Production ready

⚠️ Limitations

  • Equal splits only (no custom percentages)
  • No expense categories
  • Manual payment recording

πŸš€ Coming Soon

  • πŸ“Š Custom split ratios
  • 🏷️ Expense categories
  • πŸ“Έ Receipt photos
  • πŸ”” Push notifications

πŸ“¦ Installation & Setup

Prerequisites

  • Python 3.8+
  • Node.js 14+
  • npm or yarn

Backend Setup

  1. Clone the repository

    git clone <repository-url>
    cd splitwise
  2. Create and activate virtual environment

    python -m venv .venv
    .venv\Scripts\activate  # Windows
    # or
    source .venv/bin/activate  # Linux/Mac
  3. Install Python dependencies

    pip install -r requirements.txt
  4. Set up environment variables (optional)

    # Create .env file for custom configurations
    echo "JWT_SECRET_KEY=your-secret-key" > .env
  5. Initialize database

    flask db upgrade
  6. Start the backend server

    python app.py

    Backend will run on http://localhost:5000

Frontend Setup

  1. Navigate to frontend directory

    cd frontend
  2. Install dependencies

    npm install
  3. Start the development server

    npm start

    Frontend will run on http://localhost:3000

🚦 Quick Start

  1. Start the backend server (python app.py)
  2. Start the frontend server (cd frontend && npm start)
  3. Open http://localhost:3000 in your browser
  4. Register a new account or login
  5. Create groups and start splitting expenses!

πŸ“‹ API Endpoints

Authentication

  • POST /register - User registration
  • POST /login - User login
  • POST /logout - User logout
  • POST /refresh - Refresh JWT token

Groups

  • GET /group - Get user's groups
  • POST /group - Create new group
  • GET /group/{id} - Get group details
  • DELETE /group/{id} - Delete group
  • POST /group/{id}/user - Add user to group
  • DELETE /group/{id}/user/{user_id} - Remove user from group

Expenses

  • GET /group/{id}/expense - Get group expenses
  • POST /group/{id}/expense - Create new expense
  • GET /group/{id}/expense/{expense_id} - Get expense details
  • DELETE /group/{id}/expense/{expense_id} - Delete expense

Users

  • GET /user - Search users
  • GET /user/{id} - Get user details

πŸ” Security Features

  • JWT-based authentication with refresh tokens
  • Authorization checks for all group/expense operations
  • Users can only access groups they are members of
  • Password hashing with secure algorithms
  • Protected API endpoints with role-based access

πŸ—οΈ Project Structure

splitwise/
β”œβ”€β”€ app.py                 # Flask application entry point
β”œβ”€β”€ db.py                  # Database configuration
β”œβ”€β”€ requirements.txt       # Python dependencies
β”œβ”€β”€ migrations/           # Database migration files
β”œβ”€β”€ models/              # SQLAlchemy models
β”‚   β”œβ”€β”€ user.py
β”‚   β”œβ”€β”€ group.py
β”‚   β”œβ”€β”€ expense.py
β”‚   └── ...
β”œβ”€β”€ resources/           # API route handlers
β”‚   β”œβ”€β”€ user.py
β”‚   β”œβ”€β”€ group.py
β”‚   β”œβ”€β”€ expense.py
β”‚   └── ...
β”œβ”€β”€ schemas.py           # Marshmallow schemas
└── frontend/           # React application
    β”œβ”€β”€ src/
    β”‚   β”œβ”€β”€ components/    # Reusable UI components
    β”‚   β”œβ”€β”€ pages/        # Page components
    β”‚   β”œβ”€β”€ services/     # API service layer
    β”‚   β”œβ”€β”€ contexts/     # React contexts
    β”‚   β”œβ”€β”€ hooks/        # Custom hooks
    β”‚   └── utils/        # Utility functions
    β”œβ”€β”€ public/           # Static assets
    └── package.json      # Frontend dependencies

πŸš€ Development Scripts

Backend

python app.py              # Start development server
flask db migrate           # Create new migration
flask db upgrade           # Apply migrations

Frontend

npm start                  # Start development server
npm run build             # Build for production
npm test                  # Run tests

🀝 Contributing

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

πŸ“ License

This project is licensed under the MIT License.

πŸ“ž Support

For issues and questions, please open an issue on GitHub.

About

This project is still in development. Always use dummy (random) email and password so it will not affect if data gets corrupts

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published