2021-04-13 21:53:58 +02:00
< div align = "center" >
2021-07-10 19:20:02 +02:00
< a href = "https://ghostfol.io" >
< img
alt="Ghostfolio Logo"
src="https://avatars.githubusercontent.com/u/82473144?s=200"
width="100"
/>
< / a >
2021-04-18 19:01:31 +02:00
< h1 > Ghostfolio< / h1 >
2021-04-13 21:53:58 +02:00
< p >
2022-05-26 10:30:13 +02:00
< strong > Open Source Wealth Management Software< / strong >
2021-04-18 19:01:31 +02:00
< / p >
< p >
2022-01-21 20:07:56 +01:00
< a href = "https://ghostfol.io" > < strong > Live Demo< / strong > < / a > | < a href = "https://ghostfol.io/pricing" > < strong > Ghostfolio Premium< / strong > < / a > | < a href = "https://ghostfol.io/blog" > < strong > Blog< / strong > < / a > | < a href = "https://join.slack.com/t/ghostfolio/shared_invite/zt-vsaan64h-F_I0fEo5M0P88lP9ibCxFg" > < strong > Slack< / strong > < / a > | < a href = "https://twitter.com/ghostfolio_" > < strong > Twitter< / strong > < / a >
2021-04-18 19:01:31 +02:00
< / p >
< p >
2021-07-10 19:20:02 +02:00
< a href = " #contributing " >
< img src = "https://img.shields.io/badge/contributions-welcome-orange.svg" / > < / a >
2021-06-30 21:52:29 +02:00
< a href = "https://travis-ci.com/github/ghostfolio/ghostfolio" rel = "nofollow" >
< img src = "https://travis-ci.com/ghostfolio/ghostfolio.svg?branch=main" alt = "Build Status" / > < / a >
2021-04-18 19:01:31 +02:00
< a href = "https://www.gnu.org/licenses/agpl-3.0" rel = "nofollow" >
2021-05-24 21:11:06 +02:00
< img src = "https://img.shields.io/badge/License-AGPL%20v3-blue.svg" alt = "License: AGPL v3" / > < / a >
2021-04-13 21:53:58 +02:00
< / p >
< / div >
2022-05-19 21:05:14 +02:00
**Ghostfolio** is an open source wealth management software built with web technology. The application empowers busy people to keep track of stocks, ETFs or cryptocurrencies and make solid, data-driven investment decisions.
2021-07-10 19:20:02 +02:00
2022-05-26 10:30:13 +02:00
< div align = "center" style = "margin-top: 1rem; margin-bottom: 1rem;" >
< a href = "https://www.youtube.com/watch?v=yY6ObSQVJZk" >
< img src = "./apps/client/src/assets/images/video-preview.jpg" width = "600" > < / a >
2021-08-03 21:02:51 +02:00
< / div >
2021-07-10 19:20:02 +02:00
## Ghostfolio Premium
2021-07-14 20:54:23 +02:00
Our official ** [Ghostfolio Premium ](https://ghostfol.io/pricing )** cloud offering is the easiest way to get started. Due to the time it saves, this will be the best option for most people. The revenue is used for covering the hosting costs.
2021-07-10 19:20:02 +02:00
2021-12-21 20:53:15 +01:00
If you prefer to run Ghostfolio on your own infrastructure (self-hosting), please find further instructions in the section [Run with Docker ](#run-with-docker-self-hosting ).
2021-04-17 16:30:03 +02:00
## Why Ghostfolio?
Ghostfolio is for you if you are...
- 💼 trading stocks, ETFs or cryptocurrencies on multiple platforms
- 🏦 pursuing a buy & hold strategy
- 🎯 interested in getting insights of your portfolio composition
- 👻 valuing privacy and data ownership
- 🧘 into minimalism
- 🧺 caring about diversifying your financial resources
- 🆓 interested in financial independence
- 🙅 saying no to spreadsheets in 2021
- 😎 still reading this list
2021-04-13 21:53:58 +02:00
## Features
2021-04-17 16:30:03 +02:00
- ✅ Create, update and delete transactions
2021-05-24 21:11:06 +02:00
- ✅ Multi account management
2021-08-29 17:09:11 +02:00
- ✅ Portfolio performance: Time-weighted rate of return (TWR) for `Today` , `YTD` , `1Y` , `5Y` , `Max`
2021-04-17 16:30:03 +02:00
- ✅ Various charts
- ✅ Static analysis to identify potential risks in your portfolio
2022-02-11 10:00:49 +01:00
- ✅ Import and export transactions
2021-04-13 21:53:58 +02:00
- ✅ Dark Mode
2021-05-24 21:11:06 +02:00
- ✅ Zen Mode
- ✅ Mobile-first design
2021-04-13 21:53:58 +02:00
2022-05-26 10:30:13 +02:00
< div align = "center" style = "margin-top: 1rem; margin-bottom: 1rem;" >
< img src = "./apps/client/src/assets/images/screenshot.png" width = "300" >
< / div >
2021-04-18 20:30:58 +02:00
## Technology Stack
2021-04-18 18:56:25 +02:00
Ghostfolio is a modern web application written in [TypeScript ](https://www.typescriptlang.org ) and organized as an [Nx ](https://nx.dev ) workspace.
### Backend
2021-05-24 21:11:06 +02:00
The backend is based on [NestJS ](https://nestjs.com ) using [PostgreSQL ](https://www.postgresql.org ) as a database together with [Prisma ](https://www.prisma.io ) and [Redis ](https://redis.io ) for caching.
2021-04-18 18:56:25 +02:00
2021-04-18 20:30:58 +02:00
### Frontend
2021-05-24 21:11:06 +02:00
The frontend is built with [Angular ](https://angular.io ) and uses [Angular Material ](https://material.angular.io ) with utility classes from [Bootstrap ](https://getbootstrap.com ).
2021-04-18 20:30:58 +02:00
2021-12-21 20:22:58 +01:00
## Run with Docker (self-hosting)
2021-04-13 21:53:58 +02:00
### Prerequisites
2021-10-30 12:54:14 -04:00
- [Docker ](https://www.docker.com/products/docker-desktop )
2022-04-02 06:47:58 +02:00
- A local copy of this Git repository (clone)
2021-10-30 12:54:14 -04:00
2021-12-21 20:22:58 +01:00
### a. Run environment
2021-10-30 12:54:14 -04:00
2021-12-21 20:22:58 +01:00
Run the following command to start the Docker images from [Docker Hub ](https://hub.docker.com/r/ghostfolio/ghostfolio ):
2021-10-30 12:54:14 -04:00
```bash
2022-02-14 18:51:16 +01:00
docker-compose -f docker/docker-compose.yml up -d
2021-12-21 20:22:58 +01:00
```
2021-12-21 20:59:01 +01:00
#### Setup Database
Run the following command to setup the database once Ghostfolio is running:
```bash
docker-compose -f docker/docker-compose.yml exec ghostfolio yarn database:setup
```
2021-12-21 20:22:58 +01:00
### b. Build and run environment
Run the following commands to build and start the Docker images:
```bash
docker-compose -f docker/docker-compose.build.yml build
2022-02-14 18:51:16 +01:00
docker-compose -f docker/docker-compose.build.yml up -d
2021-10-30 12:54:14 -04:00
```
2021-12-21 20:59:01 +01:00
#### Setup Database
2021-10-30 12:54:14 -04:00
Run the following command to setup the database once Ghostfolio is running:
```bash
2021-12-21 20:59:01 +01:00
docker-compose -f docker/docker-compose.build.yml exec ghostfolio yarn database:setup
2021-10-30 12:54:14 -04:00
```
### Fetch Historical Data
Open http://localhost:3333 in your browser and accomplish these steps:
2022-02-06 09:32:41 +01:00
1. Create a new user via _Get Started_ (this first user will get the role `ADMIN` )
2021-10-30 12:54:14 -04:00
1. Go to the _Admin Control Panel_ and click _Gather All Data_ to fetch historical data
1. Click _Sign out_ and check out the _Live Demo_
2022-04-02 12:06:06 +02:00
### Upgrade Version
2021-11-07 09:42:36 +01:00
2022-04-02 12:06:06 +02:00
1. Increase the version of the `ghostfolio/ghostfolio` Docker image in `docker/docker-compose.yml`
1. Run the following command to start the new Docker image: `docker-compose -f docker/docker-compose.yml up -d`
1. Then, run the following command to keep your database schema in sync: `docker-compose -f docker/docker-compose.yml exec ghostfolio yarn database:migrate`
2021-11-07 09:42:36 +01:00
2022-05-26 17:59:09 +02:00
## Run with _Unraid_ (self-hosting)
Please follow the instructions of the Ghostfolio [Unraid Community App ](https://unraid.net/community/apps?q=ghostfolio ).
2021-10-30 12:54:14 -04:00
## Development
### Prerequisites
- [Docker ](https://www.docker.com/products/docker-desktop )
2021-04-21 21:14:06 +02:00
- [Node.js ](https://nodejs.org/en/download ) (version 14+)
2021-04-13 21:53:58 +02:00
- [Yarn ](https://yarnpkg.com/en/docs/install )
2022-04-02 06:47:58 +02:00
- A local copy of this Git repository (clone)
2021-04-13 21:53:58 +02:00
### Setup
1. Run `yarn install`
2021-12-22 18:09:00 +01:00
1. Run `docker-compose -f docker/docker-compose.dev.yml up -d` to start [PostgreSQL ](https://www.postgresql.org ) and [Redis ](https://redis.io )
2021-11-07 09:42:36 +01:00
1. Run `yarn database:setup` to initialize the database schema and populate your database with (example) data
2022-02-06 09:32:41 +01:00
1. Start the server and the client (see [_Development_ ](#Development ))
1. Create a new user via _Get Started_ (this first user will get the role `ADMIN` )
2021-07-04 22:19:09 +02:00
1. Go to the _Admin Control Panel_ and click _Gather All Data_ to fetch historical data
1. Click _Sign out_ and check out the _Live Demo_
2021-04-13 21:53:58 +02:00
2021-10-30 12:54:14 -04:00
### Start Server
2021-04-13 22:16:20 +02:00
2021-06-12 22:29:56 +02:00
< ol type = "a" >
2021-10-22 20:20:59 +02:00
< li > Debug: Run < code > yarn watch:server< / code > and click "Launch Program" in < a href = "https://code.visualstudio.com" > Visual Studio Code< / a > < / li >
2021-06-12 22:29:56 +02:00
< li > Serve: Run < code > yarn start:server< / code > < / li >
< / ol >
2021-04-13 22:16:20 +02:00
2021-10-30 12:54:14 -04:00
### Start Client
2021-04-13 22:16:20 +02:00
2021-06-12 22:29:56 +02:00
Run `yarn start:client`
2021-04-13 22:11:24 +02:00
2021-09-04 22:12:54 +02:00
### Start _Storybook_
Run `yarn start:storybook`
2022-04-02 12:06:06 +02:00
### Migrate Database
With the following command you can keep your database schema in sync:
```bash
yarn database:push
```
2021-04-13 22:11:24 +02:00
## Testing
Run `yarn test`
2021-04-18 19:01:31 +02:00
2022-04-02 10:29:41 +02:00
## Public API (experimental)
### Import Activities
#### Request
2022-04-02 10:47:26 +02:00
`POST http://localhost:3333/api/v1/import`
2022-04-02 10:29:41 +02:00
#### Authorization: Bearer Token
Set the header as follows:
```
"Authorization": "Bearer eyJh..."
```
#### Body
```
{
"activities": [
{
"currency": "USD",
"dataSource": "YAHOO",
"date": "2021-09-15T00:00:00.000Z",
"fee": 19,
"quantity": 5,
"symbol": "MSFT"
"type": "BUY",
"unitPrice": 298.58
}
]
}
```
| Field | Type | Description |
| ---------- | ------------------- | -------------------------------------------------- |
| accountId | string (`optional` ) | Id of the account |
| currency | string | `CHF` \| `EUR` \| `USD` etc. |
| dataSource | string | `MANUAL` (for type `ITEM` ) \| `YAHOO` |
| date | string | Date in the format `ISO-8601` |
| fee | number | Fee of the activity |
| quantity | number | Quantity of the activity |
| symbol | string | Symbol of the activity (suitable for `dataSource` ) |
| type | string | `BUY` \| `DIVIDEND` \| `ITEM` \| `SELL` |
| unitPrice | number | Price per unit of the activity |
#### Response
##### Success
`201 Created`
##### Error
`400 Bad Request`
```
{
"error": "Bad Request",
"message": [
"activities.1 is a duplicate activity"
]
}
```
2021-06-27 10:23:51 +02:00
## Contributing
Ghostfolio is **100% free** and **open source** . We encourage and support an active and healthy community that accepts contributions from the public - including you.
2021-09-11 12:06:28 +02:00
Not sure what to work on? We have got some ideas. Please join the Ghostfolio [Slack channel ](https://join.slack.com/t/ghostfolio/shared_invite/zt-vsaan64h-F_I0fEo5M0P88lP9ibCxFg ), tweet to [@ghostfolio\_ ](https://twitter.com/ghostfolio_ ) or send an e-mail to hi@ghostfol .io. We would love to hear from you.
2021-06-27 10:23:51 +02:00
2022-04-18 21:32:54 +02:00
If you like to support this project, get ** [Ghostfolio Premium ](https://ghostfol.io/pricing )** or ** [Buy me a coffee ](https://www.buymeacoffee.com/ghostfolio )**.
2021-04-18 19:01:31 +02:00
## License
2022-01-29 09:15:11 +01:00
© 2022 [Ghostfolio ](https://ghostfol.io )
2021-04-18 20:30:58 +02:00
2021-04-18 19:01:31 +02:00
Licensed under the [AGPLv3 License ](https://www.gnu.org/licenses/agpl-3.0.html ).