Skip to content

Track financial goals using contributions to Shares, Restricted Stock Units, Employee Stock Purchase Plan, 401K, Gold, Crypto, Provident Fund, Sukanya Samriddhi, Mutual Funds

License

Notifications You must be signed in to change notification settings

krishnakuruvadi/portfoliomanager

Repository files navigation

Portfolio Manager

Other hosting options

If you or someone you know is unable to self host this application but would greatly benefit from it, checkout us out at lukritive.com, our hosted site (with a 1 year trial for a limited time)! We have stopped the service due to lack of demand


Be part of the community!

Feel free to join our Discord. Let us know your feedback - what do you like? what needs improvement? what features would you like to see added?

If you want to contribute to the repo and need help, you can reach us on discord as well.


Intent

To build a portfolio manager which can track and provide insights into a individual or family's financial interests.


What is supported?

  • Users

  • Goals

  • Fixed Deposit

  • ESPP (Employee Stock Purchase Plan)

  • RSU (Restricted Stock Units)

  • Shares

  • Crypto

  • Bank Accounts

INDIA:

  • PPF (Public Provident Fund)
  • EPF (Employee Provident Fund)
  • SSY (Sukanya Samridhi Yojana)
  • Mutual Funds
  • Gold

USA:

  • 401K

Installation


Upgrades


Baremetal and Virtual Machine Deployment Method

1. Requirements

  • Python v3. Tested with v3.9, v3.10

  • Libraries

    • macOS:
brew install ghostscript tcl-tk
  • Ubuntu
apt install ghostscript python3-tk

2. Downloading the application

  • Clone or download the source code.
git clone https://github.com/krishnakuruvadi/portfoliomanager.git

Prepare the application to launch

  • Change into the recently clone/downloaded directory.
cd ./portfoliomanager
  • Set git configuration (optional).
git config user.name "Your Name"
git config user.email "[email protected]"
  • Create a virtual environment (optional).
python -m venv ./venv
  • Activate virtual environment.
source ./venv/bin/activate
  • Install the required packages.
pip install -r requirements.txt
  • Edit the environment variables to suite your needs.

    • Open the env_files directory and edit the .pm-env.sample file.
    • Carefully read the comments throughout the file as it will provide additional context.
    • Edit the parameters as necessary.
  • Rename the environment variables file.

    • Remove .sample from the filename. Ensure the filename is .pm-env before proceeding to the next step.
      • WARNING - The application is expecting .pm-env as the filename. If you wish to change it please also modify env_file_path in setting.py
  • Delete unused environment variables file (optional)

    • Since the postgresql-env.sample file is only used with docker deployments, this file can be safely deleted before proceeding to the next step.
  • Copy or move the entire env_files directory to the src directory. The directory should look as follows:

    • portfoliomanager
      • src
        • env_files
          • .pm-env OR .CUSTOM-FILE-NAME set above.
  • Setup the server.

cd src
python manage.py makemigrations
python manage.py migrate
python manage.py collectstatic
  • Create a normal user in django (recommended). Edit the fields below with your desired account details. For more details, please visit Django's documentation

    • It is recommended to use a non-admin account for your daily use and only use an admin account for administrative purposes.
cd src
python manage.py shell
from django.contrib.auth.models import User
User.objects.create_user('johndoe', '[email protected]', 'johnpassword')
  • Create a super user in django (optional).
python manage.py createsuperuser
  • You should be prompted to enter the desired username, email and password for this new admin.

  • You can create additional normal users by logging in as the superuser and going to: Internals > Admin > Authentication and Authorization > Users > Add User.

  • Download, extract, and copy the chromedriver to root of the project (portfoliomanager). You can obtain this driver from here: https://chromedriver.chromium.org/downloads. The directory should look as follows:

    • portfoliomanager
      • chromedriver

Launch PortfolioManager

  • Start the server.
python manage.py runserver
  • Start the huey process

    • In another terminal activate virtual environment (if you created one above) and run background tasks
source ./venv/bin/activate
cd src
python manage.py run_huey

Browse to Portfolio Manager

  • Open your favorite web browser and go to:
http://<host-ip>:8000/

OR

http://localhost:8000/

Note: Different charts and data gets updated at different fixed schedules. If you want to manually update these, go to "Internals" and then "Tasks" and queue the tasks to run once

  • Enjoy Portfolio Manager!

Optional Features

Summary Emails

  • Create a new MailJet account and sign up for their free tier.
  • Go to "Internals" then "Preferences" and provide the details to setup the integration.

Baremetal and Virtual Machine Upgrade Steps

  • Stop the server
cd ./portfoliomanager/src
CTRL + C
deactivate
  • Download the new app version and install any new packages
cd ./portfoliomanager
git pull
source ./venv/bin/activate
pip install -r requirements.txt

Docker Deployment Method

1. Requirements

2. Downloading the appliaction

  • Clone or download the source code.
git clone https://github.com/krishnakuruvadi/portfoliomanager.git

Prepare the application to launch

  • Change into the recently clone/downloaded directory.
cd ./portfoliomanager
  • Edit the environment variables to suite your needs.

    • Open the env_files directory and edit both files (.pm-env.sample and postgresql-env.sample).
    • Carefully read the comments throughout the files as it will provide additional context.
    • Edit the parameters as necessary.
  • Rename the environment variables files.

    • Remove .sample from the filenames. Ensure the filename is .pm-env and .postgresql-env before proceeding to the next step.
      • WARNING - The application container (pm-app) is expecting .pm-env as the filename. If you wish to change it please also modify env_file_path in setting.py.
      • WARNING - The database container (pm-db) is expecting postgresql-env as the filename. If you wish to change it please also modify ./env_files/.postgresql-env in pm-db > env_file section of docker-compose.yml

Launch Portfolio Manager

  • Within the application folder (i.e. portfoliomanager), run the docker compose file to build the appliaction and launch the docker containers. This step should take approximately two minutes.
docker compose up -d
  • Should you need to tear down the app environment, run:
docker compose down
  • Create a normal user in django (recommended).

    • It is recommended to use a non-admin account for your daily use and only use an admin account for administrative purposes.

    • Edit the fields below with your desired account details. For more details, please visit Django's documentation

    • Your Docker container name may vary. Please adjust the below commads to match your exact setup. In this example, I assume your docker container name running the PorfolioManager app is portfolio-manager-app.

docker ps
docker exec -it portfolio-manager-app bash
python manage.py shell
from django.contrib.auth.models import User
User.objects.create_user('johndoe', '[email protected]', 'johnpassword')
exit()
  • You can create additional normal users by logging in as the superuser and going to: Internals > Admin > Authentication and Authorization > Users > Add User.

Browse to Portfolio Manager

  • Open your favorite web browser and go to:
http://<docker-host-ip>/

OR

http://localhost/

Note: Different charts and data gets updated at different fixed schedules. If you want to manually update these, go to "Internals" and then "Tasks" and queue the tasks to run once

  • Enjoy Portfolio Manager!

Optional Features

Summary Emails

  • Create a new MailJet account and sign up for their free tier.
  • Go to "Internals" then "Preferences" and provide the details to setup the integration.

Docker Upgrade Steps

  • Stop the containers
cd ./portfoliomanager
docker compose down
  • Download the new app version
git pull
  • Build a new docker image with the updated application version
docker compose build --no-cache
  • Restart the containers
docker compose up -d
  • Delete the old images (optional but recommended)
docker image prune

Help us and support our work

  • Please consider supporting us by contributing/reporting bugs or feeding our coffee addiction. Click on the link below!

"Buy Me A Coffee"