How dicodingacademy/platform-sync works
Project type and purpose
• This is an open‑source developer tool (“Platform Sync”) providing two IDE clients (IntelliJ/Android Studio plugin and VS Code extension) that synchronize file and cursor positions with the external Dicoding Review Platform over WebSockets.
• There is no server component in this repo—the remote review platform is external. This is a multi‑module tool project, not a web app or microservices environment.
File structure
• Top‑level:
• .github/workflows: CI/CD (build, review)
• intellij-plugin: Kotlin/Gradle code for the IntelliJ‑based IDE plugin
• vscode-extension: TypeScript code for the VS Code extension
• package.json / package-lock.json: npm orchestration scripts to build both
• IntelliJ plugin sub‑structure follows the typical plugin modularization:
• action: user‑invoked commands (e.g., input WebSocket URL)
• service: business logic (WebSocketService, ReviewerIdentifierService)
• widget: UI status bar components
• listener: file/cursor change detectors
• VS Code extension sub‑structure:
• extension.ts: activation/deactivation hooks and command registrations
• websocket.ts: WebSocket client implementation
• types.ts: shared TypeScript interfaces
• Build & deployment artifacts and scripts: Gradle wrappers, npm scripts, CI YAML files.
README for additional insights
• Clarifies compatibility, prerequisites (JDK 17+, Node.js 18+), build commands and workflows.
• Emphasizes dual build targets (IntelliJ plugin and VS Code extension), and GitHub Actions that package and release both.
a. Main components
• IntelliJ‑based plugin
• VS Code extension
• GitHub Actions CI/CD pipeline
• External Dicoding Review Platform (WebSocket & HTTP API)
• Local developer environments (IDE hosts)
b. Relationships & interactions
• Both clients connect outbound via WebSocket to the Review Platform.
• Plugins detect local events (file open/change, cursor move) → serialize and send over WebSocket.
• Incoming WebSocket messages from platform → service layer → UI update (status bar, cursor jumps).
• CI workflows trigger on push/tag → build both packages → publish release & VSIX.
c. Architectural patterns & design principles
• Event‑driven plugin architecture: listener → service → UI widget.
• Adapter pattern for WebSocket communication encapsulated in service classes.
• Single Responsibility: actions, services, widgets separated by folder.
• Standard VS Code extension and IntelliJ plugin SDK conventions.
d. Key technologies & frameworks
• Kotlin + IntelliJ Platform SDK + Gradle
• TypeScript + VS Code Extension API + WebSocket
• npm scripts to orchestrate parallel builds
• GitHub Actions for CI/CD
Final advice
• Event flows end‑to‑end, including build/release pipeline.
• Keep labels concise but precise (e.g., “FilesDetectionsListener”, “WebSocketService”, “extension.ts”).
• This clarity will ensure maintainers and new contributors instantly grasp the system’s structure and behavior.