{"id":40791941,"url":"https://github.com/alxmagro/modele","last_synced_at":"2026-01-21T20:09:19.419Z","repository":{"id":25701999,"uuid":"103800057","full_name":"alxmagro/modele","owner":"alxmagro","description":"Frontend models, API Rest, data processing and validation.","archived":false,"fork":false,"pushed_at":"2023-01-04T21:50:17.000Z","size":1924,"stargazers_count":10,"open_issues_count":15,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-05-14T16:35:45.723Z","etag":null,"topics":["api","builder","model","query","rest","validation"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alxmagro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-09-17T03:23:18.000Z","updated_at":"2023-05-20T19:02:03.000Z","dependencies_parsed_at":"2023-01-14T03:13:18.486Z","dependency_job_id":null,"html_url":"https://github.com/alxmagro/modele","commit_stats":null,"previous_names":["alexandremagro/modele"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/alxmagro/modele","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alxmagro%2Fmodele","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alxmagro%2Fmodele/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alxmagro%2Fmodele/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alxmagro%2Fmodele/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alxmagro","download_url":"https://codeload.github.com/alxmagro/modele/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alxmagro%2Fmodele/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28641300,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T18:04:35.752Z","status":"ssl_error","status_checked_at":"2026-01-21T18:03:55.054Z","response_time":86,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","builder","model","query","rest","validation"],"created_at":"2026-01-21T20:09:18.640Z","updated_at":"2026-01-21T20:09:19.408Z","avatar_url":"https://github.com/alxmagro.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"logo.png\"/\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://travis-ci.org/alexandremagro/modele\"\u003e\n    \u003cimg src=\"https://travis-ci.org/alexandremagro/modele.svg?branch=master\" alt=\"Build Status\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://codecov.io/gh/alexandremagro/modele\"\u003e\n    \u003cimg src=\"https://codecov.io/gh/alexandremagro/modele/branch/master/graph/badge.svg\" alt=\"codecov\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/modele\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/dt/modele.svg\" alt=\"npm\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/modele\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/v/modele.svg\" alt=\"npm\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://bundlephobia.com/result?p=modele\"\u003e\n    \u003cimg alt=\"npm bundle size\" src=\"https://img.shields.io/bundlephobia/minzip/modele\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/alexandremagro/modele/blob/master/LICENSE\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/license/alexandremagro/modele.svg\" alt=\"GitHub license\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n## Introduction\n\nModele helps you to build requests for REST API. Organize the requests into classes that represents your Back-end models.\n\nThis library takes care of this things, helping the developer to keep the communication-to-server logic, sorted by models, providing:\n\n- Built-in **Rest API** methods like **get**, **create**, **update** and **delete**.\n- **Mutation** of the data, before it is sent to the server.\n- **Validation** of data on the client side, including some built-in rules.\n\n## Examples\n\n- [Vue, Vuex and Modele](https://codesandbox.io/s/example-api-with-vuex-and-modele-e8yl0) (Codesandbox).\n\n## Documentation\n\n- Guide: [Modele/wiki](https://github.com/alexandremagro/modele/wiki).\n- Changelog: [Modele/releases](https://github.com/alexandremagro/modele/releases).\n\n## Installation\n\nUsing NPM:\n\n```shell\nnpm i --save modele\n```\n\nUsing yarn:\n\n```shell\nyarn add modele\n```\n\n## Basic Usage\n\nSetup **Rest API**, **validation** and **mutations**:\n\n```js\nimport axios from 'axios'\nimport { Modele } from 'modele'\nimport { presence } from 'modele/validations'\n\nclass User extends Modele {\n  // 1. Setup resource baseURL\n  static setup () {\n    return {\n      baseURL: 'https://my-api.com/:api/users[/:id]'\n    }\n  }\n\n  // 2. Setup request engine\n  static request (config) {\n    return axios(config)\n  }\n\n  // 3. Setup mutator functions per property\n  static mutations () {\n    return {\n      name: (value) =\u003e value \u0026\u0026 value.trim()\n    }\n  }\n\n  // 4. Setup validation rules per property\n  static validation () {\n    return {\n      name: [presence()],\n      surname: [presence()]\n    }\n  }\n}\n```\n\nUsage:\n\n```js\nconst user = new User({ name: 'Darth   ', surname: 'Vader' })\n// =\u003e User { name: 'Darth   ', surname: 'Vader' }\n\nuser.$validate()\n// =\u003e true\n\nUser.create(user, { api: 1 })\n// =\u003e POST https://my-api.com/1/users { name: 'Darth', surname: 'Vader' }\n```\n\nRead the [Wiki](https://github.com/alexandremagro/modele/wiki) to learn more.\n\n## Bug Reports \u0026 Feature Requests\n\nPlease use the [issue tracker](https://github.com/alexandremagro/modele/issues) to report any bugs or file feature requests.\n\n## License\n\n[MIT](http://opensource.org/licenses/MIT)\n\nCopyright (c) 2017-present, Alexandre Magro\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falxmagro%2Fmodele","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falxmagro%2Fmodele","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falxmagro%2Fmodele/lists"}