How ch-chang/rocket works
Project type and purpose
• This is a desktop GUI application (“Rocket 火箭”) written entirely in PowerShell (v5.1) on top of .NET, aimed at providing a lightweight RESTful API testing tool where installing heavier tools (Postman, Apifox) is not permitted.
• It exposes a set of GUI windows for composing HTTP requests, cryptographic helpers, and project import/export, and records requests and responses for later analysis.
File structure
• Top‐level entry scripts:
• Main.ps1 / Run.bat – bootstrap the application
• ScriptAnalyzerSettings.psd1 – linting/config
• Utils folder (core services):
• Data.psm1 – data models and in‐memory storage
• Requester.psm1 – HTTP request builder/executor using .NET classes
• Settings.psm1 – load/save user and project configurations
• Writer.psm1 – persistence (log to disk, export/import)
• Windows folder (presentation layer):
• MainWindow.psm1 – primary GUI for composing requests
• AddDialogWindow.psm1 – create new request entries
• SettingWindow.psm1 – application settings
• CryptoWindow.psm1 / HashWindow.psm1 – cryptographic helpers
• CI: .github/workflows/Release.yml
• Documentation: README.md, CHANGELOG, LICENSE
README for additional insights
• Confirms pure PowerShell/.NET stack
• GUI‐centric, no external services beyond standard HTTP endpoints
• Features: RESTful requests, logging, import/export
• No microservices or separate backend; monolithic modular script
a. Main components
1. Presentation Layer (GUI)
– PowerShell window modules (.psm1 under Windows/)
2. Core Services (Business Logic)
– Utils modules: Data, Requester, Settings, Writer
3. Persistence Layer
– Local file system for request/response logs and project files
4. External Services
– Any RESTful API endpoints the user is testing
5. Runtime Environment
– PowerShell v5.1 + .NET CLR
b. Relationships and interactions
• GUI windows invoke functions in Utils modules.
• Requester builds and sends HTTP requests → receives responses.
• Data module holds in‐session state (current request list, history).
• Writer module persists state and logs to disk; Settings module reads/writes config.
• External REST API is the ultimate target of HTTP calls.
• Runtime is the host platform (PowerShell/.NET).
c. Architectural patterns / design principles
– Module separation: “Windows/” modules for UI; “Utils/” modules for services.
– Single‐process monolith with clear logical layers.
– Dependency injection via PowerShell module imports.
– Event‐driven UI: user actions → module calls → UI updates.
d. Key technologies / frameworks
• PowerShell v5.1 scripting host
• .NET Windows Presentation Foundation (WPF) or WinForms under the hood
• Native .NET HttpClient (invoked from Requester.psm1)
Detailed steps for the principal software engineer
2. Inside it, create three tiers:
• Middle tier “Core Modules”: Data.psm1, Requester.psm1, Settings.psm1, Writer.psm1
• Bottom tier “Persistence”: file system (requests.log, projects.json)
• From Requester.psm1 out to “External REST API” cloud
4. With technologies:
– Next to Requester, note “.NET HttpClient”
– Next to UI, note “WPF/WinForms via PowerShell”