Daily Finance
Daily Finance is a comprehensive financial tracking platform utilizing an AWS LocalStack emulator for local development and AWS Free Tier for production. It aggregates live market data into a seamless React interface powered by a Java Spring Boot backend, eliminating operational costs while delivering enterprise-grade performance.
Architecture & Core Logic
The system flow is designed for real-time asset tracking with zero cloud footprint during development. A Python Data Engine fetches live financial metrics via yfinance, passing it to the Spring Boot REST API. The React UI continuously triggers state updates via Redux Toolkit to render real-time analytics using Recharts. Everything is seamlessly tied together via AWS cloud patterns mirrored locally by LocalStack.
1. The Data Engine (Python Lambda)
Acting as the primary data ingestor, this layer executes periodically to pull accurate market pricing. This decoupling ensures the Java backend doesn't handle blocking external HTTP calls directly.
- ●yfinance Integration: Fetches live stock/crypto data. When triggered locally, it runs as a standard script; in production, it's deployed as a serverless AWS Lambda function triggering via EventBridge.
2. Spring Boot Core API (Java 21)
The centralized logic hub. It serves as the bridge between the live data streams and the user's persisted portfolio, mapping SQL entities via JPA.
- ●Database Strategy: Utilizes an in-memory H2 Database locally (accessible at
/h2-console) for rapid iteration, swapping to AWS DynamoDB in production.@Entity @Table(name = "assets") public class Asset { @Id @GeneratedValue private Long id; private String symbol; @Enumerated(EnumType.STRING) private AssetType type; // STOCK, CRYPTO, CASH, ETF, BOND private Double quantity; private Double purchasePrice; }
3. React UI & State Management
The frontend utilizes React 18 with Redux Toolkit to manage the complex application state, enabling instantaneous UI reactivity. As data arrives through the Vite proxy (to avoid CORS issues), it triggers fetchPortfolioSummary. Recharts dynamically processes this to display interactive asset allocations and portfolio growth without reloading the page.
Tech Stack & Tools Used
Frontend & UI
- React 18 & Vite: Ultra-fast component rendering and hot-module replacement.
- Redux Toolkit: Centralized, predictable state management.
- Recharts: Composable charting libraries for financial data visualization.
Backend / Protocol Ecosystem
- Java 21 & Spring Boot 3.2.5: Highly concurrent REST API logic.
- Python 3.11 & yfinance: Scalable, real-time market data extraction.
- H2 Database: In-memory SQL engine for rapid local schema design.
Infrastructure & DevOps
- Docker & Docker Compose: Containerized local environments.
- AWS LocalStack: Complete offline emulation of S3, DynamoDB, and SQS.
- AWS CloudFormation: Infrastructure-as-code for zero-click production deployment.
Local Execution & Testing
Daily Finance relies on a multi-service architecture. To fully run the application offline, you need to sequence the infrastructure, the data ingestion engine, the backend API, and the frontend server. Here is the exact terminal flow to boot the entire stack:
# 1. Start LocalStack (AWS Emulator: S3, DynamoDB, SQS on port 4566)git clone https://github.com/neh2332/dailyfinance.git && cd dailyfinancedocker-compose up -d# 2. Boot Python Data Engine (Test Real-Time Fetcher)cd backend-pythonpip install -r requirements.txtpython lambda_handler.py# 3. Launch Spring Boot API (Runs on port 8080)cd ../backend-java./mvnw clean spring-boot:run# 4. Start React Frontend (Runs on port 5173)cd ../frontend-reactnpm install && npm run devNote: The Spring Boot application.properties is pre-configured to point all AWS endpoints (Region: us-east-1) to http://localhost:4566 using dummy credentials (`test`/`test`).