Metadata-Version: 2.4
Name: tossinvest-web
Version: 0.1.0
Summary: Local web dashboard for tossinvestsdk
Author: HG
Keywords: toss,tossinvest,trading,dashboard,web
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Office/Business :: Financial :: Investment
Classifier: Typing :: Typed
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: fastapi<1,>=0.116
Requires-Dist: tossinvest-strategy>=0.2.1
Requires-Dist: uvicorn[standard]<1,>=0.35

# tossinvest-web

Local web dashboard for [tossinvestsdk](https://pypi.org/project/tossinvest-strategy/).

`tossinvest-web` runs on your computer and presents account holdings, local
strategy state, cycle progress, and trade history in one browser dashboard. It
does not upload credentials, tokens, strategy state, or trade history anywhere.

## Screenshots

### Portfolio

![Redacted portfolio dashboard](https://raw.githubusercontent.com/choco0908/TossAutoTradingSystem/master/tossinvest-web/docs/images/dashboard-redacted.png)

### Strategy overview

![Redacted strategy overview](https://raw.githubusercontent.com/choco0908/TossAutoTradingSystem/master/tossinvest-web/docs/images/strategy-overview-redacted.png)

The screenshots use intentionally redacted data. The dashboard renders your
own account and local strategy data when it runs.

## Install

```bash
pip install tossinvest-web
```

For local development from the source repository:

```bash
pip install -e .
pip install -e packages/tossinvest-web
```

## Before you run it

Create a working directory for local data and place the Toss Invest SDK
credential file there. The SDK creates and refreshes `token.json` after the
first authenticated request.

```text
my-tossinvest/
  credentials
  token.json                 # created locally; never commit this file
  strategy_state/            # optional local strategy state
  trade_history/             # optional local trade history
```

The default `credentials` format is:

```text
client_id: your_client_id
client_secret: your_client_secret
account_number: your_account_number
```

Keep `credentials`, `token.json`, `strategy_state/`, and `trade_history/` out
of public repositories and shared folders.

## Run

Run the command from the local data directory:

```bash
tossinvest-web --host 127.0.0.1 --port 8000
```

Open [http://127.0.0.1:8000](http://127.0.0.1:8000) in a browser.

For development, reload the server when Python or static files change:

```bash
tossinvest-web --host 127.0.0.1 --port 8000 --reload
```

### Access from another device on the same network

Bind the server to all local network interfaces:

```bash
tossinvest-web --host 0.0.0.0 --port 8000
```

Then open `http://<your-computer-ip>:8000` from a device on the same Wi-Fi or
private network. Allow the port through the local firewall only for networks
you trust. Do not expose this server directly to the public internet.

## Configure file locations

By default, the current working directory is the data directory. Use these
environment variables when your SDK files live elsewhere:

```text
TOSSINVEST_DATA_DIR=C:\\path\\to\\my-tossinvest
TOSSINVEST_CREDENTIAL_FILE=C:\\path\\to\\credentials
TOSSINVEST_TOKEN_FILE=C:\\path\\to\\token.json
```

`TOSSINVEST_DATA_DIR` is enough when all of `credentials`, `token.json`,
`strategy_state/`, and `trade_history/` are stored together.

## Dashboard behavior

- **Portfolio** loads holdings from the Toss Invest API. Exchange-rate
  conversion is off by default and can be enabled from the dashboard.
- **Auto refresh** controls periodic portfolio refreshes. The selected refresh
  interval and dashboard filters are remembered in the browser.
- **Strategy Overview** reads local strategy state files and groups execution
  items under their strategy type.
- **Value Rebalancing** supports local manual trade and capital-injection
  records for strategies operated through another broker.
- **Trade Log** reads local trade history and filters by date range.

The web package is a local dashboard. Account access still comes through the
installed `tossinvestsdk` package and your local Toss Open API credentials.
