ASP.NET Core backend for portfolio analytics, stock fundamentals, user portfolios, transactions, and local financial data analysis.
The project is designed as a portfolio and training backend. It supports local SQLite persistence, JWT authentication, Swagger documentation, demo seed data, and optional integration with external financial data providers.
The backend is in active development and currently supports:
- user registration and login with JWT authentication
- refresh tokens
- user cash balance
- portfolio holdings
- buy/sell transactions
- local ticker database
- quote and time-series endpoints
- fundamental data storage
- analytics endpoints for financial ratios
- SQLite persistence with EF Core migrations
- Swagger/OpenAPI documentation
- demo seed data for selected companies
The project is intended to run locally without external API keys for demo and database-backed workflows.
External provider keys are only required for live data ingestion:
- Financial Modeling Prep: fundamentals and company profile data
- Alpha Vantage: quote and price data
Without API keys, database-backed workflows can use local seed data and stored records. Live ingestion endpoints require provider keys.
Demo data is stored in:
Portfolio.Api/SeedData/companies/
Portfolio.Api/Data/companies-fallback.json
- C#
- .NET 8
- ASP.NET Core Web API
- EF Core
- SQLite
- JWT authentication
- Swagger/OpenAPI
- xUnit
- Financial Modeling Prep integration
- Alpha Vantage integration
From the repository root:
cd .\Portfolio.Api
dotnet runThe API listens on:
http://localhost:5046
Swagger UI is available at:
http://localhost:5046/swagger
Default local configuration uses SQLite:
{
"ConnectionStrings": {
"Default": "Data Source=portfolio.db"
},
"AlphaVantage": {
"BaseUrl": "https://www.alphavantage.co",
"ApiKey": ""
},
"Fmp": {
"ApiKey": ""
},
"Jwt": {
"Secret": "CHANGE_ME_USE_USER_SECRETS"
},
"DemoMode": true
}For local authentication and optional live external data, configure user secrets:
cd .\Portfolio.Api
dotnet user-secrets set "Jwt:Secret" "<your-local-jwt-secret>"
dotnet user-secrets set "Fmp:ApiKey" "<your-fmp-api-key>"
dotnet user-secrets set "AlphaVantage:ApiKey" "<your-alpha-vantage-api-key>"Jwt:Secret is required for authentication. Fmp:ApiKey and AlphaVantage:ApiKey are only required for live provider calls.
Do not commit real API keys, secrets, or local database files.
The local SQLite database file is created as:
Portfolio.Api/portfolio.db
Database files are ignored by Git.
To reset local data during development, stop the API and remove or rename the database file:
cd .\Portfolio.Api
Rename-Item .\portfolio.db portfolio.old.dbThen start the API again.
GET /health- Swagger UI:
http://localhost:5046/swagger
POST /api/User/registerPOST /api/User/loginPOST /api/User/refreshPOST /api/User/logoutGET /api/User/meGET /api/User/balancePOST /api/User/depositPOST /api/User/withdraw
GET /api/UserCompanyPOST /api/UserCompanyPUT /api/UserCompany/{id}DELETE /api/UserCompany/{id}
POST /api/UserCompanyTransactionsGET /api/UserCompanyTransactions/mineGET /api/UserCompanyTransactions/by-symbol/{symbol}
GET /api/companiesGET /api/companies/searchPOST /api/companies/addPOST /api/companies/add-popular
GET /api/quotes/latestGET /api/quotes/timeseriesGET /api/quotes/ohlcGET /api/analytics/roeGET /api/analytics/peGET /api/analytics/pbGET /api/analytics/fcf-yield
Run tests from the repository root:
dotnet test- Detailed backend guide
- Analytics endpoints
- OpenAPI specification
- Postman collection
- Commit conventions
Frontend repository:
This project is a portfolio and training project focused on ASP.NET Core, EF Core, authentication, financial data modeling, local-first workflows, and API integration.