RemiSeg: make this a single markdown file to copy paste as a read me ::
A Java Spring Boot backend for a fintech portfolio visualization platform that allows users to create portfolios, add stocks from a predefined universe, calculate portfolio performance metrics, compare portfolios and stocks, and retrieve real market data through external financial APIs.
This project was built as a personal fintech engineering project to demonstrate backend architecture, API design, financial data processing, portfolio analytics, and clean service-oriented development.
The goal of this project is to build the backend foundation for a portfolio visualization application.
The application is not a trading platform. It does not execute real trades, store brokerage accounts, or manage real financial assets. Instead, it focuses on portfolio construction, visualization, comparison, and financial analytics.
Users can:
- Create an account and log in
- Create up to 3 personal portfolios
- Add up to 10 stocks per portfolio
- Select stocks from a predefined stock universe stored in Supabase
- View real stock information and historical price data
- Calculate portfolio-level metrics
- Compare portfolios against other portfolios or individual stocks
- Use the backend through a REST API consumed by a Vue frontend
The project is designed to show how a clean backend can support a real fintech-style product with proper separation of concerns, external API integration, persistence, and analytics.
The backend provides simple authentication for users.
Current authentication functionality includes:
- User signup
- User login
- User identity stored in Supabase
- User-specific portfolio ownership
This is intentionally lightweight for the scope of the personal project. The goal is to support portfolio ownership and separate user data cleanly.
The application uses a predefined list of stocks stored in Supabase.
This design choice keeps the application controlled and reliable:
- Users cannot add random invalid tickers
- The frontend can display a clean list of supported stocks
- Backend validation is simpler and safer
- Portfolio analytics are based on known symbols
The backend exposes endpoints to:
- List available stocks
- Retrieve details for one stock
- Retrieve historical price data for one stock
Historical prices are retrieved from Yahoo Finance rather than permanently stored in the database.
Users can create and manage portfolios.
Business rules:
- Each user can create a maximum of 3 portfolios
- Each portfolio can contain a maximum of 10 stocks
- Each stock in a portfolio can have an allocation or quantity depending on the backend model
- Portfolios are persisted in Supabase
- Portfolio ownership is enforced through the backend service layer
Portfolio operations include:
- Create portfolio
- Read portfolio
- List user portfolios
- Update portfolio
- Delete portfolio
- Add stocks to a portfolio
- Remove stocks from a portfolio
The portfolio module is one of the central parts of the backend because it connects user data, stock data, Supabase persistence, and financial analytics.
The backend retrieves stock price data from Yahoo Finance.
This allows the application to calculate real financial metrics without maintaining a local market-data database.
The backend uses Yahoo Finance for:
- Historical stock prices
- Stock return calculations
- Portfolio performance calculations
- Single-stock comparison
- Portfolio comparison
This keeps the project lightweight while still making the analytics realistic.
The backend calculates key portfolio and stock metrics.
Supported metrics include:
- Total return
- Volatility
- Maximum drawdown
These metrics are useful because they show both return and risk.
Total return measures how much the value of a stock or portfolio changed over a period.
It answers:
“How much did this investment grow or decline?”
Volatility measures how much returns fluctuate over time.
It answers:
“How risky or unstable was this investment?”
Maximum drawdown measures the largest peak-to-trough decline.
It answers:
“What was the worst loss from a previous high?”
Together, these metrics provide a simple but meaningful view of performance and risk.
The comparison service allows the backend to compare:
- Portfolio vs portfolio
- Portfolio vs stock
- Stock vs stock
The comparison module uses the same market-data and analytics logic as the portfolio service.
This feature makes the application more useful from a product perspective because users can evaluate different strategies, baskets of stocks, or individual assets.
The backend follows a layered Spring Boot architecture.
The main layers are:
Controllers
↓
Services
↓
Repositories / External API Clients
↓
Supabase / Yahoo Finance
Each layer has a specific responsibility.
4. Architecture Overview
Frontend Vue App
|
| REST API
v
Spring Boot Backend
|
|--- Auth Controller
|--- Stock Controller
|--- Portfolio Controller
|--- Compare Controller
|
v
Service Layer
|
|--- Auth Service
|--- Stock Service
|--- Portfolio Service
|--- Metrics Service
|--- Compare Service
|
v
Data Access Layer
|
|--- Supabase Repositories
|--- Yahoo Finance Client
|
v
External Systems
|
|--- Supabase Database
|--- Yahoo Finance Market Data
---
## Project Purpose
Portfolio Visualizer is a personal fintech engineering project designed to demonstrate:
- Clean backend/frontend separation
- Real REST API integration
- Financial data visualization
- Portfolio analytics
- Maintainable architecture
- Professional UI/UX design
- Practical understanding of portfolio metrics
**Important:** This is not a trading application. It does not execute real trades, store brokerage accounts, or manage real financial assets. Instead, it focuses on portfolio construction, visualization, comparison, and financial analytics.
---
## Core Features
Users can:
1. Sign up and log in
2. View default portfolios
3. View user-created portfolios
4. Create up to 3 portfolios
5. Add up to 10 stocks per portfolio
6. Assign portfolio weights that sum to 100%
7. View portfolio performance over time
8. View portfolio metrics:
- Total return
- Volatility
- Max drawdown
9. View supported stocks
10. View stock historical price charts
11. Compare:
- Portfolio vs portfolio
- Stock vs stock
- Portfolio vs stock
---
## System Architecture
Frontend Vue App ↓ (REST API) v Spring Boot Backend | |--- Auth Controller |--- Stock Controller |--- Portfolio Controller |--- Compare Controller | v Service Layer | |--- Auth Service |--- Stock Service |--- Portfolio Service |--- Metrics Service |--- Compare Service | v Data Access Layer | |--- Supabase Repositories |--- Yahoo Finance Client | v External Systems | |--- Supabase Database |--- Yahoo Finance Market Data
---
## Backend Stack
- Java Spring Boot
- REST API
- Supabase PostgreSQL
- Yahoo Finance API for real stock prices
- Controller → Service → Repository architecture
### Backend API Endpoints
#### Auth
```http
POST /auth/signup
POST /auth/login
GET /stocks
GET /stocks/{ticker}
GET /stocks/{ticker}/history?range=1M|3M|6M|1Y|ALLGET /portfolios/default
GET /portfolios/user/{userId}
GET /portfolios/{portfolioId}
POST /portfolios
PUT /portfolios/{portfolioId}
DELETE /portfolios/{portfolioId}POST /compare- Vue 3
- Vite
- Vue Router
- Pinia (state management)
- Axios (HTTP client)
- ApexCharts (data visualization)
- Tailwind CSS
frontend/
├── src/
│ ├── api/
│ │ ├── http.js
│ │ ├── authApi.js
│ │ ├── stocksApi.js
│ │ ├── portfoliosApi.js
│ │ └── compareApi.js
│ │
│ ├── router/
│ │ └── index.js
│ │
│ ├── stores/
│ │ ├── authStore.js
│ │ ├── portfolioStore.js
│ │ └── stockStore.js
│ │
│ ├── layouts/
│ │ └── AppLayout.vue
│ │
│ ├── pages/
│ │ ├── LoginPage.vue
│ │ ├── DashboardPage.vue
│ │ ├── PortfolioFormPage.vue
│ │ ├── PortfolioDetailPage.vue
│ │ ├── StocksPage.vue
│ │ ├── StockDetailPage.vue
│ │ └── ComparePage.vue
│ │
│ ├── components/
│ │ ├── layout/
│ │ │ ├── Sidebar.vue
│ │ │ └── Topbar.vue
│ │ │
│ │ ├── common/
│ │ │ ├── BaseButton.vue
│ │ │ ├── BaseCard.vue
│ │ │ ├── ErrorState.vue
│ │ │ ├── LoadingState.vue
│ │ │ ├── MetricCard.vue
│ │ │ └── MetricsComparisonTable.vue
│ │ │
│ │ ├── charts/
│ │ │ ├── PerformanceLineChart.vue
│ │ │ ├── StockPriceChart.vue
│ │ │ └── ComparisonLineChart.vue
│ │ │
│ │ ├── portfolios/
│ │ │ ├── PortfolioCard.vue
│ │ │ ├── PortfolioForm.vue
│ │ │ └── HoldingsTable.vue
│ │ │
│ │ └── stocks/
│ │ └── StockSummaryCard.vue
│ │
│ ├── utils/
│ │ └── formatters.js
│ │
│ ├── App.vue
│ ├── main.js
│ └── style.css
Each layer has one clear responsibility:
- Controllers handle HTTP requests and responses
- Services contain business logic and enforce rules
- Repositories handle database persistence
- Clients manage external API integration
The backend retrieves stock price data from Yahoo Finance rather than maintaining a local database. This keeps the project lightweight while making analytics realistic.
Users can only add stocks from a predefined list stored in Supabase. This:
- Prevents invalid ticker additions
- Simplifies validation
- Ensures data quality
- Makes the frontend experience clean
The system calculates three key metrics:
- Total Return: How much the investment grew or declined
- Volatility: How much returns fluctuate (risk measure)
- Maximum Drawdown: The largest peak-to-trough decline
- Simple signup and login
- User identity stored in Supabase
- User-specific portfolio ownership
- Maximum 3 portfolios per user
- Maximum 10 stocks per portfolio
- Portfolio weights must sum to 100%
- Stocks must come from predefined universe
- Predefined stock universe in Supabase
- Real historical data from Yahoo Finance
- Support for multiple time ranges (1M, 3M, 6M, 1Y, ALL)
- Frontend sends
POST /portfolios - Backend validates user authentication
- Service checks portfolio limit (< 3)
- Repository creates portfolio in Supabase
- Backend returns created portfolio
- Frontend sends
POST /portfolios/{id}/stocks - Backend verifies portfolio ownership
- Service checks stock limit (< 10 per portfolio)
- Service validates stock exists in universe
- Repository saves holding in Supabase
- Backend returns updated portfolio
- Frontend requests portfolio analytics
- Service loads portfolio holdings from Supabase
- Client retrieves historical prices from Yahoo Finance
- Metrics service calculates return, volatility, max drawdown
- Backend returns portfolio with metrics and performance data
- Frontend sends comparison request
- Backend identifies comparison type
- Service loads portfolio data from Supabase
- Client retrieves historical prices
- Metrics service calculates metrics for each portfolio
- Backend returns structured comparison response
- Clean, layered backend architecture
- REST API design and integration
- Real database persistence (Supabase)
- External API integration (Yahoo Finance)
- Financial data processing and analytics
- Business rule enforcement
- Frontend-ready service design
- Vue 3 component architecture
- State management with Pinia
- Professional UI/UX with Tailwind CSS
- Full-stack product thinking
- Portfolio creation and management
- Stock visualization and analytics
- Portfolio and stock comparison
- Real-time financial metrics
- Professional analytics dashboard
- Real money trading
- Buy/sell orders or transactions
- Broker integration
- Cash balance management
- Production-grade risk management
- Real-time streaming data
- Java 17+
- Maven
- Supabase project
- Internet connection for Yahoo Finance
# Install dependencies
mvn clean install
# Set environment variables
export SUPABASE_URL=your_supabase_project_url
export SUPABASE_KEY=your_supabase_key
# Run backend
mvn spring-boot:run
# Backend runs on http://localhost:8080- Node.js 16+
- npm or yarn
cd frontend
# Install dependencies
npm install
# Run development server
npm run dev
# Frontend runs on http://localhost:5173Functional core implementation
Authentication system
Portfolio CRUD operations
Stock universe management
Yahoo Finance integration
Portfolio metrics calculation
Comparison service
REST API ready for frontend
Vue 3 architecture
Component hierarchy
State management (Pinia)
API integration layer
Chart visualizations
Portfolio management UI
Comparison interface
Backend
- Java
- Spring Boot
- Maven
- REST APIs
Frontend
- Vue 3
- Vite
- Vue Router
- Pinia
- Axios
- ApexCharts
- Tailwind CSS
Database & Data
- Supabase (PostgreSQL)
- Yahoo Finance API
This is more than basic CRUD development. It demonstrates the ability to:
- Design a complete backend system
- Integrate external financial data sources
- Build meaningful analytics functionality
- Create a professional REST API
- Combine backend and frontend into a cohesive product
- Understand financial domain concepts
- Build clean, maintainable architecture
From a recruiter perspective, this project is valuable because it connects software engineering with fintech reasoning—especially relevant for roles in:
- Backend software engineering
- Fintech engineering
- Full-stack development
- API design and integration
- Data-driven applications
Separation of Concerns – Each layer has one responsibility
Business Logic in Services – Controllers stay thin
External Data Isolation – Market data logic is modular
Database Simplicity – Store state, not history
Realistic Scope – Complex enough to show depth, focused enough to understand
- JWT-based authentication
- Advanced metrics (Sharpe ratio, Beta, Correlation)
- Sector allocation analysis
- Portfolio optimization algorithms
- Benchmark comparison
- Watchlists
- Performance caching
- Docker deployment
- CI/CD pipeline
- Production deployment
Status: Full-stack implementation ready for deployment. Backend serves REST API. Frontend consumes API and provides professional portfolio visualization interface.