Portfolio Manager
Live Server
An sandbox live server is hosted at https://india-portfolio-manager.herokuapp.com/. Not optimized for mobile. Best viewed on Chrome browser.
! Please be kind enough and not do any delete operations.
Intent
To build a portfolio manager which can track and provide insights into a individual or family's financial interests.
What is supported?
- Goals
- PPF (Public Provident Fund)
- EPF (Employee Provident Fund)
- Fixed Deposit
- ESPP (Employee Stock Purchase Plan)
- Users
- SSY (Sukanya Samridhi Yojana)
- RSU (Restricted Stock Units)
- Shares
- Mutual Funds
- Bank Accounts
- Gold
- 401K
- Crypto
Installation
- Baremetal (Laptop/Desktop/Server) and Virtual Machine
- Docker
Upgrades
- Baremetal (Laptop/Desktop/Server) and Virtual Machine
- Docker
Baremetal and Virtual Machine Deployment Method
1. Requirements
-
Python v3. Tested with v3.9
-
Libraries
- macOS:
brew install ghostscript tcl-tk
- Ubuntu
apt install ghostscript python3-tk
-
Git v2.34.1 or above
-
Virtual Environment (optional)
- Select and install your preferred virtual environment manager (anaconda, virtualenv, etc.)
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
- 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
- Remove .sample from the filename. Ensure the filename is .pm-env before proceeding to the next step.
-
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.
- env_files
- src
- portfoliomanager
-
Setup the server.
cd src
python manage.py makemigrations
python manage.py migrate
python manage.py collectstatic
- 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.
-
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
- portfoliomanager
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
-
Re-launch PortfolioManager
Docker Deployment Method
1. Requirements
-
Docker Engine & Docker Compose v20.10.17 or above.
-
Git v2.34.1 or above
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
- Remove .sample from the filenames. Ensure the filename is .pm-env and .postgresql-env before proceeding to the next step.
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
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!