Skip to content

ezeisraeljohn/trackify

Repository files navigation

Trackify

Trackify is a modern financial tracking and insights platform that helps users link their bank accounts, sync transactions, and gain actionable insights using AI-powered analytics and large language models (LLMs). Built with FastAPI, SQLModel, Celery, and integrated with Mono and Google Gemini APIs, Trackify provides a robust backend for personal finance management.


Features

  • User Authentication & Email Verification
    Secure registration, login, and email verification with OTP.

  • Bank Account Linking
    Seamless integration with Mono to link and fetch bank account details.

  • Transaction Syncing
    Fetch and store user transactions from linked accounts.

  • Automated Categorization
    Normalize and categorize transactions for better insights.

  • AI-Powered Insights
    Generate financial insights and summaries using LLMs (Google Gemini).

  • Email Notifications
    Send verification and notification emails via SMTP.

  • Celery Task Queue
    Background job processing for emails and insights.

  • RESTful API
    Well-structured, documented API endpoints with OpenAPI/Swagger support.


Tech Stack

  • Python 3.10+
  • FastAPI (API framework)
  • SQLModel (ORM)
  • PostgreSQL (Production DB) / SQLite (Testing)
  • Celery (Task queue)
  • Redis (Broker/Backend for Celery)
  • Mono API (Bank data aggregation)
  • Google Gemini (LLM for AI insights)
  • Docker (Containerization)
  • Alembic (Database migrations)

Getting Started

Prerequisites

  • Docker & Docker Compose (recommended for local development)
  • (Optional) Python 3.10+ if you want to run the API app manually

Environment Variables

Trackify uses environment variables for configuration. Example variables are provided in .env.example.

  1. Copy the example file to the environment you want:

    cp .env.example .env.development
    cp .env.example .env.testing
    cp .env.example .env.production
  2. Edit the copied file (.env.development, .env.testing, or .env.production) and fill in the correct values for your environment (database, API keys, email, etc).


Running Locally with Docker and Docker Compose

Trackify uses Docker Compose to run background services (Celery worker, Celery beat, Redis), but the FastAPI app itself should be run manually using Uvicorn.

1. Choose the Environment

  • By default, compose.yml uses .env.development as the env_file for all services.
  • To use a different environment file (e.g., for production or testing), edit the env_file: section in compose.yml to point to .env.production or .env.testing as needed.

2. Start Background Services

Start Redis, Celery worker, and Celery beat using Docker Compose:

docker compose up --build

This will start:

  • trackify_redis: Redis for Celery
  • trackify_celery_worker: Celery worker for background jobs
  • trackify_celery_beat: Celery beat for scheduled jobs

3. Run the FastAPI App

In a new terminal (with your virtual environment activated and dependencies installed), run the FastAPI app manually:

ENV=development uvicorn app.main:app --reload

4. Apply Database Migrations

If you need to run Alembic migrations, do so manually:

ENV=development alembic upgrade head

Running Without Docker

You can run everything manually if you prefer:

  1. Install Python dependencies:

    python -m venv venv
    source venv/bin/activate
    pip install -r requirements.txt
  2. Set up the database and environment variables as above.

  3. Run Redis (locally or via Docker):

    docker run -p 6379:6379 redis
  4. Run Alembic migrations:

    ENV=development alembic upgrade head
  5. Run the FastAPI app:

    ENV=development uvicorn app.main:app --reload
  6. Run Celery worker and beat:

    ENV=development celery -A app.celery_app.celery_app worker --loglevel=info
    ENV=development celery -A app.celery_app.celery_app beat --loglevel=info

API Documentation


Running Tests

To run tests, you must ensure that the app package is discoverable by Python.
If you see ModuleNotFoundError: No module named 'app', it means your Python path does not include the project root.

Recommended:
Run tests from the project root directory using the following command:

pytest

Or, explicitly set the PYTHONPATH:

PYTHONPATH=. pytest

If you are using a virtual environment, make sure it is activated.


Project Structure

A simplified view of the main codebase:

trackify/
├── alembic/
│   ├── env.py
│   ├── script.py.mako
│   └── versions/
├── alembic.ini
├── app/
│   ├── api/
│   │   ├── deps.py
│   │   └── v1/
│   │       ├── endpoints/
│   │       └── __init__.py
│   ├── celery_app.py
│   ├── celeryconfig.py
│   ├── core/
│   ├── crud/
│   ├── db/
│   ├── email_templates/
│   ├── jobs/
│   ├── main.py
│   ├── models/
│   ├── schemas/
│   ├── services/
│   ├── utils/
│   └── __init__.py
├── compose.yml
├── Dockerfile
├── README.md
├── requirements.txt
├── tests/
│   ├── test_ai_insights.py
│   ├── test_auth.py
│   └── test_transactions.py

Note:
The following files and folders are excluded from version control as per .gitignore and should not be uploaded to GitHub:

  • __pycache__/
  • .env*
  • .vscode/
  • transaction_sample.py
  • .trackify (if present)
  • celerybeat-schedule (runtime file)

Contribution

  1. Fork the repository.
  2. Create your feature branch (git checkout -b feature/your-feature).
  3. Commit your changes (git commit -am 'Add new feature').
  4. Push to the branch (git push origin feature/your-feature).
  5. Open a pull request.

License

This project is licensed under the MIT License.


Acknowledgements

About

This track users account using mono api and gemini

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published