A full-stack financial product management system built with Spring Boot, Vue.js, and PostgreSQL.
This system implements CRUD operations for managing a user's liked list of financial products with the following user specifications:
-
新增喜好金融商品
- 使用者可以透過介面進行新增所喜好的金融商品資訊(產品名稱、產品價格、手續費率)、預計要扣款的帳號、購買數量。
-
查詢喜好金融商品清單
- 使用者可以透過介面進行查詢所喜好的金融商品名稱清單以及預計要扣款的帳號、預計扣款總金額、總手續費用、扣款帳號、使用者聯絡電子信箱。
-
更改喜好金融商品資訊
- 使用者可以透過介面進行更改所喜好的金融商品資訊(產品名稱、產品價格、手續費率)、預計要扣款的帳號、購買數量。
-
刪除喜好金融商品資訊
- 使用者可以透過介面進行刪除所喜好的金融商品資訊(產品名稱、產品價格、手續費率)。
- Frontend: Vue.js with Vite
- Backend: Spring Boot with RESTful API
- Database: PostgreSQL with Stored Procedures
- Build Tool: Maven
- Containerization: Docker Compose
Prerequisites: Docker & Docker Compose
# Clone and start everything
git clone https://github.com/cl3880/finprodpref.git
cd finprodpref
docker compose up --buildAccess the application:
- Frontend: http://localhost:4173
- Backend API: http://localhost:8080/api
- Database: localhost:5432
Prerequisites: Java 17+, Node.js 18+, PostgreSQL
# 1. Start PostgreSQL database
docker compose up postgres -d
# 2. Start backend (separate terminal)
cd backend
mvn spring-boot:run
# 3. Start frontend (separate terminal)
cd frontend
npm install
npm run devAccess the application:
- Frontend: http://localhost:5173
- Backend API: http://localhost:8080/api
- Database: localhost:5432
-
Install Postman
-
Import
postman/FinProdPref.postman_collection.jsonfile -
The collection uses
{{baseUrl}}variable set tohttp://localhost:8080(works for both Docker and manual setup) -
Test any endpoint by expanding the collection and clicking Send
GET /api/products- Get all available productsGET /api/users/{userId}/accounts- Get user accountsGET /api/liked-products/{userId}- Get user's liked productsPOST /api/liked-products- Add liked productPUT /api/liked-products- Update liked productDELETE /api/liked-products/{userId}/{productNo}/{account}- Delete liked product
The database automatically initializes with sample data:
- Users: Sample users with multiple accounts
- Products: NTD-denominated financial products
- User Accounts: Multiple accounts per user support
All data access is performed through stored procedures as required.
User specification 2 and 4 implies a user can have multiple accounts, and liked product can be modified to user's other account.
JDBC Template was chosen over JPA/Hibernate due to "透過 Stored Procedure 存取資料庫" requirement and managing schema through DDL and DML scripts. Avoided JPA/Hibernate due to potential complexity and mapping issues.
The project requirement specifies that the "Total Fee" should be priced in NTD ("台幣計價").
To deliver a functional application within the project's scope and time limit, all product prices stored in the database are assumed to be in New Taiwan Dollars (NTD).
To accommodate global products a multi-currency conversion system would have to be implemented in the future.
- Parameterized queries prevent SQL injection
- CORS configuration for frontend integration
- Input validation with Bean Validation
- Global exception handling with proper HTTP status codes
- XSS prevention through output escaping and Vue's default data binding
See API Documentation for detailed endpoints, request/response examples, and usage.
- BigDecimal vs. double in financial calculations
- Spring Data JPA Stored Procedures (Baeldung)
- Spring Guide: Relational Data Access
- Spring JDBC Reference - Simple JDBC
- PostgreSQL: CREATE PROCEDURE Documentation
- iThome 教學:Spring Boot 實作 Stored Procedure
- JDBCTemplate 使用範例 (Medium)
- MDN: Vue.js - Getting Started
- Vue 2 Example Projects