{"id":22744235,"url":"https://github.com/rametta/quantor","last_synced_at":"2025-04-14T09:23:02.670Z","repository":{"id":57332311,"uuid":"149279933","full_name":"rametta/quantor","owner":"rametta","description":"💃 Simple SSR - JSON to HTML - API Docs","archived":false,"fork":false,"pushed_at":"2018-10-05T11:38:31.000Z","size":132,"stargazers_count":3,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-06T10:50:27.596Z","etag":null,"topics":["api","docs","mustache","node","ssr","swagger"],"latest_commit_sha":null,"homepage":"https://quantor.surge.sh","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rametta.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-09-18T11:50:11.000Z","updated_at":"2019-11-21T15:59:33.000Z","dependencies_parsed_at":"2022-09-15T12:20:17.535Z","dependency_job_id":null,"html_url":"https://github.com/rametta/quantor","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rametta%2Fquantor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rametta%2Fquantor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rametta%2Fquantor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rametta%2Fquantor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rametta","download_url":"https://codeload.github.com/rametta/quantor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248250743,"owners_count":21072682,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","docs","mustache","node","ssr","swagger"],"created_at":"2024-12-11T01:41:15.066Z","updated_at":"2025-04-14T09:23:02.645Z","avatar_url":"https://github.com/rametta.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![npm](https://img.shields.io/npm/v/quantor.svg)](http://npm.im/quantor)\n[![travis](https://travis-ci.com/rametta/quantor.svg?branch=master)](https://travis-ci.com/rametta/quantor)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](http://makeapullrequest.com)\n[![Open Source Love](https://badges.frapsoft.com/os/v1/open-source.svg?v=103)](https://github.com/rametta/quantor/)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n# 💃 Quantor\n\nBlazing fast alternative to Swagger. [Demo](https://quantor.surge.sh/)\n\n*Complete API docs up and running in less than 5 mins!*\n\n### Features\n- Premade and custimizable UI\n- Extremely fast rendering with mustacheJS\n- Easy to install and setup\n- SSR 100% supported *(and recommended)*\n- Tiny footprint - less than 3kb\n\n## Install\n\n`yarn add quantor`\n\n## Usage\n\n```js\nimport quantor from 'quantor'\n\nconst json = {...JSON API Docs}\nquantor(json)(html =\u003e /* do something with html */)\n\n// Express or GCF example\nquantor(json)(html =\u003e res.set('Content-Type', 'text/html').send(new Buffer(html)))\n```\n\n## JSON Structure\n\nQuantor generates the docs based on the JSON provided. The JSON must follow the Quantor JSON Spec. See this [example file](/sample.json) for the structure expected or see below.\n\nBasic structure:\n```json\n{\n  \"title\": \"String\",\n  \"description\": \"String\",\n  \"base\": \"String\",\n  \"endpoints\": [\n    {\n      \"name\": \"String\",\n      \"display\": \"String\",\n      \"description\": \"String\",\n      \"handlers\": {\n        \"GET\": {\n          \"optionalQueryParams\": [\n            {\n              \"name\": \"String\",\n              \"description\": \"String\",\n              \"type\": \"String\",\n              \"default\": \"Any\"\n            }\n          ],\n          \"responses\": [\n            {\n              \"code\": 200,\n              \"model\": \"User\"\n            }\n          ]\n        }\n      }\n    }\n  ],\n  \"models\": {\n    \"User\": {\n      \"name\": \"String\",\n      \"age\": \"Integer\"\n    }\n  }\n}\n```\n\nFacts:\n- Endpoints expects an array of endpoint objects.\n- Models is an optional map of objects used for response models.\n- Each endpoint object should have a handlers property.\n- The handlers property is a map of http methods like:\n  + GET\n  + POST\n  + PUT\n  + DELETE\n  + PATCH\n  + OPTIONS\n  + HEAD\n- Each http method should be an object with optional properties of:\n  + requiredQueryParams\n  + optionalQueryParams\n  + requiredBodyParams\n  + optionalBodyParams\n  + requiredHeaders\n  + optionalHeaders\n  + responses\n- Each of those properties should be an array of objects with a name, description, default \u0026 type.\n\n## Contributing\nCheck out our [contributer docs](/CONTRIBUTING.md) and check out our [issues](https://github.com/rametta/quantor/issues). Pick anything that tickles your fancy or create an issue that you would find useful.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frametta%2Fquantor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frametta%2Fquantor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frametta%2Fquantor/lists"}