Comments as the source of truth
Annotations need no build step, no decorators and no runtime dependency in the Node.js project.
Case study · Open source
A Dart CLI that reads simple comments above Node.js controller methods and generates a Postman collection, a web docs page and Express route files.
thunder_api01Problem
In an Express backend the same endpoint lives in three places: the controller, the route file and the Postman collection the team tests with. Keeping them in sync by hand is slow and they drift. Thunder API makes the controller the single source of truth.
02My role
I built the CLI and its parser and maintain the package on pub.dev (first release March 2025).
03How it works
Annotations such as // @desc, // @route, // @param, // @body and // @access sit above each exported method. The CLI scans the controllers folder (sub-folders too), parses them and writes a Postman v2.1 collection with folders per controller, a static web page documenting every request, and one Express router per controller.
$ dart pub global activate thunder_api # address_controller.js // @desc Get all addresses // @route GET /api/v1/addresses // @access Private (user) $ thunder_api --build-api-doc $ thunder_api --build-routes
04Key technical decisions
Annotations need no build step, no decorators and no runtime dependency in the Node.js project.
Routes marked Private (...) get bearer auth with {{token}}; public routes get none.
05Hard parts solved
Every path was hard-coded with Windows \; on macOS and Linux output files got names like controllers\thunder-output\Demo.json. 1.1.0 builds paths with package:path.
The generator wrote variables/events where Postman v2.1 expects variable/event, so {{base_url}} was undefined after import; query params are now in both the URL and Postman's query list.
Generated routers now pass node --check, with correct HTTP methods and module.exports, for LF and CRLF source files alike.
06Outcome
1.1.0 added an example project, documented API, 10 tests and CI, and gives friendly errors (exit code 64 on an unknown flag).
Out of 160.
Source: git history of the main branch (Oct 31, 2026).
07Stack & links
© 2026 Abd Alftah Salem · Back to portfolio