Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

💰 Expense Tracker API

FastAPI Python SQLite JWT

A simple, secure, and efficient REST API for tracking personal expenses. Built with FastAPI for high performance and easy documentation.

✨ Features

  • 🔐 Secure Authentication: JWT-based registration and login system.
  • 💸 Expense Management: Add, view, edit, and delete your personal expenses.
  • 📊 Smart Recommendations: Get summary reports of your spending by category.
  • 📂 CSV Export: Download your expense history for external analysis.
  • ⚡ Fast & Async: Powered by FastAPI and SQLAlchemy.

🚀 Getting Started

Follow these steps to get the project up and running on your local machine.

Prerequisites

  • Python 3.9+
  • pip (Python package manager)

🛠️ Installation

  1. Clone the repository

    git clone https://github.com/yourusername/expense-tracker-api.git
    cd expense-tracker-api
  2. Create a virtual environment

    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
  3. Install dependencies

    pip install -r requirements.txt
  4. Configure Environment Create a .env file in the root directory (or use the existing one):

    DATABASE_URL=sqlite:///./expense_tracker.db
    SECRET_KEY=your-secret-key-here
    ACCESS_TOKEN_EXPIRE_DAYS=7

🏃‍♂️ Running the API

Start the development server with live reload:

uvicorn app.main:app --reload

The API will be available at http://localhost:8000.


📚 Documentation

FastAPI provides automatic interactive documentation. Once the server is running, visit:


🧪 Valid Categories

When adding an expense, use one of the following categories:

  • Food 🍔
  • Transport 🚗
  • Bills 💡
  • Shopping 🛍️
  • Healthcare 🏥
  • Entertainment 🎬
  • Others 📦

📂 Project Structure

expense-tracker-api/
├── app/
│   ├── routes/         # API endpoints (Auth, Expenses, Export)
│   ├── auth.py         # JWT & Security logic
│   ├── database.py     # Database connection (SQLite)
│   ├── main.py         # App entry point
│   ├── models.py       # SQLAlchemy Database Models
│   └── schemas.py      # Pydantic Schemas for validation
├── .env                # Environment variables
├── requirements.txt    # Python dependencies
└── README.md           # Project documentation

🛡️ License

This project is open-source and available under the MIT License.


Made with ❤️ by [Abdullah Al Noman Prince]

About

A simple, secure, and efficient REST API for tracking personal expenses. Built with FastAPI for high performance and easy documentation.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages