A comprehensive fintech platform for personal wealth management with AI-powered investment recommendations and real-time market data integration.
Wealthio is a full-stack application designed to help individuals assess their investment risk profile and manage their wealth. The platform integrates three core services:
- User Authentication & Profiles: Secure registration, login, and JWT-based authentication
- Financial Onboarding: Collect user financial information (income, savings, investment goals)
- AI-Powered Risk Profiling: K-Means clustering model to classify investors into risk categories (Conservative, Moderate, Aggressive)
- Portfolio Management: Track and manage investment allocations
- Real-Time Market Data:
- Stock prices and historical data (via yfinance)
- Cryptocurrency prices (via CoinGecko)
- Gold & Silver rates
- Company fundamentals (via Alpha Vantage)
- Dashboard: Personalized investment dashboard with recommendations
- Risk Assessment Tools: Interactive questionnaire to determine optimal investment strategy
- React 19 with TypeScript support
- Vite (lightning-fast build tool)
- Tailwind CSS (utility-first styling)
- React Router (client-side routing)
- Axios (HTTP client with interceptors)
Key Routes:
/login- User authentication/register- New user registration/onboarding- First-time financial information collection/risk-assessment- Interactive risk profiling questionnaire/dashboard- Personalized investment dashboard
- Spring Boot 4.0.6 (Java 21)
- PostgreSQL (primary database)
- Spring Security with JWT tokens
- Spring Data JPA (Hibernate ORM)
- Maven (build & dependency management)
Key Endpoints:
POST /auth/register- User registrationPOST /auth/login- Authentication (returns JWT token)GET/POST /financial-profile- Manage user financial information- Integration with ML Service for risk profiling
- FastAPI (Python 3.10+, high-performance async API)
- scikit-learn (K-Means clustering for risk profiling)
- yfinance (Real-time stock & ETF data)
- CoinGecko API (Cryptocurrency data)
- Alpha Vantage API (Company fundamentals)
Key Endpoints:
POST /risk-profile- ML-based risk profile predictionPOST /risk-selection- Save user's risk choiceGET /api/market/stock/{ticker}- Stock pricesGET /api/market/crypto/{coin}- Crypto pricesGET /api/market/gold-silver- Precious metals rates
Wealthio (Monorepo)
├── frontend/ # React + Vite SPA
│ ├── src/
│ │ ├── pages/ # Routes: Login, Register, Dashboard, RiskAssessment
│ │ ├── components/ # Reusable components & auth guards
│ │ ├── context/ # Auth context & state management
│ │ └── api/ # HTTP clients (authApi, profileApi, riskApi)
│ └── package.json
│
├── backend/ # Spring Boot monolith (Java 21)
│ ├── src/main/java/com/wealthio/
│ │ ├── controllers/ # REST endpoints (Auth, FinancialProfile)
│ │ ├── entities/ # JPA entities (User, FinancialProfile, Portfolio)
│ │ ├── repositories/ # Spring Data JPA repos
│ │ ├── services/ # Business logic layer
│ │ ├── security/ # JWT & Spring Security config
│ │ ├── dto/ # Request/Response DTOs
│ │ └── exceptions/ # Custom exception handling
│ ├── src/main/resources/
│ │ └── application.yaml # Database & JWT configuration
│ ├── pom.xml
│ └── mvnw # Maven wrapper (JDK 21)
│
├── backend/ml-service/ # FastAPI (Python ML service)
│ ├── main.py # FastAPI app setup
│ ├── config.py # Configuration & environment variables
│ ├── routers/ # API route handlers (risk.py, market.py)
│ ├── models/ # ML model definitions (risk_profiler.py)
│ ├── schemas/ # Pydantic request/response schemas
│ ├── services/ # Business logic (clustering, market_data, etc.)
│ ├── training/ # ML model training scripts
│ ├── requirements.txt # Python dependencies
│ └── artifacts/ # JSON logs & trained models
│
└── pom.xml # Parent Maven POM (multi-module)
Before running the project locally, ensure you have:
- Java 21 JDK (download)
- Node.js 18+ with npm (download)
- Python 3.10+ with pip (download)
- PostgreSQL 12+ (download)
- Git (for cloning the repo)
- Optional API Keys:
- Alpha Vantage API key (for stock fundamentals) - free tier
git clone <REPO_URL> D:\PROJECTS\Wealthio
Set-Location D:\PROJECTS\WealthioCreate a PostgreSQL database and note your credentials:
-- Connect to PostgreSQL and run:
CREATE DATABASE wealthio_db;
CREATE USER wealthio_user WITH PASSWORD 'your_secure_password';
GRANT ALL PRIVILEGES ON DATABASE wealthio_db TO wealthio_user;Create .env file in backend/ directory:
DB_URL=jdbc:postgresql://localhost:5432/wealthio_db
DB_USERNAME=wealthio_user
DB_PASSWORD=your_secure_password
JWT_SECRET=your_jwt_secret_key_min_32_chars_recommended
JWT_EXPIRATION=86400000Build and run the backend:
# Navigate to backend directory
Set-Location D:\PROJECTS\Wealthio\backend
# Build with Maven
.\mvnw clean package
# Run the application
.\mvnw spring-boot:runThe backend will start on http://localhost:8080
Run tests (optional):
.\mvnw testCreate backend/ml-service/.env file:
PORT=8001
ALPHA_VANTAGE_API_KEY=your_alpha_vantage_key_optionalInstall and run the ML service:
# Navigate to ml-service directory
Set-Location D:\PROJECTS\Wealthio\backend\ml-service
# Create Python virtual environment
python -m venv venv
# Activate virtual environment
.\venv\Scripts\Activate.ps1
# Install dependencies
pip install -r requirements.txt
# Train the ML model (first time only, or when retraining)
python training/train_kmeans.py
# Start the FastAPI service
uvicorn main:app --reload --port 8001The ML Service will start on http://localhost:8001
API Documentation: Visit http://localhost:8001/docs in your browser for interactive Swagger UI
# Navigate to frontend directory
Set-Location D:\PROJECTS\Wealthio\frontend
# Install dependencies
npm install
# Start development server
npm run devThe frontend will be available at http://localhost:5173 (or http://localhost:5174)
Build for production (optional):
npm run build
npm run previewFrom the project root, run the unified startup script:
cd D:\PROJECTS\Wealthio
.\start-all.ps1This launches all three services in separate, labeled terminal windows:
| Service | URL | Window Title |
|---|---|---|
| Spring Boot Backend | http://localhost:8080 |
Wealthio — Spring Boot (8080) |
| ML Service (FastAPI) | http://localhost:8001 |
Wealthio — ML Service (8001) |
| Frontend (Vite) | http://localhost:5173 |
Wealthio — Frontend (5173) |
Press Ctrl+C in the main window to stop all services at once.
If you prefer to manage each service individually:
-
Terminal 1 - Backend (Java)
cd D:\PROJECTS\Wealthio\backend .\mvnw spring-boot:runRuns on:
http://localhost:8080 -
Terminal 2 - ML Service (Python)
cd D:\PROJECTS\Wealthio\backend\ml-service .\venv\Scripts\Activate.ps1 uvicorn main:app --reload --port 8001
Runs on:
http://localhost:8001 -
Terminal 3 - Frontend (React)
cd D:\PROJECTS\Wealthio\frontend npm run dev
Runs on:
http://localhost:5173
Once all three services are running, visit http://localhost:5173 in your browser and register a new account to begin!
Frontend (React)
↓
├─→ Backend (Java) @ localhost:8080
│ ├─ Authentication (Login/Register)
│ ├─ User profiles
│ └─ Portfolio management
│
└─→ ML Service (FastAPI) @ localhost:8001
├─ Risk profiling (K-Means)
├─ Market data (stocks, crypto)
└─ Historical price analysis
- Error: Java 21 not found
- Set
JAVA_HOMEenvironment variable to your JDK 21 installation - Verify:
java -version
- Set
- Connection refused on port 5432
- Ensure PostgreSQL is running:
pg_isready - Check credentials in
.envmatch your setup
- Ensure PostgreSQL is running:
pip installfails after activating venv- Deactivate and reactivate:
deactivatethen.\venv\Scripts\Activate.ps1 - Try upgrading pip:
python -m pip install --upgrade pip
- Deactivate and reactivate:
- "Run
python training/train_kmeans.pyto train the model"- The K-Means model hasn't been trained yet
- Run:
python D:\PROJECTS\Wealthio\backend\ml-service\training\train_kmeans.py
- The ML Service is configured with CORS middleware to accept requests from:
http://localhost:8080(backend)http://localhost:3000,http://localhost:5173,http://localhost:5174(frontend variations)
- Change the port in respective configs:
- Backend: Modify
application.yamlor use--server.port=8081 - ML Service: Modify
.env PORTor use--port 8002 - Frontend: Vite auto-detects available ports
- Backend: Modify
Key Backend Dependencies:
- Spring Boot Starter Web, Security, Data JPA, Validation
- JWT (JJWT 0.11.5)
- PostgreSQL driver
- Lombok (annotations)
Key ML Service Dependencies:
- FastAPI, Uvicorn
- scikit-learn, pandas, numpy, joblib
- yfinance, requests, httpx
- pydantic-settings
Key Frontend Dependencies:
- React 19, React Router 7, Axios
- Tailwind CSS 4.3
- ESLint, Babel, TypeScript
Backend (.env in backend/):
DB_URL=jdbc:postgresql://localhost:5432/wealthio_db
DB_USERNAME=wealthio_user
DB_PASSWORD=secure_password
JWT_SECRET=long_random_secret_min_32_chars
JWT_EXPIRATION=86400000 # 24 hours in millisecondsML Service (.env in backend/ml-service/):
PORT=8001
ALPHA_VANTAGE_API_KEY=your_api_key_here # OptionalThe project respects these entries (do not commit):
ml-service/.envandbackend/.envml-service/venv/and Python cachefrontend/node_modules/backend/target/and Maven cache- Large model files & data artifacts
- ✅ Set up all three services locally
- 📝 Create a test user account via the frontend
- 🎯 Take the risk assessment questionnaire
- 📊 View personalized recommendations on the dashboard
- 📈 Explore market data integration for stocks and crypto
When adding features:
- Keep TypeScript strict mode enabled (
tsconfig.json) - Run tests before committing (
.\mvnw test) - Lint frontend code:
npm run lint - Document new API endpoints in docstrings
For issues or questions about setup, check:
- Spring Boot Documentation
- React Documentation
- FastAPI Documentation
- PostgreSQL logs:
SHOW data_directory;then check thelog/folder