Skip to content

punkouter26/PoRobotStocks

Repository files navigation

PoRobotStocks πŸ€–πŸ“ˆ

.NET 9 Azure License

PoRobotStocks is an intelligent web application designed for retail investors interested in discovering and analyzing affordable robotics and automation companies. The platform combines real-time market data with Azure AI-powered analysis to provide actionable investment insights for stocks priced $10 or lower.

πŸš€ Features

  • Smart Stock Discovery: Automatically filters stocks to show only companies with prices ≀ $10
  • Azure AI Integration: GPT-4o powered analysis with sentiment scoring and buy recommendations
  • Real-time Market Data: Live stock prices via Alpha Vantage API
  • Interactive Dashboard: Clean, card-based interface with instant stock details
  • Watchlist Management: Track your favorite affordable robotics stocks
  • Health Monitoring: Built-in diagnostics for all connected services

πŸ› οΈ Technology Stack

Frontend

  • Blazor WebAssembly (.NET 9) - Interactive single-page application
  • Bootstrap 5 - Responsive UI components
  • Modern CSS - Clean, professional styling

Backend API

  • FastEndpoints - High-performance API endpoints
  • ASP.NET Core 9 - Web API foundation
  • Serilog - Structured logging

Data & Storage

  • Azure Table Storage - Primary data persistence
  • Azurite Emulator - Local development storage

AI & Analytics

  • Azure OpenAI (GPT-4o) - Intelligent stock analysis
  • Azure AI Language Services - Sentiment analysis
  • Alpha Vantage API - Real-time market data

Development Tools

  • Clean Architecture - Domain-driven design patterns
  • MediatR - CQRS command/query handling
  • Ardalis Specifications - Repository pattern implementation

πŸ“‹ Prerequisites

☁️ Deployment

Production Deployment (Azure)

The application is deployed to Azure using GitHub Actions with federated credentials.

Live URL: https://porobotstocks.azurewebsites.net

Deployed Resources

  • App Service Plan: PoShared-plan (F1 Free tier, Windows)
  • App Service: PoRobotStocks
  • Storage Account: porobotstocksstorage
  • Azure OpenAI: PoRobotStocks-openai (gpt-4o model)
  • Azure AI Language: PoRobotStocks-language (F0 free tier)
  • Application Insights: PoRobotStocks-insights
  • Log Analytics: PoRobotStocks-logs

CI/CD Pipeline

Deployments are triggered automatically on push to the master branch via GitHub Actions:

  1. Provision: Infrastructure provisioning using Bicep templates
  2. Build: .NET 9 build and publish
  3. Deploy: Deployment to Azure App Service

Manual Deployment

# Login to Azure
azd auth login

# Provision infrastructure
azd provision

# Deploy application
azd deploy

πŸƒβ€β™‚οΈ Getting Started

1. Clone and Setup

git clone https://github.com/punkouter25/PoRobotStocks.git
cd PoRobotStocks

2. Configure Azure Services

Create appsettings.Development.json in src/PoRobotStocks.Web/ with your API keys:

{
  "ConnectionStrings": {
    "TableStorageConnection": "DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;TableEndpoint=http://127.0.0.1:10002/devstoreaccount1;"
  },
  "AlphaVantage": {
    "ApiKey": "YOUR_ALPHA_VANTAGE_API_KEY"
  },
  "AzureOpenAI": {
    "Endpoint": "https://your-openai.openai.azure.com/",
    "ApiKey": "YOUR_AZURE_OPENAI_API_KEY",
    "ChatModel": "gpt-4o"
  },
  "AzureAI": {
    "Language": {
      "Endpoint": "https://your-language.cognitiveservices.azure.com/",
      "ApiKey": "YOUR_AZURE_AI_LANGUAGE_API_KEY"
    }
  }
}

3. Start Azurite Storage Emulator

azurite --silent --location ./azurite --debug ./azurite/debug.log

4. Run the Application

dotnet run --project src/PoRobotStocks.Web

5. Access the Application

πŸ”Œ API Endpoints

Endpoint Method Description
/api/stocks GET List all affordable stocks (≀ $10)
/api/stocks/{ticker} GET Get detailed stock information
/api/stocks/refresh POST Refresh stock data from APIs
/health GET Application health status

πŸ—„οΈ Database Connections

Azure Table Storage

  • Purpose: Primary data persistence for stocks, watchlists, and user data
  • Local: Azurite emulator (http://127.0.0.1:10002/devstoreaccount1)
  • Production: Azure Storage Account via connection string
  • Tables: Stocks, Watchlists, UserPreferences

External APIs

Alpha Vantage API

  • Purpose: Real-time stock market data and pricing
  • Endpoint: https://www.alphavantage.co/
  • Rate Limit: 25 requests/day (free tier)
  • Data: Current prices, historical data, company fundamentals

Azure OpenAI (GPT-4o)

  • Purpose: Intelligent stock analysis and buy recommendations
  • Model: gpt-4o for advanced reasoning
  • Features: Company analysis, market trend evaluation, risk assessment

Azure AI Language Services

  • Purpose: Sentiment analysis of news and social media
  • Features: News sentiment scoring, social media analysis
  • Endpoint: Azure Cognitive Services Language API

πŸ§ͺ Development

Debug in VS Code

  1. Press F5 to start debugging
  2. Select "Development" or "Production" launch profile
  3. Application opens automatically in browser

Project Structure

src/
β”œβ”€β”€ PoRobotStocks.Core/           # Domain models and interfaces
β”œβ”€β”€ PoRobotStocks.Infrastructure/ # External service implementations
β”œβ”€β”€ PoRobotStocks.Web/           # FastEndpoints API
└── PoRobotStocks.Blazor/        # Blazor WebAssembly UI

Key Features

  • Stock Filtering: Only shows stocks ≀ $10 for affordability focus
  • AI Analysis: Each stock gets an AI-powered buy score (0-10)
  • Real-time Updates: Live price data with change indicators
  • Responsive Design: Works on desktop, tablet, and mobile

πŸ” Monitoring & Health

  • Health Endpoints: /health for basic checks, /diag for detailed diagnostics
  • Logging: Structured logging with Serilog to console and files
  • Error Handling: Graceful degradation when external APIs are unavailable

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Built with ❀️ for affordable robotics investing

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors