A Laravel application to track your investment portfolio performance, dividends, and stock splits using live market data.
To begin, you should pull the source from github using git clone
like this:
git clone https://github.com/hackerESQ/investments && cd investments
Now, you'll need to install all required composer packages:
composer install
Finally, you should configure your database credentials in your .env
file. Now, you can choose to install locally (e.g. on Homestead or Valet) or on Docker (with the help of Sail).
Assuming you already have your local development environment configured (e.g. if you're running valet or homestead), you can simply seed the database with the first user:
php artisan db:seed
That's it. You can now access Investments at localhost
or investments.test
, depending on your local development environment. The first user's credentials are:
Username: [email protected]
Password: password
If installing locally, you will need to configure a cron job to run your scheduler jobs or use the artisan command. This ensures your daily change and market data is updated. Additionally, you'll need to run php artisan queue:work
to ensure holdings are updated during imports.
Running Investments in Docker ensures the scheduler and queues are configured appropriately. But, there's several .env
variables you should ensure to configure as appropriate. These determine how your Docker containers will function:
APP_URL=localhost
APP_SERVICE=investments.test
APP_PORT=80
You can now run sail up -d
to start the webserver and database containers. But you'll need to create your first user, using the sail artisan db:seed
command. This will run the seed command in the container and create the first user:
Username: [email protected]
Password: password
You should change these user credentials.
You can import and export all data within Investments. Imports and exports use Excel files.
To begin importing data, you'll need to get the import template. You can just export whether you have data or not. This is the import template. When you import data, it is upserted (i.e. existing data is updated and new data is inserted).
Export is simple. Each set of data is on a separate worksheet within the exported file.
Market data is pulled from Yahoo finance using the scheb/yahoo-finance-api library by default. However, you can choose to create your own market data interface if you choose. See the MarketDataInterface.php file for more information on how to define your own interface. The interface is configured in the market_data.php config file.
There are various commands available to help facilitate your investment tracking.
Coming soon.
Coming soon.
Coming soon.
Coming soon.
Coming soon.
You can run tests with the composer test
command.
Feel free to create a fork and submit a pull request if you would like to contribute.
Raise an issue on GitHub if you notice something broken.