Skip to content

Repository files navigation

💰 FinansApp

A personal finance dashboard built with Django
Track income and expenses, manage stock portfolios with live market data, and generate buy/sell signals from a Fibonacci-weighted moving-average strategy.

Python Django SQLite AdminLTE Plotly


✨ Features

📊 Income & Expense Tracking

  • Record transactions with a title, amount, date and type (income / expense)
  • Per-user categories — every user defines their own income and expense categories
  • Dashboard summary of balance, totals and category breakdown

📈 Stock Portfolios

  • Create multiple named portfolios per user
  • Add stocks by symbol with an autocomplete symbol search (Finnhub /search)
  • Live quote data per holding — last price, open, high, low, absolute change and % change
  • Delete individual holdings or a whole portfolio

🎯 Strategy Signals

  • A Fibonacci-weighted moving average strategy (financeapp/strategy_utils.py):
    • builds a Fibonacci sequence of SMA lengths and takes a weighted average x
    • applies a bias multiplier → x1, and an EWMA smoothing → y1
    • emits AL (buy) / SAT (sell) on x1 × y1 crossovers
  • One year of daily OHLC pulled from Yahoo Finance (yfinance)
  • Results rendered as an interactive Plotly chart with buy/sell markers

👤 Accounts & Profiles

  • Registration, login/logout, password change flow
  • User profile with full name, birth date, city and profile photo upload
  • UserProfile is auto-created via a post_save signal on User

📄 Static / Legal Pages

Features, contact, FAQ, terms of service, KVKK privacy notice, explicit-consent text and form, and legal disclaimers.


🧱 Tech Stack

Layer Technology
Backend Django (MVT), Django auth
Database SQLite
Market data Finnhub API (quotes & symbol search), Yahoo Finance via yfinance
Analysis pandas, NumPy
Charts Plotly
UI AdminLTE 3, Bootstrap, vanilla JS (AJAX)
Media Pillow (profile photo uploads)

🚀 Getting Started

Requirements: Python 3.10+

1. Clone and enter the project

git clone https://github.com/bugraq/FinansApp.git
cd FinansApp

2. Create a virtual environment

python -m venv venv

Activate it — Windows:

venv\Scripts\activate

Linux / macOS:

source venv/bin/activate

3. Install dependencies

pip install -r requirements.txt

4. Configure the Finnhub API key

Get a free key at finnhub.io and set it as an environment variable:

set FINNHUB_API_KEY=your_key_here

⚠️ Note: financeapp/finnhub_service.py currently holds a hard-coded key. Move it to an environment variable before deploying anywhere public.

5. Apply migrations

python manage.py migrate

6. Create an admin user (optional)

python manage.py createsuperuser

7. Run the server

python manage.py runserver

Open http://127.0.0.1:8000/ in your browser.


🗺️ Routes

Path Purpose
/ Landing page
/register/, /login/, /logout/ Authentication
/dashboard/ Main dashboard
/dashboard/income-expense/ Transaction list and totals
/dashboard/income/add/, /dashboard/expense/add/ Add a transaction
/dashboard/income/category/add/, /dashboard/expense/category/add/ Manage categories
/dashboard/portfolio/ Portfolio overview
/dashboard/portfolio/add/ Create a portfolio
/dashboard/portfolio/<id>/add-stock/ Add a holding
/dashboard/hisse-takibi/ Stock watchlist
/dashboard/strategy/ Run the strategy and view signals
/profile/, /profile/edit/, /profile/upload-photo/ User profile
/ajax/search-symbols/, /ajax/fetch-stock-data/ AJAX endpoints

🗃️ Data Model

User ──┬── UserProfile      (full name, birth date, city, photo)
       ├── IncomeCategory   (per-user)
       ├── ExpenseCategory  (per-user)
       ├── Transaction      (title, amount, type, date, optional category)
       └── Portfolio ─── Stock  (symbol, name, last/open/high/low, change, volume)

⚠️ Before Deploying

This project ships with development defaults. For any public deployment:

  • Set DEBUG = False and configure ALLOWED_HOSTS
  • Move SECRET_KEY and FINNHUB_API_KEY into environment variables
  • Fix the missing comma after 'financeapp' in INSTALLED_APPS
  • Switch from SQLite to PostgreSQL/MySQL and serve static files via collectstatic
  • Do not commit db.sqlite3 or uploaded media

📌 Disclaimer

The strategy signals in this project are for educational purposes only and are not investment advice.


👤 Author

Buğra — AI & Data Engineering student

LinkedIn Kaggle GitHub

About

Django personal finance dashboard: categorised income/expense tracking, stock portfolios with live Finnhub prices, strategy signals and user profiles.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages