{"id":18085010,"url":"https://github.com/coderofsalvation/coffeerest-api-db","last_synced_at":"2025-04-06T00:13:49.955Z","repository":{"id":146965079,"uuid":"42414019","full_name":"coderofsalvation/coffeerest-api-db","owner":"coderofsalvation","description":"automatic No-SQL/SQL database ORM-mapping for coffeerest-api (Api scaffolding from a model specification in few lines of coffeescript OH MY) ","archived":false,"fork":false,"pushed_at":"2020-05-28T18:45:07.000Z","size":12,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-12T06:22:36.959Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"CoffeeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/coderofsalvation.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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,"dei":null,"publiccode":null,"codemeta":null},"funding":{"custom":"https://gumroad.com/l/hGYGh"}},"created_at":"2015-09-13T21:41:36.000Z","updated_at":"2020-05-28T18:45:09.000Z","dependencies_parsed_at":"2023-05-05T22:30:45.638Z","dependency_job_id":null,"html_url":"https://github.com/coderofsalvation/coffeerest-api-db","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/coderofsalvation%2Fcoffeerest-api-db","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderofsalvation%2Fcoffeerest-api-db/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderofsalvation%2Fcoffeerest-api-db/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderofsalvation%2Fcoffeerest-api-db/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coderofsalvation","download_url":"https://codeload.github.com/coderofsalvation/coffeerest-api-db/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247415976,"owners_count":20935387,"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":[],"created_at":"2024-10-31T15:09:03.188Z","updated_at":"2025-04-06T00:13:49.946Z","avatar_url":"https://github.com/coderofsalvation.png","language":"CoffeeScript","funding_links":["https://gumroad.com/l/hGYGh"],"categories":[],"sub_categories":[],"readme":"Unfancy rest apis, connect any db (redis/mysql/mongodb/etc) to coffeerest\n\n\u003cimg alt=\"\" src=\"https://github.com/coderofsalvation/coffeerest-api/raw/master/coffeerest.png\" width=\"20%\" /\u003e\n\nConnect any database to coffeerest-api\n\n## Ouch! Is it that simple?\n\nJust add these fields to your coffeerest-api `model.coffee` specification \n\n    module.exports = \n      name: \"project foo\"\n      db: \n        type: \"redis\"\n        config:\n          port: 6379\n        resources:\n          article:\n            schema:\n              taggable: true\n              description: \"this foo bar\"\n              properties:\n                id:\n                  type: \"integer\"\n                title: \n                  type: \"string\"\n                  length: 255\n                  default: \"title not set\"\n                  required: true\n                  index: true\n                content:\n                  type: \"string\"\n                  default: \"Lorem ipsum\"\n                  typehint: \"content\"\n                  required: true\n                date:\n                  type: \"string\"\n                  typehint: \"date\"\n                  default: \"Date.now\"\n            belongsTo:\n              user:      { as: 'user', foreignKey: 'user_id' }\n          user:\n            schema:\n              taggable: true\n              description: \"author\"\n              properties:\n                id:      { type: \"integer\", default: 123, requiretag: [\"admin\"] }\n                email:   { type: \"string\", required:true, default: 'John Doe', requiretag: [\"admin\"] }\n                apikey:  { type: \"string\",  required: true, default: \"john@doe.com\", pattern: \"/\\S+@\\S+\\.\\S+/\" }\n            hasMany:\n              article: { as: 'articles', foreignKey: 'user_id' }\n      resources:\n        '/book/:category':\n          post:\n            ...\n\n## Usage \n\n    npm install coffeerest-api\n    npm install coffeerest-api-db\n\nfor more info / servercode see [coffeerest-api](https://www.npmjs.com/package/coffeerest-api)\n\n## Example \n\n\n    $ coffee server.coffee \u0026\n    registering REST resource: /v1/article (post)\n    registering REST resource: /v1/article/:id (get)\n    registering REST resource: /v1/article/:id (del)\n    registering REST resource: /v1/article/:id (put)\n    registering REST resource: /v1/article/tags (post)\n    registering REST resource: /v1/article/tags/:id (get)\n    registering REST resource: /v1/article/tags/:id (del)\n    registering REST resource: /v1/article/tags/:id (put)\n    registering REST resource: /v1/user (post)\n    registering REST resource: /v1/user/:id (get)\n    registering REST resource: /v1/user/:id (del)\n    registering REST resource: /v1/user/:id (put)\n    registering REST resource: /v1/user/tags (post)\n    registering REST resource: /v1/user/tags/:id (get)\n    registering REST resource: /v1/user/tags/:id (del)\n    registering REST resource: /v1/user/tags/:id (put)\n    $ curl -H 'Content-Type: application/json' -X POST http://localhost:$PORT/v1/article --data '{\"title\":\"foo\",\"content\":\"bar\"}' \n    $ curl -H 'Content-Type: application/json' http://localhost:$PORT/v1/article/1 \n    $ curl -H 'Content-Type: application/json' -X PUT http://localhost:$PORT/v1/article/1 --data '{\"title\":\"flopje\", \"content\":\"bar\"}' \n    $ curl -H 'Content-Type: application/json' http://localhost:$PORT/v1/article/1 \n    $ curl -H 'Content-Type: application/json' -X DELETE http://localhost:$PORT/v1/article/1 \n\nVoila! all api-endpoints are generated, validated and connected to a database store of your choice (using jugglingdb)!\n\n## Tag system \n\ncoffeerest-api-db also includes a tag/permission system.\nWhat is that?\nWell..this was inspired by roundup tracker.\nIt allows tagging database-objects and adding permissions to tags.\nThe aim is to offer extendability to a databasedesign without fiddling with code.\nFor example, many 'could you add this extra field in the database'-featurerequest or 'hey we need an extra category'-featurerequest could be prevented by just having tag-features. \n\n*need more docs here*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoderofsalvation%2Fcoffeerest-api-db","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoderofsalvation%2Fcoffeerest-api-db","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoderofsalvation%2Fcoffeerest-api-db/lists"}