{"id":13559069,"url":"https://github.com/serafin-labs/serafin","last_synced_at":"2025-04-11T09:14:34.366Z","repository":{"id":95310906,"uuid":"109129356","full_name":"serafin-labs/serafin","owner":"serafin-labs","description":"An API framework in Typescript/Node.js with OpenApi 3 \u0026 GraphQL","archived":false,"fork":false,"pushed_at":"2019-05-09T22:34:37.000Z","size":573,"stargazers_count":16,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-04T10:43:45.802Z","etag":null,"topics":["framework","graphql","json-schema","openapi","openapi3","rest-api","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/serafin-labs.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-11-01T12:35:17.000Z","updated_at":"2024-05-04T22:28:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"885209fb-8935-4d3c-8827-a7d9f86589c8","html_url":"https://github.com/serafin-labs/serafin","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/serafin-labs%2Fserafin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serafin-labs%2Fserafin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serafin-labs%2Fserafin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serafin-labs%2Fserafin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/serafin-labs","download_url":"https://codeload.github.com/serafin-labs/serafin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228762643,"owners_count":17968683,"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":["framework","graphql","json-schema","openapi","openapi3","rest-api","typescript"],"created_at":"2024-08-01T12:05:19.636Z","updated_at":"2024-12-08T17:12:43.322Z","avatar_url":"https://github.com/serafin-labs.png","language":"TypeScript","funding_links":[],"categories":["TypeScript","graphql","typescript","📦 Legacy \u0026 Inactive Projects"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\u003cimg src=\"https://serafin-labs.github.io/images/logo-serafin-with-text-1080.png\" width=\"300\"/\u003e\u003c/p\u003e\n\n**Serafin** is an *API framework* designed to quickly set up a robust **self-descriptive REST API** written in *nodeJS/Typescript*.\n\nIt is based on **Open API 3**, **JSON Schema** and **GraphQL** standards.\n\n[![Greenkeeper badge](https://badges.greenkeeper.io/serafin-labs/serafin.svg)](https://greenkeeper.io/)\n[![Dependencies](https://img.shields.io/david/serafin-labs/serafin.svg)](https://david-dm.org/serafin-labs/serafin)\n[![Maintainability](https://api.codeclimate.com/v1/badges/beba161ae0e5f4f69c79/maintainability)](https://codeclimate.com/github/serafin-labs/serafin/maintainability)\n[![Test Coverage](https://api.codeclimate.com/v1/badges/beba161ae0e5f4f69c79/test_coverage)](https://codeclimate.com/github/serafin-labs/serafin/test_coverage)\n\n## Installation\nThere's no npm package yet! We are close to the alpha release and we will produce packages for this version.\nIf you want to test **serafin** you can clone the repo and run it locally or you can include a direct git reference to your ```package.json``` :\n\n```json\n\"@serafin/api\": \"git+ssh://git@github.com/serafin-framework/serafin.git\"\n```\n\n## Concepts\n\nIf you want to know more about Serafin concepts and features, go to our [overview document](./misc/doc/OVERVIEW.md)\n\n## Getting started\n\nIf you just want to get started and write some code, go to our [walkthrough document](./misc/doc/WALKTHROUGH.md)\n\n## What does it look like ?\n\nA very simple example looks like that :\n\n```typescript\nimport * as express from 'express';\nimport * as bodyParser from 'body-parser';\nimport { SchemaBuilder } from '@serafin/schema-builder';\nimport { Api, PipelineSourceInMemory, RestTransport } from '@serafin/api';\n\n// express initialization\nlet app = express();\napp.use(bodyParser.json());\n\n// Declare our Api with its general information\nlet api = new Api(app, {\n    \"openapi\": \"3.0.0\",\n    \"info\": {\n        \"version\": \"1.0.0\",\n        \"title\": \"An API\"\n    },\n    paths: {}\n});\napi.configure(new RestTransport());\n\n// Declare a Schema for our \"entity\"\nlet aModelSchema = SchemaBuilder.emptySchema().addString(\"id\").addString(\"data\");\n\n// Define the pipeline, it stores data into memory directly\nlet aPipeline = (new PipelineSourceInMemory(aModelSchema))\n  //.pipe(...) // Add a pipeline to extend the behavior\n\n// Use the pipeline in the api. It will add all the routes and compute Open Api spec\napi.use(aPipeline, \"model\");\n\n// Start the server\napp.listen(process.env.PORT || 80);\n```\n\nWith this basic example you now have the following endpoints:\n\n- GET /api.json which contains Open Api spec for this API\n- GET /models\n- POST /models\n- GET /models/:id\n- PUT /models/:id\n- PATCH /models/:id\n- DELETE /models/:id\n\nThe important point is that the **Api** react to the **pipeline** behaviour. When you define new constraints on your **schema** or new options in a **pipeline**, the **Api** will react accordingly.\n\nIf you want to see more complex examples, take a look at the ```src/example``` folder.\n\n\n## Contributing\n\nThe project interests you ? Read our [contributer guide](./CONTRIBUTING.md) so you can get involved.\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserafin-labs%2Fserafin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fserafin-labs%2Fserafin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserafin-labs%2Fserafin/lists"}