{"id":15554158,"url":"https://github.com/tswayne/nexi","last_synced_at":"2026-01-11T02:27:28.659Z","repository":{"id":45912042,"uuid":"262847022","full_name":"tswayne/nexi","owner":"tswayne","description":"Nodejs rails-ish port","archived":false,"fork":false,"pushed_at":"2024-09-21T17:32:43.000Z","size":625,"stargazers_count":0,"open_issues_count":7,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-24T02:35:17.498Z","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/tswayne.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-05-10T18:09:50.000Z","updated_at":"2024-09-21T17:32:47.000Z","dependencies_parsed_at":"2024-08-03T19:41:40.759Z","dependency_job_id":"2a9bde25-182d-4cfa-9c8b-42d6c8d5353e","html_url":"https://github.com/tswayne/nexi","commit_stats":{"total_commits":44,"total_committers":1,"mean_commits":44.0,"dds":0.0,"last_synced_commit":"fab2558c00c2d0ac97e37558e03cf58d1a5b03f4"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tswayne%2Fnexi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tswayne%2Fnexi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tswayne%2Fnexi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tswayne%2Fnexi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tswayne","download_url":"https://codeload.github.com/tswayne/nexi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":231579999,"owners_count":18395374,"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-02T14:50:29.768Z","updated_at":"2026-01-11T02:27:28.653Z","avatar_url":"https://github.com/tswayne.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![npm](https://img.shields.io/npm/v/nexi.svg)](https://www.npmjs.com/package/nexi)\n[![Build Status](https://travis-ci.com/tswayne/nexi.svg?branch=master)](https://travis-ci.com/tswayne/nexi)\n\n# Nexi\n### A rail-ish framework for node.js\n\nThere are a *lot* of node.js frameworks, and even some _inspired_ by ruby on rails, but to my knowledge there is still no\nframework that brings the same conventions and ease of new application development to node.  A saga...\n\n## Documentation\n\nHead to [the wiki](https://github.com/tswayne/nexi/wiki) for full documentation.\n\n## Features\n\nThis is a quick glance at some of the niceties provided by nexi.  For a deep dive into all of the bells and whistles, check out the [docs](https://github.com/tswayne/nexi/wiki)\n\n\n### Mvc\nNexi is a mvc web framework that is designed to provide a foundation for building applications that scale cleanly and easily.\n\n\n#### Controllers\nNexi controllers are fairly simple, and combined with several other conventions provide a very easy means to adding new pages or api endpoints to your application.\n```\n// src/app/controllers/home-controller.js\nconst { BaseController } = require('nexi')\n\nclass HomeController extends BaseController {\n\n  async welcome(req, res) {\n    const user = this.context.models.users.findOne({ id: req.params.id })\n    return res.render('home/welcome',  { user } )\n  }\n}\nmodule.exports = WelcomeController\n```\n\n#### Routing\nModeled after rails routes, the router is simple yet powerful providing one organized space to declare all of your applications routes cleanly.  The router hooks into\nNexi middleware enabling an easy way to configure per route (or a group of routes) pre/post request handlers.  Namespace blocks and inline handlers are also supported.  \n```\n// src/routes.js\nmodule.exports = (context, router) =\u003e {\n  router.get('/welcome/:id', 'homeController#welcome')\n\n  router.get('/secret', 'requireLogin', 'secretController#shh')\n}\n\n```\n\n#### Views\nNexi comes with a templating engine ([handlebars](https://github.com/handlebars-lang/handlebars.js) hooked up out of the box.  For apis, views can be omitted through configuration. Layouts, view helpers, partials, and other common mvc view components are also provided.  \n```\n// src/app/views/home/welcome.js\n\u003cdiv\u003e\n    \u003ch1\u003eWelcome {{user.name}}!\u003c/h1\u003e\n\u003c/div\u003e\n```\n\n#### Models\nNexi also comes with an orm ([waterline](https://github.com/balderdashy/waterline)) as well as a fully featured migrations tool. These can also be disabled through configuration. \n```\n//src/app/models/User.js\nmodule.exports = {\n  identity: 'user',\n  datastore: 'default',\n  attributes: {\n    name: {\n      type: 'string',\n      required: true,\n    },\n  }\n}\n```\n\n#### Context\nInstead of providing Nexi components (such as models or the application configuration) as global variables, Nexi exposes these components through a context (see context design pattern) object injected into and accessible within any Nexi hook (controllers, middleware, decorators, initializers).  This provides simple dependency injection pattern that promotes reusability, testability, and maintainability.   \nYou can also decorate context with anything you'd like to be globally available.  \n```\n//src/decorators/index.js\nmodule.exports = (context) =\u003e {\n  context.elasticSearchClient = new elasticsearch.Client()\n}\n\n...\n\nconst results = await this.context.elasticSearchClient.search(params)\n```\n\n#### But wait, there's more...\n\n* Middleware - Easy to add global pre/post request middleware along with router middleware make it easy to controller the request flow\n  * Built in middleware - Request logging, error responses, global exception handlers, [security](https://github.com/helmetjs/helmet), [compression](https://github.com/expressjs/compression)\n* Built in decorators - models, error reporter, application logger, application configuration\n* Initializers \u0026 bootstrap support - handle startup logic in either `config/boot.js` or group like functionality in initializers\n* Sessions - session store provided out of the box\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftswayne%2Fnexi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftswayne%2Fnexi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftswayne%2Fnexi/lists"}