{"_id":"@alumna/backend","_rev":"5-471535431083c556dd1586986207fb8d","name":"@alumna/backend","dist-tags":{"latest":"1.0.4"},"versions":{"1.0.1":{"name":"@alumna/backend","version":"1.0.1","description":"Alumna Backend: Real-time backend without runtime dependencies","repository":{"type":"git","url":"git://github.com/alumna/backend.git"},"main":"dist/alumna.cjs.js","module":"dist/alumna.es.js","scripts":{"build":"rollup --config other/rollup/cjs.js && rollup --config other/rollup/es.js","prepare":"pnpm build","test":"jest --runInBand --coverage --forceExit","clear_jest":"jest --clearCache"},"author":{"name":"Paulo Coghi"},"license":"MIT","jest":{"coverageDirectory":"./coverage/","collectCoverage":true,"collectCoverageFrom":["**/src/**","!**/dist/**","!**/node_modules/**","!**/rollup/**"],"verbose":true,"testEnvironment":"node"},"bugs":{"url":"https://github.com/alumna/backend/issues"},"devDependencies":{"@babel/plugin-transform-modules-commonjs":"^7.15.4","@polka/send-type":"^0.5.2","@rollup/plugin-commonjs":"^20.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^13.0.5","body-parser":"^1.19.0","cors":"^2.8.5","httpie":"^1.1.2","jest":"^27.2.4","polka":"^0.5.2","rollup":"^2.57.0","rollup-plugin-terser":"^7.0.2"},"gitHead":"41c29e0c65b2166365eb69ab514f4020368b50a9","homepage":"https://github.com/alumna/backend#readme","_id":"@alumna/backend@1.0.1","_nodeVersion":"14.18.0","_npmVersion":"7.16.0","dist":{"integrity":"sha512-9QDCCRvUw6URZCGobrfhCjxKFZD5vQmX2fg83mr2W6F4MYZg+Gtap7v8tHfTSowxfY+f7D+wI6T2vdB1let4YA==","shasum":"81338c260683470ce74aa1a416d13e334ac86598","tarball":"https://registry.npmjs.org/@alumna/backend/-/backend-1.0.1.tgz","fileCount":7,"unpackedSize":1059991,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDTX0r7AlmoZ7uY76TQrLZ7OKETIjetAIKKdNqBPCFYfwIhAPtDRQr333GPxxmJNOJqzJa/lVPbp37AFXRnd6BHnkUu"}]},"_npmUser":{"name":"paulocoghi","email":"paulo@coghi.com.br"},"directories":{},"maintainers":[{"name":"jampix","email":"pasqualemazzei@gmail.com"},{"name":"paulocoghi","email":"paulo@coghi.com.br"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/backend_1.0.1_1633513648629_0.19316288751507393"},"_hasShrinkwrap":false},"1.0.2":{"name":"@alumna/backend","version":"1.0.2","description":"Alumna Backend: Real-time backend without runtime dependencies","repository":{"type":"git","url":"git://github.com/alumna/backend.git"},"main":"dist/alumna.cjs.js","module":"dist/alumna.es.js","author":{"name":"Paulo Coghi"},"license":"MIT","jest":{"coverageDirectory":"./coverage/","collectCoverage":true,"collectCoverageFrom":["**/src/**","!**/dist/**","!**/node_modules/**","!**/rollup/**"],"verbose":true,"testEnvironment":"node"},"bugs":{"url":"https://github.com/alumna/backend/issues"},"devDependencies":{"@babel/plugin-transform-modules-commonjs":"^7.15.4","@polka/send-type":"^0.5.2","@rollup/plugin-commonjs":"^20.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^13.0.5","body-parser":"^1.19.0","cors":"^2.8.5","httpie":"^1.1.2","jest":"^27.2.4","polka":"^0.5.2","rollup":"^2.57.0","rollup-plugin-terser":"^7.0.2"},"scripts":{"build":"rollup --config other/rollup/cjs.js && rollup --config other/rollup/es.js","test":"jest --runInBand --coverage --forceExit","clear_jest":"jest --clearCache"},"_resolved":"","_integrity":"","_from":"file:alumna-backend-1.0.2.tgz","homepage":"https://github.com/alumna/backend#readme","_id":"@alumna/backend@1.0.2","_nodeVersion":"14.18.0","_npmVersion":"6.14.15","dist":{"integrity":"sha512-Wh3h+ysNKSTGLq1u4v3xOdJnq1y0MkOvAZq/lZdKqrIub1mPf0FcMk2PBGPm/grG1yPr718lyNP91K48DwTq0A==","shasum":"2f509b92b6ce65978c8df28356cf57035fb979a9","tarball":"https://registry.npmjs.org/@alumna/backend/-/backend-1.0.2.tgz","fileCount":7,"unpackedSize":1060135,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhzFHCCRA9TVsSAnZWagAAJyYP/ArxbRlkGxU9IbllUpck\nKNDdpciSKRKjNZS0HBZr0Mh+xnlPt8cUkFTx09UwWjtcDvrsso15iOPz5rGQ\n5EP4r6SqfkHe93EDT9l+PUOSHRg2RwLjH+KtC/jDieLvDzdGoH/yE96+091X\nA++LDzjaFeldIWzm783sRoJuTQkb1oZiep8dgtBuWh4Ql2TrtXTukoWTeGkJ\n2lgB+5EXZgtfa7AiXe6WCG2Pg6KPVIF1zTnyEWh+mvJQeZ1HZCILYsyHceX/\n2aY3l2Ld03jeJN3txsvCeGgoYSRQzCugUr01iB09QIsJQh6nHWDNuH1RnnBU\nUTmh6JRarIvdBXa7MN65Bwtsq4kBy6gqtKZsDRqa8RlyeBSUzhRsSc+fsRaY\nFFB9ZqokUwgF9BCX/EMvG7LgZrxmBouqeS79Rzaq7PukRBTEA2lMlrx0cGBf\ntvVh/GbgYYnIOyhhMNqNHgpsr8k57GwED9p5wpvo57DmKp3xSGuL3e4ZfPcz\nVw6JTkGOkBUC9Ds1cPfpdEtT3a6SwQ7HKJF6ofLZqj7UTDuUBSKdR6i1FoPb\n0OiIiX38/O4wuc2Amr+6ld/L/683lQ2/HcFK/lcvPVIMCDvFcJQTQNdRuGbs\nf6lzvZrhfZi2CGx1SKm4cx7o581GKsZAWPW/pkYT6QxwqI28zEHPlgO9AqxZ\n/lG1\r\n=k4/C\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCzV4Az1GTEsjWlp1QnHByeYK0LTH1z7ZRQ7I3/mpj9oAIgdUGSlAelyY3DlMi9h63uaA7zxxpqMG/ZD9ZW/aDSEZQ="}]},"_npmUser":{"name":"jampix","email":"pasqualemazzei@gmail.com"},"directories":{},"maintainers":[{"name":"jampix","email":"pasqualemazzei@gmail.com"},{"name":"paulocoghi","email":"paulo@coghi.com.br"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/backend_1.0.2_1633588486536_0.6935140476184745"},"_hasShrinkwrap":false},"1.0.3":{"name":"@alumna/backend","version":"1.0.3","description":"Alumna Backend: Real-time backend without runtime dependencies","repository":{"type":"git","url":"git://github.com/alumna/backend.git"},"main":"dist/alumna.js","module":"dist/alumna.js","scripts":{"build":"rollup --config other/rollup/es.js","prepare":"bun run build","test":"jest --runInBand --coverage --forceExit","clear_jest":"jest --clearCache"},"author":{"name":"Paulo Coghi"},"license":"MIT","jest":{"coverageDirectory":"./coverage/","collectCoverage":true,"collectCoverageFrom":["**/src/**","!**/test/**","!**/dist/**","!**/node_modules/**","!**/rollup/**"],"verbose":true,"testEnvironment":"node"},"bugs":{"url":"https://github.com/alumna/backend/issues"},"devDependencies":{"@babel/core":"^7.17.5","@babel/plugin-transform-modules-commonjs":"^7.16.8","@polka/send-type":"^0.5.2","@rollup/plugin-commonjs":"^21.0.2","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^13.1.3","@rollup/plugin-terser":"^0.4.3","body-parser":"^1.19.2","cors":"^2.8.5","httpie":"^1.1.2","jest":"^27.5.1","polka":"^0.5.2","rollup":"^2.68.0"},"gitHead":"046e9caf3b3105c821dfe2906f25d57854d1af31","homepage":"https://github.com/alumna/backend#readme","_id":"@alumna/backend@1.0.3","_nodeVersion":"18.17.1","_npmVersion":"9.6.7","dist":{"integrity":"sha512-vjYjJ58qCyCxOdeMXQ+2UxCLtGb6TEpp7LIttCwIV+QSQgoMr9cyCt0CeUyVv88PcVBChAn29LSt11MscpKSsw==","shasum":"50f3c576e6997d0a0d0b086ad88d492634ee1553","tarball":"https://registry.npmjs.org/@alumna/backend/-/backend-1.0.3.tgz","fileCount":7,"unpackedSize":657584,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDIFExrSSudwZAVRK2Vd7j/MwOwfkZHeUtq94my22v+eAIgM9NaaGpiPEcNTaQ3LvxeDHlrUzR2ZPP7Ac7ODqGh3R8="}]},"_npmUser":{"name":"paulocoghi","email":"paulo@adimira.com"},"directories":{},"maintainers":[{"name":"jampix","email":"pasqualemazzei@gmail.com"},{"name":"paulocoghi","email":"paulo@adimira.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/backend_1.0.3_1695628364145_0.23045495264556082"},"_hasShrinkwrap":false},"1.0.4":{"name":"@alumna/backend","version":"1.0.4","description":"Alumna Backend: Real-time backend without runtime dependencies","repository":{"type":"git","url":"git://github.com/alumna/backend.git"},"main":"dist/alumna.js","module":"dist/alumna.js","type":"module","scripts":{"build":"rollup --config other/rollup/es.js","test":"node --experimental-vm-modules node_modules/jest/bin/jest.js --runInBand --coverage --forceExit","clear_jest":"jest --clearCache"},"author":{"name":"Paulo Coghi"},"license":"MIT","jest":{"coverageDirectory":"./coverage/","collectCoverage":true,"collectCoverageFrom":["**/src/**","!**/test/**","!**/dist/**","!**/node_modules/**","!**/rollup/**"],"verbose":true,"testEnvironment":"node","transform":{}},"bugs":{"url":"https://github.com/alumna/backend/issues"},"devDependencies":{"@polka/send-type":"^0.5.2","@rollup/plugin-commonjs":"^25.0.7","@rollup/plugin-json":"^6.1.0","@rollup/plugin-node-resolve":"^15.2.3","@rollup/plugin-terser":"^0.4.4","body-parser":"^1.20.2","cors":"^2.8.5","httpie":"^1.1.2","jest":"^29.7.0","polka":"^0.5.2","rollup":"^4.13.0"},"_id":"@alumna/backend@1.0.4","gitHead":"2884e8b3a6bfe0e3f74cc6a43b1b87a2b9371001","homepage":"https://github.com/alumna/backend#readme","_nodeVersion":"21.6.2","_npmVersion":"10.2.4","dist":{"integrity":"sha512-CrJAMsHA2WAcTOATuRuo4WqTV+E9UMaan0Pmw/W1F4XGUOBg0eGsokR1eQ6hGlq1gqQlefIlkKizY2ZSuvvsKg==","shasum":"cd2d316b7bdd5d7f2a893570aaa8d78ba44bfc25","tarball":"https://registry.npmjs.org/@alumna/backend/-/backend-1.0.4.tgz","fileCount":7,"unpackedSize":503530,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCcuLqUKJPSK7SXWDEc1SXrY+0tEyCWZ/ySCvOeCTgEcwIhAMvrZ/n4o6Oy2wwY/qHuDihTPJX+Lnk3gJBLezYj8cS4"}]},"_npmUser":{"name":"paulocoghi","email":"paulo@adimira.com"},"directories":{},"maintainers":[{"name":"jampix","email":"pasqualemazzei@gmail.com"},{"name":"paulocoghi","email":"paulo@adimira.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/backend_1.0.4_1711196286435_0.9719186739683714"},"_hasShrinkwrap":false}},"time":{"created":"2021-10-06T09:47:28.591Z","1.0.1":"2021-10-06T09:47:28.819Z","modified":"2024-03-23T12:18:07.339Z","1.0.2":"2021-10-07T06:34:46.730Z","1.0.3":"2023-09-25T07:52:44.337Z","1.0.4":"2024-03-23T12:18:06.656Z"},"maintainers":[{"name":"jampix","email":"pasqualemazzei@gmail.com"},{"name":"paulocoghi","email":"paulo@adimira.com"}],"description":"Alumna Backend: Real-time backend without runtime dependencies","homepage":"https://github.com/alumna/backend#readme","repository":{"type":"git","url":"git://github.com/alumna/backend.git"},"author":{"name":"Paulo Coghi"},"bugs":{"url":"https://github.com/alumna/backend/issues"},"license":"MIT","readme":"# Alumna Backend: Towards a software architecture that is easier, technology agnostic and future-proof\n\n![npm](https://img.shields.io/npm/v/@alumna/backend.svg) ![npm](https://img.shields.io/npm/dt/@alumna/backend.svg) \n\nAlumna Backend is a NodeJS/Bun **back-end framework** which is the first implementation of a new software architecture concept, which provides abstraction of all layers involved, including protocols.\n\nIt is the first experiment based on a variation of continuous passing style, present on many frameworks like Express, but heavily inspired by FeathersJS, but recreating the internals from scratch as well as leaving the call stack linear, implementing a \"linear continuous passing style\" concept.\n\n## Install and basic usage\n\n### Step 1\n\nInstall it using your prefered package manager. The command below considers `npm`:\n\n```\nnpm install @alumna/backend\n```\n\n### Step 2\n\nImport the library and create the endpoints:\n\n```js\n// import the library\nimport Alumna from '@alumna/backend';\n\n// import services types, e.g.\nimport MysqlService from './services/MysqlService.js'\nimport MemoryService from './services/MemoryService.js'\n\n// import hooks (application and business rules), e.g.\nimport UserHooks from './hooks/UserHooks'\n\n//\n// create a instance for your backend\nconst backend = new Alumna();\n\n// create as many services as you want\nbackend.use( 'users', new MysqlService() )\nbackend.use( 'tasks', new MysqlService() )\nbackend.use( 'messages', new MemoryService() )\n\n// apply as many hooks as you want\nbackend.service( 'users' ).hooks( UserHooks )\n\n//\n// start listening for requests\nbackend.listen()\n```\n\n## Service API\n\nYou can implement just the methods you want\n\n```js\nclass ExampleService {\n\t\n\tconstructor() {}\n\n\tasync find () {}\n\n\tasync get( id, params ) {}\n\n\tasync create ( data ) {}\n\n\tasync update( id, data ) {}\n\t\n\tasync patch( id, data ) {}\n\t\n\tasync remove( id ) {}\n\n\tasync setup ( app, path ) {}\n\n}\n\nexport default ExampleService;\n```\n\n## Hook API\n\nHooks are created to apply application or business rules to one or more services (or even the whole application, when its the case)\n\n```js\nimport exampleHook from './hooks/example.js'\nimport anotherHook from './hooks/another.js'\nimport errorHook from './hooks/error.js'\n\nexport default {\n\tbefore: {\n\t\tall: [],\n\t\tfind: [ exampleHook ],\n\t\tget: [ anotherHook, exampleHook ],\n\t\tcreate: [],\n\t\tupdate: [],\n\t\tpatch: [],\n\t\tremove: []\n\t},\n\n\tafter: {\n\t\tall: [],\n\t\tfind: [],\n\t\tget: [],\n\t\tcreate: [],\n\t\tupdate: [],\n\t\tpatch: [],\n\t\tremove: []\n\t},\n\n\terror: {\n\t\tall: [ errorHook ],\n\t\tfind: [],\n\t\tget: [],\n\t\tcreate: [],\n\t\tupdate: [],\n\t\tpatch: [],\n\t\tremove: []\n\t}\n};\n```\n\n## Roadmap\n\n**Site and documentation**\n- [x] Create basic documentation on README\n- [ ] Create website\n- [ ] Create complete documentation on website","readmeFilename":"README.md"}