--- title: 'Portfolio Quick Start' description: 'Get started with portfolio tracking in minutes' --- ## Quick Setup Guide Get your portfolio up and running in just a few minutes. ## Step 1: Get Your Finnhub API Key Go to [Finnhub.io](https://finnhub.io/register) and sign up for a free account After logging in, copy your API key from the dashboard ## Step 2: Configure the API Key Add your Finnhub API key to the `.env.docker` file (or `.env` if running locally): ```bash .env.docker FINNHUB_API_KEY=your_api_key_here ``` The `.env.docker` file already has a placeholder for the API key. ## Step 3: Deploy/Restart the Application If you're already running the application, restart it to load the new environment variable: ```bash docker compose down docker compose up -d ``` For first-time deployment: ```bash ./deploy.sh ``` ```batch deploy.bat ``` ## Step 4: Apply Database Schema The portfolio holdings table needs to be created in your database: ```bash # Access the database container docker compose exec postgres psql -U trading_user -d mining_wood # Run the schema file \i /docker-entrypoint-initdb.d/portfolio_schema.sql # Or run it directly from the host docker compose exec -T postgres psql -U trading_user -d mining_wood < database_init/portfolio_schema.sql ``` ## Step 5: Access the Portfolio Page Navigate to `http://localhost:8080` You should be redirected to the Portfolio Management page (now the default landing page) If you see an error, check the application logs: ```bash docker compose logs -f trading_app ``` ## Step 6: Add Your First Holding ### Option A: Manual Entry Click the **"Add Holding"** button - **Symbol**: Enter a stock ticker (e.g., AAPL) - **Type**: Select "stock", "etf", or "mutual_fund" - **Shares**: Enter the number of shares you own - **Average Cost**: Enter your average cost per share - **Notes**: (Optional) Add any notes Click **"Save"** ### Option B: CSV Upload Create a CSV file with your holdings: ```csv symbol,type,shares,average_cost,notes AAPL,stock,100,150.50,Apple Inc MSFT,stock,50,300.00,Microsoft VOO,etf,25,400.00,S&P 500 ETF ``` - Click the **"Upload CSV"** button - Select your CSV file - Click **"Upload"** ## Step 7: Refresh Prices Click the **"Refresh Prices"** button to fetch current market prices from Finnhub for all your holdings. ## Troubleshooting **Solution**: Verify your API key is set correctly in `.env.docker` and you've restarted the containers. ```bash # Check if environment variable is loaded docker compose exec trading_app env | grep FINNHUB ``` **Solution**: Run the portfolio schema script: ```bash docker compose exec -T postgres psql -U trading_user -d mining_wood < database_init/portfolio_schema.sql ``` **Solution**: Make sure your CSV file has the correct format with columns: `symbol`, `type`, `shares`, `average_cost`, `notes` **Solution**: Check the logs for errors: ```bash docker compose logs -f trading_app ``` ## Next Steps Learn more about portfolio features Analyze your trading performance