Skip to content

Commit

Permalink
Merge pull request #27 from viventriglia/develop
Browse files Browse the repository at this point in the history
v0.2.2
  • Loading branch information
viventriglia authored Nov 8, 2024
2 parents 1855259 + 25ab124 commit 8a75bc9
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 12 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
.venv/
.vscode/
jupyters/
README.md
LICENSE
Dockerfile
8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ FROM python:3.10-slim

WORKDIR /app

COPY . .
RUN pip install poetry==1.5.1

RUN pip3 install poetry==v1.5.1
COPY pyproject.toml poetry.lock ./

RUN poetry install --no-root

COPY . .

EXPOSE 8501

ENTRYPOINT ["poetry", "run", "streamlit", "run", "./src/0_🏠_Home.py", "--server.port=8501", "--server.address=0.0.0.0"]
ENTRYPOINT ["poetry", "run", "streamlit", "run", "./src/0_🏠_Home.py", "--server.port=8501", "--server.address=0.0.0.0"]
25 changes: 17 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,14 @@
<br><br>
PFN allows you to analyse your portfolio from **multiple perspectives**: from **higher-level metrics** (profit & loss, asset class weights) to those allowing you to study **risk** and **returns** in depth, especially over time. To use the app, you don't need to create an account! You just need to set up your buy/sell transactions: PFN takes care of downloading historical prices from [Yahoo Finance](https://finance.yahoo.com/) and analysing them for you!
<br><br>
We do not collect or store any data. Nor do we provide any guarantee of the accuracy
of the results displayed, which are intended for educational and informational
purposes only.
<center><sub><sup>
We do not collect or store any data. We provide no guarantee, explicit or implicit, as to the accuracy of the results displayed, which are intended for educational and informational purposes only.
</sup></sub></center>
<br>

| ![PFN at play amidst a vivid dawn](images/cover_2.jpeg) |
|:--:|
| *Generated image of PFN at play amidst a vivid dawn* |

## How can I run it?

Expand All @@ -31,17 +36,21 @@ Launch the **web app** via
- `streamlit run ./src/0_🏠_Home.py`

### Docker
To build the app's docker image
To build the app's Docker image

- `docker build -t personal-finance-for-newbies .`

To run the docker image and expose it on a preferred port (for example 8080)
To run the Docker image and expose it on a preferred port (for example 8080)

- `docker run --rm -p 8080:8501 personal-finance-for-newbies`

To run the Docker image using the host's network (which will make the app accessible on port 8501)

- `docker run -p 8080:8501 personal-finance-for-newbies`
- `docker run --rm --network host personal-finance-for-newbies`

To run the docker image using the host's network (which will make the app accessible on port 8501)
Alternatively, on Windows you simply launch

- `docker run --network host personal-finance-for-newbies`
- `scripts/run-web-app.ps1`

## How can I use my own data?
To load and use your data, download and fill in the template with your accumulation plan's buy/sell transactions and upload it. Make sure you fill it in correctly. The fields to be entered are:
Expand Down
12 changes: 12 additions & 0 deletions scripts/run-web-app.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
$imageName = "personal-finance-for-newbies"

$exists = docker images -q $imageName

if (-not $exists) {
Write-Host "The image does not exist. Building it now..."
docker build -t $imageName .
} else {
Write-Host "The image '$imageName' already exists, the app is running at http://localhost:8080"
}

docker run --rm -p 8080:8501 $imageName
2 changes: 1 addition & 1 deletion src/var.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
os.path.join(*split_script_running_path[0 : len(split_script_running_path) - 1])
)

APP_VERSION = "0.2.1"
APP_VERSION = "0.2.2"

# Data/images

Expand Down

0 comments on commit 8a75bc9

Please sign in to comment.