{"id":19986395,"url":"https://github.com/sourcec0de/nexus","last_synced_at":"2026-06-09T03:05:31.179Z","repository":{"id":11149441,"uuid":"13518023","full_name":"sourcec0de/nexus","owner":"sourcec0de","description":"a realtime app framework built on nodejs","archived":false,"fork":false,"pushed_at":"2013-11-08T06:28:58.000Z","size":144,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-04-15T03:21:06.238Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/sourcec0de.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"License.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-10-12T07:34:02.000Z","updated_at":"2019-04-03T06:11:13.000Z","dependencies_parsed_at":"2022-08-28T15:21:42.085Z","dependency_job_id":null,"html_url":"https://github.com/sourcec0de/nexus","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/sourcec0de%2Fnexus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcec0de%2Fnexus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcec0de%2Fnexus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcec0de%2Fnexus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sourcec0de","download_url":"https://codeload.github.com/sourcec0de/nexus/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241420117,"owners_count":19960032,"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-11-13T04:29:01.035Z","updated_at":"2026-06-09T03:05:31.122Z","avatar_url":"https://github.com/sourcec0de.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NEXUS\n\n- NODE JS\n- EXPRESS JS\n- ANGULAR.JS\n- STACK\n\n- socket.io\n- redis\n- mongodb\n- elasticsearch\n- mysql\n- postgres\n- dynamoDB\n- elasticcache\n\nReactive / Realtime Web Applications have more layers\ntoday than ever before. The stack consists of the following\n\n- RESTful API JSON / XML\n- Server Capable of handling conncurrent connections\n  as well as web sockets\n- Client Side application written in JS to make XmlHttp / CORS req\n- Client also equiped with web socket library.  Socket.io\n- Fast Datastore\n- Fast Search Engine\n\nMost frameworks that are being released do not stick to a common convension and often add a learning curve rather than extending what is already available, and creating a convension over configuration like Ruby on Rails. Rails strong suit was that it was simple to get started and there were only a few ways to do things.\n\nParts of a web framework following MVC\n- Models, define the data structure of your apps resources\n- Views, create templates for HTML rendering\n- Controllers, write logic that will communicate between the view, and the model\n\nModel -\u003e DB\nController -\u003e Model -\u003e Controller -\u003e View -\u003e User\n\nViews for dynamic web pages have typically been rendered by the server with content\npre populated, client side frameworks like Angular.js and Backbone.js have made it simple to make a call to your server and gather partial HTML files to construct a page, reducing the number of page loads required, however increasing the complexity of the front end. This isn't completely nessicary for new applications, but it is useful if you plan on introducing a lot of functionality to make the users expereince feel more like a desktop application.\n\nSo, how do we standardize this for Node.JS?\nPick a convention and stick with it!\n\n- Client Side:     Angular.js\n- Server Side:     Express.js\n- Template Engine: Jade\n- LESS for CSS:    Less\n\nPossible support for coffee-script later. Note* NodeJS is much easier to debug when running compiled JavaScript.\n\n- Standardize API schemas to ensure consistancy.\n  Put configurations in middleware for each route, and define an API structure.\n  This will ensure your API type safety, field consistency, and whitelists values so nothing that isnt supposed to be seen slips through the cracks.\n\nLets build a smart API. What if we could define a spec, and it would take care of all the heavy lifting\n\n- response type / field checking white / black listing\n- request param validations and sanitization\n- developer productivity \u003c3\n\n```javascript\n// API Schema\n{\n  title:\"Nutritionix API\",\n  version:1,\n  baseUri:\"/api/v1\"\n  resources:{\n    items:{\n      uri:\"/items\"\n      // middleware executed on all routes\n      policies:[],\n      endpoints:{\n        \"/\":{\n          method:\"get\",\n          // middleware executed specifically on this route\n          policies:[],\n          // params to be validated, and sanitized to their types\n          params:{\n            // required for type saftey\n            required:{},\n            optional:{\n              offset:{\n                type:Number,\n                dependsOn:\"limit\"\n              },\n              limit:{\n                type:Number,\n                dependsOn:\"offset\"\n              }\n            }\n          },\n          // Attributes \u0026\u0026 type checking\n          // for API respons\n          // can be extended by model\n          responseSchema:{\n            // extendedBy:itemModel\n            id:String,\n            name:String,\n          }\n        },\n        \"/:id\":{\n          method:\"get\",\n          policies:[],\n          params:{\n            // if required\n            required:{\n              upc:{\n                type:Number,\n                or:\"id\"\n              },\n              id:{\n                type:String,\n                or:\"upc\"\n              }\n            },\n            optional:{}\n          }\n        }\n      }\n    }\n  }\n}\n```\n\n\n- API schemas need to be extendable by Models, and it should allow white / black listing\n  of values.\n\n- API schemas also need to include error_handling templates.\n\n- Error Handling: A configuration file should hold a base schema of an error_message, as\n  well as a list of error responses that fit the schema that can be called to avoid duplication. Otherwise you can send a custom error\n  constructor function that will have methods matching the schema, and will validate that those fields were populated.\n\n```javascript\n{\n  // all fields required\n  schema:{\n    code:Number,\n    message:String,\n    more_info_url:String\n  },\n  // Contructor to build new error\n  newError:function(){\n\n  },\n  // Pre Defined Error Responses\n  definitions:{\n    item_not_found:{\n      code: 401,\n      message: \"An item could not be found with the request details\",\n      more_info_url : \"http://developer.nutritionix.com.com/help/errors/item_not_found\",\n      // Optional Debugging Info\n      params:{\n        // object containing query string attrs\n        qs:{},\n        // object containing JSON req body\n        body:{},\n        // object containing info on any uploaded files,\n        files:{}\n      }\n    }\n  }\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsourcec0de%2Fnexus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsourcec0de%2Fnexus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsourcec0de%2Fnexus/lists"}