A console-based stock price monitor built in C# that integrates with financial APIs to track B3 (Brazilian Stock Exchange) assets. The project emphasizes asynchronous HTTP communication, secure credential management, and clean input validation.
- Near Real-Time Monitoring: Polls live stock prices from the Brapi API at 30-second intervals.
- Secure Secrets Management: Uses .NET User Secrets to ensure API tokens are never exposed in the source code.
- Error Handling: Handles network issues and invalid stock tickers (HTTP 404).
- Input Validation: Validates stock symbols and target prices before monitoring begins.
- Audio Alerts: Emits an audible alert when the target price is reached (Windows only).
This project follows industry best practices for secret management by isolating credentials from source code. API tokens are stored locally using the .NET Secret Manager, making the repository safe for public display.
- C# / .NET 10
- System.Text.Json for high-performance JSON serialization.
- Microsoft.Extensions.Configuration for secure configuration and secret handling.
- Uses polling instead of WebSockets due to API limitations.
- Console-based by design to emphasize core C# and .NET fundamentals.
- Secrets are managed locally using .NET User Secrets to avoid credential exposure.
- Persist monitoring logs to local files.
- Improve graceful shutdown handling (Ctrl + C).
- Refactor API communication into a dedicated service layer.
- .NET 10 SDK
- Free API token from Brapi
- Clone the repository
git clone https://github.com/EduardoCassanha/seeprices.git
cd seeprices- Configure your API token
dotnet user-secrets init
dotnet user-secrets set "BrapiToken" "your-token-here"- Run the application
dotnet runThis project is licensed under the MIT License - see the LICENSE file for details.
