{"id":18604288,"url":"https://github.com/izica/api-documentation-tool","last_synced_at":"2025-05-16T18:37:14.933Z","repository":{"id":139291492,"uuid":"164311945","full_name":"izica/api-documentation-tool","owner":"izica","description":"Easy API documentation for your project, based on Javascript","archived":false,"fork":false,"pushed_at":"2019-06-29T23:30:04.000Z","size":560,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-18T01:49:56.491Z","etag":null,"topics":["api","api-doc","api-docs","api-docs-generator","api-docset","api-documentartion","api-documentation","api-documentation-tool","api-javascript","documentation","documentation-generator","documentation-site","documentation-tool","javascript","reactjs","rest","rest-api","restful","restful-api","swagger"],"latest_commit_sha":null,"homepage":"","language":"CSS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/izica.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-01-06T13:54:49.000Z","updated_at":"2019-06-29T23:30:06.000Z","dependencies_parsed_at":"2024-07-14T15:03:07.235Z","dependency_job_id":null,"html_url":"https://github.com/izica/api-documentation-tool","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/izica%2Fapi-documentation-tool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/izica%2Fapi-documentation-tool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/izica%2Fapi-documentation-tool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/izica%2Fapi-documentation-tool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/izica","download_url":"https://codeload.github.com/izica/api-documentation-tool/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254587786,"owners_count":22096367,"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","api-doc","api-docs","api-docs-generator","api-docset","api-documentartion","api-documentation","api-documentation-tool","api-javascript","documentation","documentation-generator","documentation-site","documentation-tool","javascript","reactjs","rest","rest-api","restful","restful-api","swagger"],"created_at":"2024-11-07T02:17:17.479Z","updated_at":"2025-05-16T18:37:14.925Z","avatar_url":"https://github.com/izica.png","language":"CSS","readme":"# Easy API documentation, based on JS without any backend.\nBuild your API reference with pure Javascript\nAlso you can modify core, which written on ReactJS\n\n## Features\n* Declarative API description\n* Supports POST, GET, PUT, DELETE requests\n* Custom transformations for Requests: header, body, path params\n* Customizable core\n* ReactJS core\n* Models section\n\n## Installation and Usage\n```\nnpm install\n```\n\n#### Dev\n```\nnpm start\n```\n\n#### Build\n\n```\nnpm run build\n```\n\n\n![alt screen1](https://raw.githubusercontent.com/izica/project-doc-js/master/core/git_images/screenshot-4.png)\n\n![alt screen2](https://raw.githubusercontent.com/izica/project-doc-js/master/core/git_images/screenshot-5.png)\n\n![alt screen3](https://raw.githubusercontent.com/izica/project-doc-js/master/core/git_images/screenshot-6.png)\n\n\n\n# Build your API documentation\n## Manual config\n* edit `config/app.js`, set your `appName`, and `buildPath`, you can add all repo to `src` folder and set `buildPath: '../'`\n* edit `config/api.js` and set `baseUrl` to your backend URL\n\n## Api requests creating\n* create request in `config/api/`\n* `import` request to `config/api.js`\n* In `config/api.js` add reqiest to `sections` for adding request to api page\n```javascript\nrequest.js\nimport {\n    Request,\n    REQUEST_TYPE,\n    PARAMETER_TYPE\n} from 'core';\n\nclass  SendSms extends Request {\n    init = () =\u003e {\n        this.setUrl('/customer/send-sms')\n            .setTitle('Send sms')\n            .setType(REQUEST_TYPE.POST);\n\n        this.addParameter({\n            type: PARAMETER_TYPE.BODY,\n            name: 'phone',\n            placeholder: '+79131001010'\n        });\n    }\n}\n\nexport default SendSms;\n```\n```javascript\n//api.js\nimport WelcomeScreenList from './api/welcome_screen/List';\nimport CustomerSendSms from './api/customer/SendSms';\n\nconst api = {\n    title: 'YOUR API',\n    description: `\n        \u003cdiv\u003e\n            API reference\n        \u003c/div\u003e\n    `,\n    baseUrl: 'http://api-backend.local',\n    sections: [\n        {\n            id: 'customer',\n            title: 'Customer',\n            description: ``,\n            requests: [\n                CustomerSendSms\n            ]\n        }\n    ]\n};\n\nexport default api;\n```\n\n### PARAMETER_TYPE.PATH\nPARAMETER_TYPE.PATH add parameter value to request URL\n\n```javascript\nclass DeviceCodeSend extends Request {\n    init = () =\u003e {\n        this.setUrl('/customer-device-code/send/:phone')\n            .setTitle('Send sms')\n            .setType(REQUEST_TYPE.POST);\n\n        this.addParameter({\n            type: PARAMETER_TYPE.PATH,\n            name: 'phone',\n            placeholder: '+79131001010'\n        });\n    }\n}\n```\nalso you can do that\n```javascript\nthis.setUrl('/catalog/:category_id/:product_id/get')\n```\n![alt screen3](https://raw.githubusercontent.com/izica/project-doc-js/master/core/git_images/parameter_path.png)\n\n\n## Model creating(Database table reference for example)\n* Create `config/models/\u003cYourModelName\u003e.js`\n* `import` your model to `config/models.js`\n    \n```javascript\nimport { Model } from 'core';\n\nclass User extends Model {\n    init = () =\u003e {\n        this.addField({\n            name: 'id',\n            type: 'integer'\n        });\n\n        this.addField({\n            name: 'name'\n        })\n\n        this.addField({\n            name: 'phone',\n            description: '+79131001010'\n        });\n    }\n}\n\nexport default Customer;\n```\n```javascript\n//add field to model\naddField({\n    name, //string\n    type, //string; by default = 'string'\n    null, //bool, field is required or not; by default = false\n    default, //string\n    description, //string\n})\n```\n\n### You can use linked field type\n```\nimport { Model } from 'core';\n\nclass Product extends Model {\n    init = () =\u003e {\n        this.addField({\n            name: 'id',\n            type: 'integer'\n        });\n\n        this.addField({\n            name: 'name'\n        });\n\n        this.addField({\n            name: 'price',\n            type: 'integer'\n        });\n\n        this.addField({\n            name: 'product_category_id',\n            type: 'ProductCategory.id'\n        });\n    }\n```\n![alt screen3](https://raw.githubusercontent.com/izica/project-doc-js/master/core/git_images/field_type_linked.png)\n\n# Class docs\n## core partials\n* Model\n* ModelField\n* Request\n* RequestParameter\n* PARAMETER_TYPE\n* REQUEST_TYPE\n* DATA_TYPE\n\n```javascript\nimport {\n    Request,\n    REQUEST_TYPE,\n    PARAMETER_TYPE\n} from 'core';\n```\n\n## Model\n* addField(object || ModelField) - object has same structure as ModelField class\n\n## ModelField\n* name: String = 'field'\n* type: String = 'string'\n* null: Boolean = false - field is required or not\n* default: String = '' - default value\n* description: String = ''\n* setName(value)\n* setType(value)\n* setNull(value)\n* setDefault(value)\n* setDescription(value)\n\n## Request\n* init()\n* setBaseUrl(baseUrl) - set new base api url for current endpoint\n* setUrl(url) - set url for api request, you can use templating with PARAMETER_TYPE.PATH, '/:product_category_code/product/:id'\n* setType(REQUEST_TYPE) - one of type REQUEST_TYPE\n* setTitle(title)\n* setDescription(description) - additional description for endpoint\n* addParameter(object || RequestParameter) - object has same structure as RequestParameter class\n* transformHeaders(headers) =\u003e headers - you can override this function for mutate headers before request execute\n* transformQuery(query) =\u003e query\n* transformBody(body) =\u003e body\n\n## RequestParameter\n* type: PARAMETER_TYPE\n* dataType: DATA_TYPE\n* dataFormat: String - need for DATA_TYPE.DATE, depends on momentjs, example: 'Y-m-d'\n* name: String\n* placeholder: String\n* description: String\n* required: Boolean\n* readonly: Boolean\n* value: Any - default value, depends on control type\n* options: Array - if length \u003e 0, form control type will be Select, example: ['red', 'yellow', 'green']\n* setType(PARAMETER_TYPE)\n* setDataType(DATA_TYPE)\n* setName(name)\n* setPlaceholder(placeholder)\n* setDescription(description)\n* setRequired(required)\n* setReadonly(readonly)\n* setValue(defaultValue)\n* setOptions(options)\n\n## REQUEST_TYPE\n* GET: 'get'\n* POST: 'post'\n* PUT: 'put'\n* DELETE: 'delete'\n\n## DATA_TYPE\n* STRING: 'string' - Input, if options.length \u003e 0 -\u003e Select\n* NUMBER: 'number' - Input type=number\n* DATE: 'date' - Datepicker(react-datepicker + momentjs)\n* BOOLEAN: 'boolean' - Checkbox\n* FILE: 'file' - Input type=file\n\n## PARAMETER_TYPE\n* HEADER: 'header'\n* BODY: 'body' - for POST parameters\n* QUERY: 'query' - for GET parameters\n* PATH: 'path' - you can use it for URL templating, for example '/:product_category_code/product/:id'\n\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fizica%2Fapi-documentation-tool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fizica%2Fapi-documentation-tool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fizica%2Fapi-documentation-tool/lists"}