SpendWise Backend API

A comprehensive RESTful API for personal and collaborative expense tracking, budget management, and financial reporting.

View on GitHub

API Endpoints

Explore the available endpoints for managing wallets, transactions, budgets, and more.

User Management

  • GET
    /api/users/:id
    Get user details
  • POST
    /api/users
    Create or update user

Wallet Management

  • GET
    /api/wallets
    Get all wallets for a user
  • GET
    /api/wallets/:id
    Get a specific wallet
  • POST
    /api/wallets
    Create a new wallet
  • PUT
    /api/wallets/:id
    Update a wallet
  • DELETE
    /api/wallets/:id
    Delete a wallet

Transaction Management

  • GET
    /api/transactions
    Get all transactions (with optional filtering)
  • GET
    /api/transactions/:id
    Get a specific transaction
  • POST
    /api/transactions
    Create a new transaction
  • PUT
    /api/transactions/:id
    Update a transaction
  • DELETE
    /api/transactions/:id
    Delete a transaction

Budget Management

  • GET
    /api/budgets
    Get all budgets (with optional filtering)
  • GET
    /api/budgets/:id
    Get a specific budget
  • POST
    /api/budgets
    Create a new budget
  • PUT
    /api/budgets/:id
    Update a budget
  • DELETE
    /api/budgets/:id
    Delete a budget

Category Management

  • GET
    /api/categories
    Get all categories
  • GET
    /api/categories/:id
    Get a specific category
  • POST
    /api/categories
    Create a new category

Shared Wallets

  • GET
    /api/shared-wallets
    Get all shared wallets
  • GET
    /api/shared-wallets/:id
    Get a specific shared wallet
  • POST
    /api/shared-wallets
    Share a wallet with another user
  • PUT
    /api/shared-wallets/:id
    Update sharing permissions
  • DELETE
    /api/shared-wallets/:id
    Remove sharing access

Key Features

Discover the powerful features that make SpendWise a comprehensive financial management solution.

💰

Multi-Wallet Support

Create and manage multiple wallets for different purposes with support for various currencies.

🔄

Transaction Tracking

Record and categorize income and expenses with detailed filtering and search capabilities.

📊

Budget Management

Set and track budgets for specific categories with period-based limits and notifications.

🔔

Smart Notifications

Receive alerts for budget limits, shared wallet invitations, and important updates.

🔁

Recurring Transactions

Set up automatic transactions with various frequencies for regular income and expenses.

👥

Collaboration

Share wallets with others and manage permissions for collaborative financial tracking.

Getting Started

Follow these steps to set up the SpendWise backend on your local machine.

1

Clone the Repository

Get the code from GitHub to your local machine.

git clone https://github.com/yourusername/spendwise-backend.git
cd spendwise-backend
2

Install Dependencies

Install all required packages using Pipenv.

pipenv install
3

Set Up Environment Variables

Create a .env file with the necessary configuration.

# Flask configuration
FLASK_APP=app.py
FLASK_ENV=development
FLASK_DEBUG=True
PORT=5000
SECRET_KEY=your_secret_key

# Database configuration
DATABASE_URL=postgresql://username:password@localhost:5432/spendwise

# Supabase configuration
SUPABASE_URL=your_supabase_url
SUPABASE_KEY=your_supabase_key
4

Set Up the Database

Create the database and run migrations.

# Create a PostgreSQL database
createdb spendwise

# Run migrations
pipenv run flask db upgrade

# Seed default categories
pipenv run python scripts/seed_categories.py
5

Run the Application

Start the Flask development server.

pipenv run flask run

The API will be available at http://localhost:5000