Skip to content

pushpitkamboj/expense-tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Expense Tracker

status license backend db

✨ Overview

Expense Tracker is a modern, open-source platform to manage your expenses with conversational AI. Self-host and own your data, powered by FastAPI, Supabase, and LangGraph.


🚀 Self-Hosting Guide

1. Clone & Install

git clone <repo-url>
cd expense_tracker
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

2. Get API Keys

  • Sign up at Supabase
  • Create a new project
  • Go to Project Settings → API
  • Copy your SUPABASE_URL and SUPABASE_KEY
  • Create a .env file in the root:
SUPABASE_URL=your_supabase_url
SUPABASE_KEY=your_supabase_key

3. Setup Supabase Database

Create the following tables in Supabase:

user

Column Type Notes
user_id uuid Primary Key
user_name text
email text Unique
password text Hashed
thread_id uuid Nullable

category

Column Type Notes
category_id uuid Primary Key
user_id uuid FK → user
name text
description text Nullable

expense

Column Type Notes
expense_id uuid Primary Key
user_id uuid FK → user
category_id uuid FK → category
amount float
created_at timestamptz Default now()

🔑 Authentication Flow

  1. Sign Up:
    • POST /auth/signup — Register a new user
  2. Sign In:
    • POST /auth/signin — Login and receive a token
  3. Start Conversation:
    • POST /user/start — Begin a chat session with a prompt
  4. Human Feedback Loop:
    • If response contains human_feedback: true, call POST /user/continue with your prompt to continue the conversation

📚 API Endpoints

User Endpoints (/auth, /user)

  • POST /auth/signup — Register
  • POST /auth/signin — Login
  • POST /user/start — Start conversation
  • POST /user/continue — Continue conversation (if human_feedback: true)

Category Endpoints (/category)

  • POST /category/add — Add a new category
  • GET /category/get — List your categories

Expense Endpoints (/expense)

  • POST /expense/add — Add an expense
  • GET /expense/get — List expenses (implement as needed)

🛠️ Technologies Used

  • FastAPI — Modern Python web framework
  • Supabase — Postgres DB & Auth
  • LangGraph — Conversational AI workflow
  • Pydantic — Data validation
  • Docker (optional) — Containerization

🖼️ Example Usage

# Signup
curl -X POST http://localhost:8000/auth/signup -H "Content-Type: application/json" -d '{"user_name": "alice", "email": "alice@example.com", "password": "password123"}'

# Signin
curl -X POST http://localhost:8000/auth/signin -H "Content-Type: application/json" -d '{"email": "alice@example.com", "password": "password123"}'

# Start conversation
curl -X POST http://localhost:8000/user/start -H "Authorization: Bearer <token>" -H "Content-Type: application/json" -d '{"prompt": "Track my coffee expense"}'

🤝 Contributing

Contributions welcome! Please open issues or PRs.


📄 License

MIT

About

expense tracker which is AI first, chat with your expenses

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published