|
| 1 | +### Initial Idea Submission |
| 2 | + |
| 3 | +**Full Name:** April Lin |
| 4 | +**University Name:** University of Illinois Urbana-Champaign |
| 5 | +**Program (Degree & Major/Minor):** Master in Electrical and Computer Engineering |
| 6 | +**Year:** first year |
| 7 | +**Expected Graduation Date:** 2026 |
| 8 | + |
| 9 | +**Project Title:** API Explorer |
| 10 | +**Relevant Issues:** [https://github.com/foss42/apidash/issues/619](https://github.com/foss42/apidash/issues/619) |
| 11 | + |
| 12 | +**Idea Description:** |
| 13 | + |
| 14 | +I have divided the design of the API explorer into three major steps: |
| 15 | + |
| 16 | +1. **Designing the UI** |
| 17 | +2. **Designing the API template model** |
| 18 | +3. **Using AI tools to automatically extract API information from a given website** |
| 19 | + |
| 20 | +--- |
| 21 | + |
| 22 | +## 1. UI Design (User Journey) |
| 23 | + |
| 24 | +In this step, I primarily designed two interfaces for the API explorer: the first is the main API Explorer interface, and the second is a detailed interface for each API template. |
| 25 | + |
| 26 | +### API Explorer |
| 27 | + |
| 28 | +1. **Accessing the API Explorer** |
| 29 | + - In the left-hand sidebar, users will find an “API Explorer” icon. |
| 30 | + - Clicking this icon reveals the main API template search interface on the right side of the screen. |
| 31 | + |
| 32 | +2. **Browsing API Templates** |
| 33 | + - At the top of the main area, there is a search bar that supports fuzzy matching by API name. |
| 34 | + - Directly beneath the search bar are category filters (e.g., AI, Finance, Web3, Social Media). |
| 35 | + - Users can click “More” to view an expanded list of all available categories. |
| 36 | + - The page displays each template in a **card layout**, showing the API’s name, a short description, and (optionally) an image or icon. |
| 37 | + |
| 38 | +### API Templates |
| 39 | + |
| 40 | +1. **Selecting a Template** |
| 41 | + - When a user clicks on a card (for example, **OpenAI**), they navigate to a dedicated page for that API template. |
| 42 | + - This page lists all the available API endpoints or methods in a collapsible/expandable format (e.g., “API name 2,” “API name 3,” etc.). |
| 43 | + - Each listed endpoint describes what it does—users can select which methods they want to explore or import into their workspace. |
| 44 | + |
| 45 | +2. **Exploring an API Method** |
| 46 | + - Within this detailed view, users see request details such as **HTTP method**, **path**, **headers**, **body**, and **sample response**. |
| 47 | + - If the user wants to try out an endpoint, they can import it into their API collections by clicking **import**. |
| 48 | + - Each method will include all the fields parsed through the automated process. For the detailed API field design, please refer to **Step Two**. |
| 49 | + |
| 50 | +--- |
| 51 | + |
| 52 | +## 2. Updated Table Design |
| 53 | + |
| 54 | +Below is the model design for the API explorer. |
| 55 | + |
| 56 | +### **Base Table: `api_templates`** |
| 57 | +- **Purpose:** |
| 58 | + Stores the common properties for all API templates, regardless of their type. |
| 59 | + |
| 60 | +- **Key Fields:** |
| 61 | + - **id**: |
| 62 | + - Primary key (integer or UUID) for unique identification. |
| 63 | + - **name**: |
| 64 | + - The API name (e.g., “OpenAI”). |
| 65 | + - **api_type**: |
| 66 | + - Enumerated string indicating the API type (e.g., `restful`, `graphql`, `soap`, `grpc`, `sse`, `websocket`). |
| 67 | + - **base_url**: |
| 68 | + - The base URL or service address (applicable for HTTP-based APIs and used as host:port for gRPC). |
| 69 | + - **image**: |
| 70 | + - A text or string field that references an image (URL or path) representing the API’s logo or icon. |
| 71 | + - **category**: |
| 72 | + - A field (array or string) used for search and classification (e.g., "finance", "ai", "devtool"). |
| 73 | + - **description**: |
| 74 | + - Textual description of the API’s purpose and functionality. |
| 75 | + |
| 76 | +### **RESTful & GraphQL Methods Table: `api_methods`** |
| 77 | +- **Purpose:** |
| 78 | + Manages detailed configurations for individual API requests/methods, specifically tailored for RESTful and GraphQL APIs. |
| 79 | + |
| 80 | +- **Key Fields:** |
| 81 | + - **id**: |
| 82 | + - Primary key (UUID). |
| 83 | + - **template_id**: |
| 84 | + - Foreign key linking back to `api_templates`. |
| 85 | + - **method_type**: |
| 86 | + - The HTTP method (e.g., `GET`, `POST`, `PUT`, `DELETE`) or the operation type (`query`, `mutation` for GraphQL). |
| 87 | + - **method_name**: |
| 88 | + - A human-readable name for the method (e.g., “Get User List,” “Create Order”). |
| 89 | + - **url_path**: |
| 90 | + - The relative path appended to the `base_url` (for RESTful APIs). |
| 91 | + - **description**: |
| 92 | + - Detailed explanation of the method’s functionality. |
| 93 | + - **headers**: |
| 94 | + - A JSON field storing default header configurations (e.g., `Content-Type`, `Authorization`). |
| 95 | + - **authentication**: |
| 96 | + - A JSON field for storing default authentication details (e.g., Bearer Token, Basic Auth). |
| 97 | + - **query_params**: |
| 98 | + - A JSON field for any default query parameters (optional, typically for RESTful requests). |
| 99 | + - **body**: |
| 100 | + - A JSON field containing the default request payload, including required fields and default values. |
| 101 | + - **sample_response**: |
| 102 | + - A JSON field providing an example of the expected response for testing/validation. |
| 103 | + |
| 104 | +--- |
| 105 | + |
| 106 | +## 3. Automated Extraction (Parser Design) |
| 107 | + |
| 108 | +I think there are two ways to design the automated pipeline: the first is to use AI tools for automated parsing, and the second is to employ a rule-based approach. |
| 109 | + |
| 110 | +### **AI-Based Parser** |
| 111 | +- For each parser type (OpenAPI, HTML, Markdown), design a dedicated prompt agent to parse the API methods. |
| 112 | +- The prompt includes model fields (matching the data structures from [Step Two](#2-updated-table-design)) and the required API category, along with the API URL to be parsed. |
| 113 | +- The AI model is instructed to output the parsed result in **JSON format**, aligned with the schema defined in `api_templates` and `api_methods`. |
| 114 | + |
| 115 | +### **Non-AI (Rule-Based) Parser** |
| 116 | +- **OpenAPI**: Use existing libraries (e.g., Swagger/OpenAPI parser libraries) to read and interpret JSON or YAML specs. |
| 117 | +- **HTML**: Perform DOM-based parsing or use regex patterns to identify endpoints, parameter names, and descriptions. |
| 118 | +- **Markdown**: Utilize Markdown parsers (e.g., remark, markdown-it) to convert the text into a syntax tree and extract relevant sections. |
0 commit comments