How panaroma-finance-internal/coinexchange_cryptoexchange_java works
Project type and purpose
• This is a full-stack, microservice-based cryptocurrency exchange platform (Java Spring Cloud).
• It supports trading (matching engine), market data/K-line service, user center, OTC, wallet RPC, chat, admin backend, two Vue frontends, and native mobile apps.
File structure
• 00_framework: the core microservices:
• cloud – Eureka service registry
• admin – Admin API
• exchange – In-memory matching engine
• market – Market data, K-line generation, depth & push
• ucenter-api – User authentication, profile, real-name, assets
• wallet – Kafka-driven wallet transaction service
• otc-api / otc-core – Fiat OTC trading
• chat – WebSocket/Netty-based messaging
• exchange-api / exchange-core – Order API and core modules
• bitrade-job – Scheduled jobs (daily stats, cleanup)
• core – Shared libraries, DAO, service, common utilities
• 01_wallet_rpc: separate microservices per blockchain (BTC, ETH, USDT, etc.) exposing JSON-RPC endpoints, each with own Kafka, Mongo, configuration.
• 02_App_Android & 03_App_IOS: native mobile apps (closed source).
• 04_Web_Admin & 05_Web_Front: Vue.js based admin and trading UIs.
Extract insights from README
• Uses Spring Cloud components: Eureka (discovery), RestTemplate for inter-service calls, Kafka for event bus, MongoDB/MySQL for persistence, Redis for caching.
• Architectural patterns: microservices, event-driven (Kafka), layered MVC (controller-service-dao), shared libraries (core).
• Deployment: each service packaged as a standalone JAR, deployed behind Nginx/load balancer.
Relationships & data flows
• Clients → Nginx/API Gateway → appropriate microservice (REST).
• Exchange publishes trade matches to a Kafka “trade” topic.
• Market & Wallet services subscribe to Kafka topics:
• Market: consume, persist market data, push via WebSocket.
• Wallet: consume, update balances in MySQL.
• User actions (login/register) → Ucenter-API writes to MySQL & Redis.
• Admin UI → Admin service → core services for management.
• Chat clients → Chat WebSocket → Chat service writes/reads from Mongo.
• RPC services monitor blockchains, produce deposit/withdraw events → Kafka → Wallet → Ucenter.
Architectural patterns & principles
• Microservices with Spring Cloud (each JAR self-contained).
• Service discovery (Eureka) and client-side load balancing.
• Event-driven architecture via Kafka for decoupling matching, persistence, wallet.
• Domain-driven layer separation: controllers, services, DAOs in each module.
• Shared core library for common DTOs, entities, utilities.
Essential elements
• Frontend clients on top, hitting Nginx or API Gateway.
• Eureka registry connecting to all services.
• Kafka cluster in the center with topics: trade, deposit, market, chat.
• Data stores attached to each service.
• Blockchain RPC modules on the side feeding Kafka.
• External integrations (OSS, SMS, Captcha) connected to Ucenter-API & Admin.