How liaoran2002/ficq works
Project type and purpose
• This is a full-stack, multi-platform instant-messaging system (“FICQ”) that mimics QQ.
• It comprises three main modules:
• FICQ (backend): Java Spring Boot/Netty server handling REST APIs, WebSocket/TCP messaging, WebRTC signaling, persistence via MyBatis-Plus, file storage, and admin functions.
• FICQ-web: Vue.js SPA (with Vuex store, Vue Router) as the web client for chat, user/group management, and admin console.
• FICQ-uniapp: Uni-app hybrid/mobile client supporting iOS/Android/H5 with Vue-style components, uni-modules, and WSSocket/HTTP wrappers.
File structure
• Top-level directories:
• FICQ-uniapp: mobile client source (App.vue, pages/, components/, common/, store/, uni_modules/)
• FICQ-web: web client source (src/api/, src/components/, src/view/, src/store/, src/router/)
• FICQ: backend service (src/main/java with layered packages controller/, service/, mapper/, netty/, config/)
• Config and build: pom.xml for Java, package.json/vite.config.js for clients, uniapp manifest.json, env files.
• Notice WebSocketConfig.java and Netty packages for both WebSocket and TCP protocols.
• README outlines core features: text, file transfer, user/group management, WebRTC audio/video.
Main components and their relationships
a. Clients
• Mobile client (Uni-app) & Web client (Vue.js)
• Layers: UI layer (pages/components) → API wrapper (common/request.js or src/api/httpRequest.js) → HTTP & WSSocket & WebRTC calls
b. Gateway/API layer
• Spring MVC REST controllers (LoginController, Chat controllers, FileController, AdminController)
• WebSocket endpoints (WebSocketServer) and TCP endpoints (TcpSocketServer)
• WebRTC signaling via REST or WebSocket (rtcGroupApi.js, rtcPrivateApi.js)
c. Business layer
• Service interfaces & impl (UserService, MessageService, WebrtcPrivateService)
• Message listeners & multicaster (Observer pattern)
d. Data layer
• MyBatis-Plus mappers & entity models mapping to relational database.
• application.yml defines JDBC, JWT, scheduler, static resources.
e. External services
• FileService for upload/storage
• Third-party authentication or analysis if any
Architectural patterns and design principles
• Layered architecture (Controller → Service → Mapper → DB)
• Event-driven messaging (MessageListener, multicaster)
• Observer for WebSocket/TCP message processors (ProcessorFactory, AbstractMessageProcessor)
• MVVM in front-ends (Vue + Vuex stores)
• REST + WebSocket hybrid integration
• Single monolith backend (not microservices), but modular for controllers, netty, services