A comprehensive web-based stock analysis platform built with React, Spring Boot, and multiple financial APIs, featuring AI-powered analysis and sentiment detection. The platform provides real-time data visualization, technical analysis, news sentiment analysis, and personalized watchlists.
- Real-time Stock Data: Live price updates and historical charts with multiple timeframes
- AI-Powered Analysis: Stock analysis summaries generated by advanced LLM models
- Advanced Sentiment Analysis: Multi-layered sentiment detection for news articles with confidence scoring
- Technical Indicators: Visualization of key technical indicators for informed trading decisions
- Industry Comparison: Compare stocks with industry peers across key metrics
- Personalized Watchlists: Save favorite stocks for quick access
- Responsive Design: Fully functional across desktop and mobile devices
- Dark/Light Mode: User-customizable interface theme
graph TD
A[Frontend: React/Vite] --> B(Backend: Spring Boot);
B --> C{External APIs};
subgraph "External APIs"
C --> FIN[Finnhub];
C --> SERP[SerpAPI];
C --> RAPID[RapidAPI: Yahoo Finance];
C --> POLY[Polygon.io];
C --> GROQ[Groq AI];
end
B --> DB[H2 Database];
subgraph Frontend
A
end
subgraph Backend
B
DB
end
subgraph "External Services"
FIN
SERP
RAPID
POLY
GROQ
end
classDef frontend fill:#C7D2FE,stroke:#4F46E5,color:#111827;
classDef backend fill:#DBEAFE,stroke:#1D4ED8,color:#111827;
classDef database fill:#FDE68A,stroke:#CA8A04,color:#111827;
classDef external fill:#D1FAE5,stroke:#047857,color:#111827;
class A frontend;
class B backend;
class DB database;
class FIN,SERP,RAPID,POLY,GROQ external;
- Frontend: A modern React application built with Vite, using Ant Design and Tailwind CSS for the UI. It interacts with the backend API.
- Backend: A robust Spring Boot application providing a REST API. It orchestrates calls to various external financial and AI APIs and manages data persistence using an H2 database.
- External APIs: The platform integrates multiple third-party services:
- Finnhub: Used for real-time stock quotes and company profile information.
- SerpAPI: The primary source for fetching news articles via Google News search.
- RapidAPI (Yahoo Finance): Serves as a fallback source for news articles when SerpAPI is unavailable.
- Polygon.io: Provides historical stock data (OHLCV) for charting and analysis.
- Groq API: Powers AI-driven analysis and sentiment detection for market data and news using the Llama-3-70B model.
- Database: An embedded H2 database stores application data (e.g., user preferences, potentially cached analysis).
React components fetch data from the backend API via services/hooks and display it using UI libraries.
graph LR
Comp[React Components] --> Hooks;
Hooks --> Serv[Services/API Utils];
Serv --> BE(Backend API);
classDef component fill:#C7D2FE,stroke:#4F46E5,color:#111827;
classDef hook fill:#A5F3FC,stroke:#0891B2,color:#111827;
classDef service fill:#E0E7FF,stroke:#4338CA,color:#111827;
classDef api fill:#DBEAFE,stroke:#1D4ED8,color:#111827;
class Comp component;
class Hooks hook;
class Serv service;
class BE api;
Spring Controllers handle incoming requests, delegate business logic to Services, which in turn use Clients to interact with external APIs or Repositories to access the database.
graph LR
Req(Incoming Request) --> Ctrl[Controllers];
Ctrl --> Serv[Services];
Serv --> Clients;
Serv --> Repos[Repositories];
Clients --> ExtAPI(External APIs);
Repos --> DB(Database);
classDef request fill:#FEF9C3,stroke:#EAB308,color:#111827;
classDef controller fill:#E0E7FF,stroke:#4338CA,color:#111827;
classDef service fill:#DBEAFE,stroke:#1D4ED8,color:#111827;
classDef client fill:#D1FAE5,stroke:#047857,color:#111827;
classDef repo fill:#FDE68A,stroke:#CA8A04,color:#111827;
classDef external fill:#D1FAE5,stroke:#047857,color:#111827;
classDef database fill:#FDE68A,stroke:#CA8A04,color:#111827;
class Req request;
class Ctrl controller;
class Serv service;
class Clients client;
class Repos repo;
class ExtAPI external;
class DB database;
- Real-time stock data visualization
- Interactive charts and technical indicators
- Portfolio tracking and analysis
- Latest market news with sentiment analysis
- AI-powered news relevance scoring
- Sentiment distribution visualization
- Advanced charting tools
- Technical indicators and patterns
- Historical data analysis
- Machine learning-based predictions
- Market trend analysis
- Risk assessment
- Frontend:
- React with JavaScript (JSX) + Vite
- UI: Ant Design (antd) + Tailwind CSS
- Charts: Chart.js + Recharts
- Routing: React Router
- Backend: Spring Boot 3.2.4 (Java 17) REST API
- Manages interactions with external APIs
- Provides data to the frontend
- Database: H2 Database (embedded, file-based)
- External APIs Used:
- Finnhub API: Real-time stock quotes, company profiles.
- SerpAPI: Primary news source (Google News search).
- RapidAPI (Yahoo Finance): Fallback news source.
- Polygon.io: Historical stock data.
- Groq API: LLM for AI analysis (
llama-3.3-70b-versatile).
- Deployment: Hetzner VPS with Nginx, HTTPS/SSL via Let's Encrypt, and systemd service management.
- Node.js (v18 or higher)
- Java 17 or higher
- API Keys (see below)
Before running the backend, create a .env file in the backend directory (backend/.env) with your API keys:
# backend/.env
FINNHUB_API_KEY=your_finnhub_api_key
SERPAPI_API_KEY=your_serpapi_api_key
POLYGON_API_KEY=your_polygon_api_key
GROQ_API_KEY=your_groq_api_key
RAPIDAPI_API_KEY=your_rapidapi_key
# Note: The RapidAPI host is configured in application.properties, not here.- Navigate to the frontend directory:
cd frontend - Install dependencies:
npm install - (Optional) Create a
.env.localfile to override the default backend URL if running locally:# frontend/.env.local VITE_API_URL=http://localhost:8080 - Start the development server:
npm run dev(Frontend available at http://localhost:3000 or similar)
- Navigate to the backend directory:
cd backend - Ensure the
backend/.envfile is created with your API keys (see above). - Build and run the application using Maven Wrapper:
(Backend API available at http://localhost:8080)
./mvnw spring-boot:run
To use the application with full functionality, obtain API keys from the following services and add them to the backend/.env file:
- Finnhub: (https://finnhub.io/) - Free tier available.
- SerpAPI: (https://serpapi.com/) - Free trial or paid plans.
- Polygon.io: (https://polygon.io/) - Free tier available for personal use.
- Groq: (https://console.groq.com/) - Create an account and generate an API key.
- RapidAPI: (https://rapidapi.com/) - Sign up and subscribe to a Yahoo Finance API (e.g.,
yahoo-finance166). Free tiers often available.
The application is deployed on a Hetzner VPS (Virtual Private Server) with a production-grade setup.
The frontend is served by Nginx as static files, with proper MIME types configured for modern JavaScript modules and CSS files.
The backend runs as a systemd service for reliability and automatic recovery:
# View backend service status
systemctl status borsvy.serviceThe deployment includes:
- HTTPS with Let's Encrypt SSL certificates
- Cloudflare integration for security and performance
- Automatic service recovery via systemd
- Log rotation to manage disk usage
- HTTP to HTTPS redirection
The repo includes a GitHub Actions workflow at .github/workflows/deploy-hetzner.yml.
On every push to main, the workflow:
- Installs frontend dependencies.
- Builds the frontend.
- Runs Playwright e2e tests.
- Compiles the backend.
- SSHs into the Hetzner VPS.
- Pulls the latest
mainbranch. - Builds the backend jar.
- Restarts the backend systemd service.
- Builds the frontend and syncs
frontend/distto the Nginx web root. - Validates and reloads Nginx.
Required GitHub repository secrets:
HETZNER_HOST # VPS hostname or IP
HETZNER_USER # SSH user
HETZNER_SSH_KEY # Private SSH key with access to the VPS
HETZNER_SSH_PORT # Optional; defaults to 22
Optional GitHub repository variables:
HETZNER_APP_DIR # Defaults to /var/www/borsvy
HETZNER_FRONTEND_DIR # Defaults to /var/www/borsvy-frontend
HETZNER_BACKEND_SERVICE # Defaults to borsvy.service
HETZNER_BRANCH # Defaults to main
The VPS should already have Node.js 18, Java 17, Maven wrapper support, Git, rsync, Nginx, and the backend systemd service configured. Production secrets such as database credentials and API keys should stay on the VPS in the systemd environment or environment file, not in GitHub Actions.
- Frontend Service:
VITE_API_URL: Public URL of your deployed backend service.
- Backend Service:
PORT: Provided by the platform (e.g., Railway sets this automatically).FINNHUB_API_KEY: Your Finnhub API key.SERPAPI_API_KEY: Your SerpAPI key.POLYGON_API_KEY: Your Polygon.io API key.GROQ_API_KEY: Your Groq API key.RAPIDAPI_API_KEY: Your RapidAPI key for the Yahoo Finance API.
#StockAnalysis #React #SpringBoot #AI #SentimentAnalysis #TechnicalIndicators #FinancialAPIs #DataVisualization #DarkMode #ResponsiveDesign
The application is live and accessible at: (https://borsvy.abenezeranglo.uk/)
MIT License



