Skip to content

Commit cfcb6d7

Browse files
committed
docs: add logs tab images
1 parent 646c741 commit cfcb6d7

File tree

3 files changed

+20
-8
lines changed

3 files changed

+20
-8
lines changed

doc/gsoc/2025/images/terminal.png

279 KB
Loading
296 KB
Loading

doc/gsoc/2025/udhay_adithya_j.md

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# GSoC'25 — API Dash: Authentication, Scripting, OAuth, and Dashbot
1+
# GSoC'25 — API Dash: Dashbot and API Authentication
22

33
> Final report summarizing my contributions to API Dash as part of GSoC'25.
44
@@ -110,7 +110,7 @@ On the Dart side I wrote `executePreRequestScript` and `executePostResponseScrip
110110

111111
Here is a short example that shows how a pre‑request script can set a header and a query parameter from environment values.
112112

113-
```
113+
```dart
114114
// user script (runs after kJSSetupScript)
115115
const token = ad.environment.get('API_TOKEN');
116116
if (token) {
@@ -150,7 +150,7 @@ I implemented the three common grant types: Authorization Code, Client Credentia
150150

151151
Here is a short excerpt that shows how the Authorization Code grant adds the access token to the request after the flow completes. The handler appends `Authorization: Bearer <token>` to your request headers so you can send the request right away.
152152

153-
```
153+
```dart
154154
// packages/better_networking/lib/utils/auth/handle_auth.dart
155155
case APIAuthType.oauth2: {
156156
// ... run the selected grant flow and get the client
@@ -254,7 +254,7 @@ While building scripting and Dashbot, I realized users need a clear place to see
254254

255255
On the JavaScript side, the `ad.console` helper in the setup script forwards logs back to Dart using a small bridge. The calls below are part of `kJSSetupScript` in `lib/utils/js_utils.dart` and they send messages for info, warning, and error.
256256

257-
```
257+
```dart
258258
// lib/utils/js_utils.dart (inside kJSSetupScript)
259259
console: {
260260
log: (...args) => {
@@ -271,7 +271,7 @@ console: {
271271

272272
On the Dart side, I wired the JS bridge to receive these messages. The handler currently prints them and includes a note to route them into the in‑app terminal UI. This is in `lib/services/flutter_js_service.dart`.
273273

274-
```
274+
```dart
275275
// lib/services/flutter_js_service.dart
276276
// TODO: These log statements can be printed in a custom api dash terminal.
277277
void setupJsBridge() {
@@ -292,6 +292,18 @@ void setupJsBridge() {
292292

293293
This design keeps the scripting API simple for users. You can call `ad.console.log(...)`, `ad.console.warn(...)`, or `ad.console.error(...)` in scripts and then open the Logs tab to see what happened, including any fatal errors with their stack traces from the JS engine. Internally, logs are captured centrally so the UI can show them in order, highlight severity, and allow quick filtering or clearing. This has already helped me and early users debug scripts and understand OAuth/token flows faster.
294294

295+
<p align="center">
296+
<img src="./images/terminal.png" alt="log-tab" />
297+
<br>
298+
<em>Logs Tab</em>
299+
</p>
300+
301+
<p align="center">
302+
<img src="./images/terminal_search.png" alt="log-search" />
303+
<br>
304+
<em>Logs Search</em>
305+
</p>
306+
295307

296308
## Challenges
297309

@@ -313,7 +325,7 @@ Designing a scalable, reliable action system for Dashbot was harder than just
313325

314326
The turning point was enforcing a strict, minimal JSON envelope in the system prompts:
315327

316-
```
328+
```json
317329
{
318330
"explanation": "<plain concise human summary>",
319331
"actions": [ { /* zero or more strictly typed action objects */ } ]
@@ -322,7 +334,7 @@ The turning point was enforcing a strict, minimal JSON envelope in the system pr
322334

323335
Every action object must follow a controlled schema (conceptually):
324336

325-
```
337+
```json
326338
{
327339
"action": "apply_curl | apply_openapi | show_languages | add_header | update_header | delete_header | update_body | update_method | update_url | import_now_openapi | download_doc | add_test | code | other",
328340
"target": "httpRequestModel | codegen | test | attachment | doc | <future>",
@@ -387,6 +399,6 @@ This experience has been far more than just writing code—it's been a journey o
387399

388400
Coming from a background of working solo on personal projects, this opportunity also introduced me to the invaluable experience of teamwork and collaboration. I learned the art of patience when waiting for code reviews, the importance of clear communication when discussing technical decisions, and how to work effectively with mentors and the broader community. These soft skills—teamwork, patience, and communication—have been just as transformative as the technical knowledge I gained. This is truly what made me a better person overall, not just a better developer.
389401

390-
I'm truly grateful for getting this incredible opportunity to contribute to such an amazing project. Most of all, I want to extend my heartfelt thanks to my wonderful, amazing and caring, mentors—Ashita P, Ankit M, and Ragul Raj M. Your guidance, patience, and support made this entire journey possible. You created an environment where I could learn, experiment, fail, and succeed, all while feeling supported every step of the way.
402+
I'm truly grateful for getting this incredible opportunity to contribute to such an amazing project. Most of all, I want to extend my heartfelt thanks to my wonderful, amazing and caring, mentors— Ashita P, Ankit M, and Ragul Raj M. Your guidance, patience, and support made this entire journey possible. You created an environment where I could learn, experiment, fail, and succeed, all while feeling supported every step of the way.
391403

392404
Looking ahead, I'm excited to see how future contributors will build upon this foundation and take API Dash to new heights.

0 commit comments

Comments
 (0)