Overseas Stock Trading System Deployment Guide: Vue Multi-Language Frontend with Springboot Backend Source Code Setup

Recently I deployed a multi-language stock trading system for a team targeting the Southeast Asian market. The requirements included mobile frontend support, separated admin backend and agent backend. The server side was built with Java Springboot. The entire system is fully open source with source code included. The frontend was written in Vue. The deployment cycle took about four days. I had to configure the Springboot environment twice before it ran properly. This article breaks down the complete functional analysis, setup steps and practical issues I encountered. Anyone planning to build an overseas stock platform should find this useful.

1. System Feature Overview

This system is positioned as an operations-grade overseas stock trading platform with separated frontend and backend. The modules are clearly structured:

  1. Frontend User Interface (Vue + H5): Supports K-line chart real-time quotes, watchlist management, buy/sell orders, position queries and fund flow. Quote data connects to third-party APIs with latency controlled within 500ms.
  2. Admin Backend Management: User management, order review, fund transfers, risk control rule configuration, announcement publishing and data statistics reports.
  3. Agent Backend: Independent login portal. Agents can view direct subordinate account openings, trading volumes and commission details. Supports three-level agent architecture.
  4. Quote Push Service: Based on WebSocket implementation. Springboot integrates Netty for long connection management supporting 1000+ simultaneous online users.
  5. Trading Matching Engine: Supports limit orders, market orders and stop-loss orders. Matching logic uses Redis cache for the order book.
  6. Multi-Language Support: Frontend Vue uses i18n plugin. Currently includes Thai, English and Chinese. The backend supports one-click language switching.

Stock Trading Frontend Interface

2. Deployment Preparation and Key Notes

This system has higher server requirements than PHP projects. Especially the quote push and matching engine consume significant resources:

  • Server: Recommend CentOS 7.8 or Ubuntu 20.04. Minimum 4-core 8GB. Production environment should start with 8-core 16GB.
  • Java Environment: JDK 1.8 or OpenJDK 11. Must configure JAVA_HOME environment variable.
  • Maven: 3.6+ for dependency management and project building.
  • Database: MySQL 5.7+ or MariaDB 10.4+. Enable binlog for data synchronization.
  • Redis: 5.0+ for caching quote data, user sessions and order books.
  • RabbitMQ or Kafka: For asynchronous processing of trading flows and logs. Optional but recommended.
  • Web Server: Nginx for reverse proxy and static resource distribution. Mount the Vue packaged dist directory directly to Nginx.
  • SSL Certificate: HTTPS is mandatory. Stock trading involves funds. Certificates should use EV level.

Backend User Management Interface

3. Common Issues and Troubleshooting Records

3.1 Springboot Startup Error: Cannot Find Main Class

The first time I packaged with Maven and ran the jar, it reported “cannot find or load main class”. Investigation found the spring-boot-maven-plugin in pom.xml was not configured correctly and lacked mainClass specification. Fix: Add this to the plugin configuration in pom.xml: <build><plugins><plugin><groupId>org.springframework.boot</groupId><artifactId>spring-boot-maven-plugin</artifactId><configuration><mainClass>com.stock.Application</mainClass></configuration></plugin></plugins></build>, then rerun mvn clean package.

3.2 WebSocket Connections Frequently Disconnecting

Quote pushing worked initially but disconnected automatically after 30 seconds. Log review found Nginx’s proxy_read_timeout defaults to 60 seconds while Springboot’s WebSocket heartbeat interval is 45 seconds. There was a gap in between. Fix: Add proxy_read_timeout 300s; and proxy_send_timeout 300s; in the Nginx configuration. Also change Springboot’s heartbeat interval to 30 seconds.

3.3 Vue Routing Refresh Shows 404 After Packaging

Vue-Router uses history mode. After packaging and deploying to Nginx, direct page refresh or URL input returns 404. This is a classic issue with history mode. Fix: Add try_files $uri $uri/ /index.html; in the Nginx location block. Route all paths to index.html and let the Vue frontend handle routing.

3.4 Quote Data Has High Latency

During testing, users reported slow quote refresh sometimes exceeding 2 seconds. Investigation found MySQL was directly handling queries without Redis caching. Fix: Enable the quote cache switch in application.yml with spring.cache.type=redis. Set hot stock data to 30-second TTL and inactive stocks to 5-minute TTL. After adjustment, latency dropped below 200ms.

Quote K-Line Chart Interface

4. Customization Options

As a fully open-source Java project, the customization space is substantial. Deep adjustments can be made according to target market requirements:

  1. Quote Data Source Replacement: Default uses free quote APIs with limited data accuracy and speed. Can be replaced with Bloomberg, Refinitiv or local exchange direct APIs. Modify api.endpoint in application.yml.
  2. Trading Product Extension: Currently supports stocks. Can extend to futures, options, forex and cryptocurrency. New products require creating corresponding data models in the entity directory and registering in the matching engine.
  3. Multi-Language Enhancement: Frontend Vue only needs adding language files under src/i18n directory. Backend error codes also need synchronous translation. I recommend using Crowdin for collaborative translation.
  4. Enhanced Risk Control Rules: Base version has position caps and daily loss limits. Can integrate AI risk control models for abnormal trading detection. Springboot integration with Drools rule engine is a good fit.
  5. Mobile APP: Vue frontend can be packaged into an APP using Cordova or Capacitor. Quote push uses Firebase Cloud Messaging for offline notifications.

Backend Agent Commission Management

Key Note: The biggest risk in building an overseas stock platform is not technical—it is compliance. Countries like Thailand, Malaysia, Indonesia and the Philippines all have licensing requirements for financial platforms. No matter how stable the technology, operations without proper licenses will get shut down. Always confirm the requirements of the target country’s Securities and Exchange Commission (SEC) or financial regulatory authority before launch. Do not directly transplant domestic operational thinking.

5. FAQ

Q1: Can this system directly connect to real exchanges?

A: The source code reserves both FIX protocol and REST API connection methods. But real exchange access requires applying for membership qualifications and API permissions. The current demo uses simulated quotes. Real data sources must be replaced before formal operations. FIX protocol integration requires modifying adapters under com.stock.exchange.fix package.

Q2: What to do if Springboot service uses too much memory after startup?

A: Default JVM memory parameters are -Xms512m -Xmx2048m, insufficient for high concurrency scenarios. Recommend changing to -Xms2048m -Xmx4096m and adding -XX:+UseG1GC -XX:MaxGCPauseMillis=200 in the startup script. If the server only has 4GB RAM, upgrade to 8GB before running production.

Q3: How are permissions isolated between agent backend and admin backend?

A: The system uses Spring Security for permission control. Agent backend login is at /agent/login, admin backend at /admin/login. Two interfaces correspond to different JWT keys and permission tables. Agents can only view direct subordinates and cannot see cross-level data. To adjust permission granularity, modify RolePermission configuration under com.stock.security package.

Q4: How many concurrent connections can quote push support?

A: In test environment with 4-core 8GB configuration, a single machine supports 3000 simultaneous online users viewing quotes. Production environment with 8-core 16GB + Redis cluster can reach 15000 users. For larger user volumes, deploy quote services independently and use Nginx load balancing to distribute WebSocket connections across multiple servers.

Backend Data Statistics Center


Source Reference

This article is compiled from yanshigw.top/19100.html with secondary creation and expansion. It is provided for technical exchange purposes only.

#OverseasStockSystem #ThailandStockTrading #MultiLanguageStockSourceCode #SpringbootStockSystem #StockTradingPlatform