Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| cba9fe1e7b | |||
| baa49e77eb | |||
| b015462e50 | |||
| c9f1fc1bea | |||
| 1177886271 | |||
| 0e1c56dd18 | |||
| eefe237dff |
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
APP_NAME=Investbrain
|
APP_NAME=Investbrain
|
||||||
APP_ENV=production
|
APP_ENV=production
|
||||||
APP_KEY=
|
APP_KEY=
|
||||||
APP_DEBUG=false
|
APP_DEBUG=true
|
||||||
APP_TIMEZONE=UTC
|
APP_TIMEZONE=UTC
|
||||||
APP_PORT=8000
|
APP_PORT=8000
|
||||||
APP_URL="http://localhost:${APP_PORT}"
|
APP_URL="http://localhost:${APP_PORT}"
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ Investbrain is a smart open-source investment tracker that helps you manage, tra
|
|||||||
- [Install (self hosting)](#self-hosting)
|
- [Install (self hosting)](#self-hosting)
|
||||||
- [Chat with your holdings](#chat-with-your-holdings)
|
- [Chat with your holdings](#chat-with-your-holdings)
|
||||||
- [Market data providers](#market-data-providers)
|
- [Market data providers](#market-data-providers)
|
||||||
|
- [Import / Export](#import--export)
|
||||||
- [Configuration](#configuration)
|
- [Configuration](#configuration)
|
||||||
- [Updating](#updating)
|
- [Updating](#updating)
|
||||||
- [Command line utilities](#command-line-utilities)
|
- [Command line utilities](#command-line-utilities)
|
||||||
@@ -104,6 +105,18 @@ MARKET_DATA_PROVIDER=yahoo,alphavantage,custom_provider
|
|||||||
|
|
||||||
Feel free to submit a PR with any custom providers you create.
|
Feel free to submit a PR with any custom providers you create.
|
||||||
|
|
||||||
|
## Import / Export
|
||||||
|
|
||||||
|
Investbrain includes a convenient feature which allows you to import and export portfolios and transaction data.
|
||||||
|
|
||||||
|
### Import
|
||||||
|
|
||||||
|
Imports are "upserted" to the database. If the record does not already exist in the database, the record will be created. However, when a portfolio or transaction exists (the record's ID matches an existing record), the record will be updated. This way, you can simultaneously create new records, but also bulk update records.
|
||||||
|
|
||||||
|
### Export
|
||||||
|
|
||||||
|
Exporting your portfolios and transactions is a convenient way to back-up your Investbrain data. It is also a convenient way to maintain portability of *your* data.
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
There are several optional configurations available when installing using the recommended [Docker method](#self-hosting). These options are configurable using an environment file. Changes can be made in your [.env](https://github.com/investbrainapp/investbrain/blob/main/.env.example) file before installation.
|
There are several optional configurations available when installing using the recommended [Docker method](#self-hosting). These options are configurable using an environment file. Changes can be made in your [.env](https://github.com/investbrainapp/investbrain/blob/main/.env.example) file before installation.
|
||||||
|
|||||||
@@ -2,7 +2,10 @@
|
|||||||
|
|
||||||
namespace App\Providers;
|
namespace App\Providers;
|
||||||
|
|
||||||
|
use Illuminate\Support\Arr;
|
||||||
|
use Laravel\Jetstream\Features;
|
||||||
use App\Actions\Jetstream\DeleteUser;
|
use App\Actions\Jetstream\DeleteUser;
|
||||||
|
use Illuminate\Support\Facades\Config;
|
||||||
use Illuminate\Support\ServiceProvider;
|
use Illuminate\Support\ServiceProvider;
|
||||||
use Laravel\Jetstream\Jetstream;
|
use Laravel\Jetstream\Jetstream;
|
||||||
|
|
||||||
@@ -26,6 +29,13 @@ class JetstreamServiceProvider extends ServiceProvider
|
|||||||
|
|
||||||
Jetstream::deleteUsersUsing(DeleteUser::class);
|
Jetstream::deleteUsersUsing(DeleteUser::class);
|
||||||
|
|
||||||
|
if ( config('investbrain.self_hosted', false) ) {
|
||||||
|
|
||||||
|
Config::set(
|
||||||
|
'jetstream.features',
|
||||||
|
array_keys(Arr::except(array_values(config('jetstream.features')), Features::termsAndPrivacyPolicy()))
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+1
-1
@@ -143,7 +143,7 @@ return [
|
|||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'inject_morph_markers' => true,
|
'inject_morph_markers' => false,
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|---------------------------------------------------------------------------
|
|---------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -63,7 +63,9 @@
|
|||||||
<x-ib-card title="{{ __('Recent activity') }}" class="md:col-span-3">
|
<x-ib-card title="{{ __('Recent activity') }}" class="md:col-span-3">
|
||||||
|
|
||||||
@livewire('transactions-list', [
|
@livewire('transactions-list', [
|
||||||
'transactions' => $user->transactions
|
'transactions' => $user->transactions,
|
||||||
|
'showPortfolio' => true,
|
||||||
|
'paginate' => false
|
||||||
])
|
])
|
||||||
|
|
||||||
</x-ib-card>
|
</x-ib-card>
|
||||||
|
|||||||
@@ -207,7 +207,7 @@
|
|||||||
* 52 week high: {$holding->market_data->fifty_two_week_high}
|
* 52 week high: {$holding->market_data->fifty_two_week_high}
|
||||||
* Dividend yield: {$holding->market_data->dividend_yield}
|
* Dividend yield: {$holding->market_data->dividend_yield}
|
||||||
|
|
||||||
Based on this current market data, quantity owned, and average cost basis, you should determine if the {$holding->symbol} holding is making or losing money.
|
This data is current as of today's date: " . now()->format('Y-m-d') . ". Based on this current market data, quantity owned, and average cost basis, you should determine if the {$holding->symbol} holding is making or losing money.
|
||||||
|
|
||||||
Below is the question from the investor. Considering these facts, provide a concise response to the following question (give a direct response). Limit your response to no more than 75 words and consider using a common decision framework. Use github style markdown for any formatting:"
|
Below is the question from the investor. Considering these facts, provide a concise response to the following question (give a direct response). Limit your response to no more than 75 words and consider using a common decision framework. Use github style markdown for any formatting:"
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -15,6 +15,10 @@ new class extends Component {
|
|||||||
public ?Portfolio $portfolio;
|
public ?Portfolio $portfolio;
|
||||||
public ?Transaction $editingTransaction;
|
public ?Transaction $editingTransaction;
|
||||||
public Bool $shouldGoToHolding = true;
|
public Bool $shouldGoToHolding = true;
|
||||||
|
public Bool $showPortfolio = false;
|
||||||
|
public Bool $paginate = true;
|
||||||
|
public Int $perPage = 5;
|
||||||
|
public Int $offset = 0;
|
||||||
|
|
||||||
protected $listeners = [
|
protected $listeners = [
|
||||||
'transaction-updated' => '$refresh',
|
'transaction-updated' => '$refresh',
|
||||||
@@ -38,17 +42,23 @@ new class extends Component {
|
|||||||
return $this->redirect(route('holding.show', ['portfolio' => $holding['portfolio_id'], 'symbol' => $holding['symbol']]));
|
return $this->redirect(route('holding.show', ['portfolio' => $holding['portfolio_id'], 'symbol' => $holding['symbol']]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function updateOffset($amount = 0)
|
||||||
|
{
|
||||||
|
$this->offset = $this->offset + $amount;
|
||||||
|
}
|
||||||
|
|
||||||
}; ?>
|
}; ?>
|
||||||
|
|
||||||
<div class="">
|
<div class="">
|
||||||
|
|
||||||
@foreach($transactions->sortByDesc('date')->take(10) as $transaction)
|
@foreach($transactions->sortByDesc('date')->slice($offset)->take($perPage) as $transaction)
|
||||||
|
|
||||||
<x-list-item
|
<x-list-item
|
||||||
no-separator
|
no-separator
|
||||||
:item="$transaction"
|
:item="$transaction"
|
||||||
class="cursor-pointer"
|
class="cursor-pointer"
|
||||||
x-data="{ loading: false, timeout: null }"
|
x-data="{ loading: false, timeout: null }"
|
||||||
|
:key="$transaction->id"
|
||||||
@click="
|
@click="
|
||||||
if ($wire.shouldGoToHolding) {
|
if ($wire.shouldGoToHolding) {
|
||||||
|
|
||||||
@@ -83,12 +93,44 @@ new class extends Component {
|
|||||||
<x-loading x-show="loading" x-cloak class="text-gray-400 ml-2" />
|
<x-loading x-show="loading" x-cloak class="text-gray-400 ml-2" />
|
||||||
</x-slot:value>
|
</x-slot:value>
|
||||||
<x-slot:sub-value>
|
<x-slot:sub-value>
|
||||||
|
@if($showPortfolio)
|
||||||
|
<span title="{{ __('Portfolio') }}">{{ $transaction->portfolio->title }} </span>
|
||||||
|
·
|
||||||
|
@endif
|
||||||
<span title="{{ __('Transaction Date') }}">{{ $transaction->date->format('F j, Y') }} </span>
|
<span title="{{ __('Transaction Date') }}">{{ $transaction->date->format('F j, Y') }} </span>
|
||||||
</x-slot:sub-value>
|
</x-slot:sub-value>
|
||||||
</x-list-item>
|
</x-list-item>
|
||||||
|
|
||||||
@endforeach
|
@endforeach
|
||||||
|
|
||||||
|
@if ($paginate && count($transactions) > $perPage)
|
||||||
|
<div class="flex justify-between">
|
||||||
|
|
||||||
|
<span>
|
||||||
|
@if($offset > 0)
|
||||||
|
<x-button
|
||||||
|
class="btn btn-sm btn-ghost text-secondary"
|
||||||
|
wire:click="updateOffset(-{{ $perPage }})"
|
||||||
|
>
|
||||||
|
{!! __('pagination.previous') !!}
|
||||||
|
</x-button>
|
||||||
|
@endif
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<span>
|
||||||
|
@if(count($transactions) - $offset > $offset)
|
||||||
|
<x-button
|
||||||
|
class="btn btn-sm btn-ghost text-secondary"
|
||||||
|
wire:click="updateOffset({{ $perPage }})"
|
||||||
|
>
|
||||||
|
{!! __('pagination.next') !!}
|
||||||
|
</x-button>
|
||||||
|
@endif
|
||||||
|
</span>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
<x-ib-alpine-modal
|
<x-ib-alpine-modal
|
||||||
key="manage-transaction"
|
key="manage-transaction"
|
||||||
title="{{ __('Manage Transaction') }}"
|
title="{{ __('Manage Transaction') }}"
|
||||||
@@ -96,7 +138,7 @@ new class extends Component {
|
|||||||
@livewire('manage-transaction-form', [
|
@livewire('manage-transaction-form', [
|
||||||
'portfolio' => $portfolio,
|
'portfolio' => $portfolio,
|
||||||
'transaction' => $editingTransaction,
|
'transaction' => $editingTransaction,
|
||||||
], key($editingTransaction->id ?? 'new'))
|
], key($editingTransaction?->id.rand()))
|
||||||
|
|
||||||
</x-ib-alpine-modal>
|
</x-ib-alpine-modal>
|
||||||
</div>
|
</div>
|
||||||
@@ -173,7 +173,7 @@
|
|||||||
|
|
||||||
{$formattedHoldings}
|
{$formattedHoldings}
|
||||||
|
|
||||||
Based on the current market data, quantity owned, and average cost basis, you can determine the performance of any holding.
|
This data is current as of today's date: " . now()->format('Y-m-d') . ". Based on the current market data, quantity owned, and average cost basis, you can determine the performance of any holding.
|
||||||
|
|
||||||
Below is the question from the investor. Considering these facts, provide a concise response to the following question (give a direct response). Limit your response to no more than 75 words and consider using a common decision framework. Use github style markdown for any formatting:"
|
Below is the question from the investor. Considering these facts, provide a concise response to the following question (give a direct response). Limit your response to no more than 75 words and consider using a common decision framework. Use github style markdown for any formatting:"
|
||||||
])
|
])
|
||||||
|
|||||||
Reference in New Issue
Block a user