Skip to content

Latest commit

Β 

History

History
88 lines (65 loc) Β· 2.67 KB

File metadata and controls

88 lines (65 loc) Β· 2.67 KB

Portfolio Manager Workshop

A full-stack finance/equity application for learning Gitpod and dev containers.

πŸ“š Workshop Guide

Follow the comprehensive workshop guide in WORKSHOP.md to learn:

πŸ—οΈ Architecture

  • Frontend: React + Vite (Port 3000)
  • Backend: Node.js + Express (Port 3001)
  • Database: SQLite (better-sqlite3) - Embedded database stored in backend/portfolio.db

πŸ“ Project Structure

workshop/
β”œβ”€β”€ .devcontainer/
β”‚   β”œβ”€β”€ devcontainer.json    # Dev container configuration
β”‚   └── Dockerfile            # Container image definition
β”œβ”€β”€ .ona/
β”‚   └── automations.yaml      # Ona automations configuration
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ server.js             # Express API server
β”‚   β”œβ”€β”€ init-db.js            # Database initialization
β”‚   └── package.json          # Backend dependencies
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ App.jsx           # Main React component
β”‚   β”‚   β”œβ”€β”€ components/       # React components
β”‚   β”‚   └── index.css         # Styles
β”‚   β”œβ”€β”€ index.html            # HTML entry point
β”‚   β”œβ”€β”€ vite.config.js        # Vite configuration
β”‚   └── package.json          # Frontend dependencies
β”œβ”€β”€ WORKSHOP.md               # Workshop exercises
└── README.md                 # This file

🎯 Features

  • Portfolio Management: Create and track investment portfolios
  • Stock Trading: Buy and sell stocks with real-time calculations
  • Performance Metrics: View gain/loss, returns, and portfolio value
  • Transaction History: Complete audit trail of all trades
  • Responsive Design: Works on desktop and mobile devices

πŸ”§ Useful Commands

# View automation status
gitpod automations service list
gitpod automations task list-executions

# Initialize/reset database
cd backend && node init-db.js

# Check running services
ps aux | grep node

# Test API
curl http://localhost:3001/api/health

# View database file
ls -lh backend/portfolio.db

πŸ“– API Endpoints

  • GET /api/health - Health check
  • GET /api/portfolios - List all portfolios
  • GET /api/portfolios/:id - Get portfolio with holdings
  • GET /api/stocks - List all available stocks
  • GET /api/portfolios/:id/transactions - Get transaction history
  • POST /api/transactions - Create a new transaction
  • PUT /api/stocks/:id/price - Update stock price

🀝 Contributing

This is a workshop project. Feel free to fork and experiment!

πŸ“ License

MIT License - feel free to use this for learning and teaching.


Ready to start? Open WORKSHOP.md and begin with Exercise 1!