How kiranz/just-api works
Main Components
a. Core Engine Components:
• Test Suite Parser
• Request Builder
• Response Validator
• Test Runner
• Reporter System
b. External Interfaces:
• REST API Endpoints
• GraphQL API Endpoints
• File System (YAML Specs)
┌─────────────────────────────────────────────────────────────┐
• CLI Interface Layer │
• ┘
• ↓
┌─────────────────────────────────────────────────────────────┐
• Core Engine Layer │
• ┬───────────────┬────────────────┬───────────┤
• YAML Parser │ Test Runner │ Request Builder│ Validator │
• ┴───────────────┴────────────────┴───────────┘
• ↓
┌─────────────────────────────────────────────────────────────┐
• Extension Layer │
• ┬───────────────┬────────────────┬───────────┤
• Custom JS │ Hooks System │ Suite Config │ Reporters │
• ┴───────────────┴────────────────┴───────────┘
• ↓
┌─────────────────────────────────────────────────────────────┐
• External Interface Layer │
• ┬───────────────┬────────────────┬───────────┤
• REST APIs │ GraphQL APIs │ File System │ Console │
• ┴───────────────┴────────────────┴───────────┘
Component Relationships
• CLI → YAML Parser (test suite input)
• YAML Parser → Test Runner (parsed specifications)
• Test Runner → Request Builder (test execution)
• Request Builder → External APIs (HTTP requests)
• External APIs → Validator (responses)
• Validator → Reporters (results)
Implementation Details
Directories and their roles:
lib/
• schema/ # YAML validation schemas
• reporters/ # Output formatting
• core/ # Main engine components
test/
• cli/ # Test specifications
Additional Elements
Callouts for:
• Configuration options
• Support for various HTTP methods
• File upload capabilities
• JSON schema validation
• Retry mechanisms
• Test context sharing
The flexible reporting system
This system design should capture both the high-level architecture and the important implementation details while maintaining clarity and readability.