{"id":13394668,"url":"https://github.com/keithwhor/nodal","last_synced_at":"2025-05-14T03:11:28.810Z","repository":{"id":30640659,"uuid":"34196200","full_name":"keithwhor/nodal","owner":"keithwhor","description":"API Services Made Easy With Node.js","archived":false,"fork":false,"pushed_at":"2023-01-16T02:03:22.000Z","size":1479,"stargazers_count":4506,"open_issues_count":38,"forks_count":208,"subscribers_count":106,"default_branch":"master","last_synced_at":"2025-04-10T22:35:18.237Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://www.nodaljs.com/","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/keithwhor.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-04-19T06:34:05.000Z","updated_at":"2025-04-01T10:37:22.000Z","dependencies_parsed_at":"2023-01-14T17:31:03.885Z","dependency_job_id":null,"html_url":"https://github.com/keithwhor/nodal","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keithwhor%2Fnodal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keithwhor%2Fnodal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keithwhor%2Fnodal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keithwhor%2Fnodal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/keithwhor","download_url":"https://codeload.github.com/keithwhor/nodal/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253923991,"owners_count":21985020,"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-07-30T17:01:27.662Z","updated_at":"2025-05-14T03:11:23.801Z","avatar_url":"https://github.com/keithwhor.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","📦 Legacy \u0026 Inactive Projects"],"sub_categories":[],"readme":"# Nodal\n## API Services Made Easy with Node.js\n\n[![Build Status](https://travis-ci.org/keithwhor/nodal.svg?branch=master)](https://travis-ci.org/keithwhor/nodal) [![Join the chat at https://gitter.im/keithwhor/nodal](https://badges.gitter.im/keithwhor/nodal.svg)](https://gitter.im/keithwhor/nodal?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\n![Nodal Logo](./nodal.png)\n\nView the website at [nodaljs.com](http://nodaljs.com).\n\nNodal is a web server and opinionated framework for building\ndata manipulation-centric (Create Read Update Destroy) API services in Node.js for\nweb, mobile or IoT apps.\n\n## Why Nodal?\n\n[Hello, Nodal — Building Node.js Servers for Everybody](https://medium.com/@keithwhor/hello-nodal-why-we-re-building-node-js-servers-for-everybody-dce14b27a233)\nis our first blog post that helps you get acquainted with the reasons behind\nthe creation of the framework. :)\n\n[Post Parse Prototyping](https://thoughts.ishuman.co/post-parse-prototyping-72b8570af416) is also a fantastic\nread explaining the benefits of Nodal for quick and easy mobile / IoT backend development.\n\n## Overview\n\nNodal is built upon an ideology of a robust, scalable architecture for\ndata storage and retrieval APIs.\nIt is an opinionated, explicit, idiomatic and highly-extensible full-service\nframework that takes care of all of the hard decisions for you and your team.\nThis allows you to focus on creating an effective product in a\nshort timespan while minimizing technical debt.\n\nNodal servers are not meant to be monoliths. They're *stateless* and *distributed*,\nmeant to service your needs of interfacing with your data layer effortlessly.\nWhile you can output any data format with Nodal, it's recommended you offload\nthings like static page rendering to other optimized services like CDNs.\n\n[Check out the first Nodal Screencast here.](https://www.youtube.com/embed/IxBXkFbUqtk)\n\n## Stateless Dogma\n\nIt's important to note that Nodal is meant for **stateless** API services. This\nmeans you should not rely on memory within a specific process to serve multiple\nrequests, and Nodal will use process clustering (even in development) to actively\ndiscourage this practice. If you need to work with unstructured data for rapid\nprototyping, *connect Nodal to a PostgreSQL database* and use the \"JSON\" field\ntype. You'll find yourself encountering a lot of trouble if you start trying to\nuse in-process memory across different requests.\n\nRemember: **one input, one output**. Side effects dealing with model state\nshould be managed via your Database. Nodal should not be used for streaming\n(long poll) requests and the HTTP request and response objects are intentionally\nobfuscated.\n\nThis also means you *can not rely on socket connections*. If you need to\nincorporate realtime functionality in your application, there should be a\nseparate server responsible for this. It can interface with your Nodal API\nserver and even receive events from it, but your API server should never have\na stateful (prolonged) connection with any client.\n\n## Getting Started\n\nGetting started with Nodal is easy.\n\n1. Download and install the newest Node 6.x version from [nodejs.org](https://nodejs.org)\n2. Open terminal, and type `npm install nodal -g`.\n(If you get an error, run `sudo npm install nodal -g` or fix permissions permanently by\n  [following these directions](https://docs.npmjs.com/getting-started/fixing-npm-permissions)\n3. Using your terminal, visit your projects folder. Perhaps with `cd ~`.\n4. Run `nodal new`.\n5. Follow the on screen instructions, enter your new project directory and type `nodal s`.\n\nThat's it! Your Nodal webserver is up and running.\n\n## Hooking Up Your Database\n\nOnce Nodal is up and running, it's likely that you'll want to connect your project\nto a database. Nodal comes packaged with Migrations, a Query Composer and full\nPostgreSQL integration.\n\nFirst you'll need to install PostgreSQL. OS X users, I recommend using\n[Postgres.app](http://postgresapp.com/) for your development environment.\n\nOnce you've installed Postgres, make sure to run:\n\n```\n$ createuser postgres -s\n```\n\nTo create a default postgres superuser with no password. (Default for Nodal's\nconfiguration.)\n\nTo begin using your database, start with:\n\n```\n$ nodal db:create\n```\n\nTo create the database and then,\n\n```\n$ nodal db:prepare\n```\n\nTo prepare for migrations.\n\nFrom here, `nodal db:migrate` runs all pending migrations and `nodal db:rollback`\nwill roll back migrations, one at a time by default.\n\n## Server Types\n\nNodal works best when you follow its ideology, and that means creating a new\nservice to solve specific *Problem Domains* of your application and business.\n\nThe main three suggestions are **Branding Server**, **API Server** and **Application Server**.\n\nNodal's core competency is building API servers. We do, however, also have a\nproject called\n[dotcom](http://github.com/keithwhor/dotcom) for building Branding Servers\n(search engine optimized server-generated pages). More on this soon.\n\n### API Server\n\nCreate an API server using Nodal's Models, PostgreSQL integration, built-in JSON\nAPI formatting, and Query Composer (ORM). Bi-directional migrations are packaged\nwith Nodal, meaning you can maintain the integrity of your data.\nUser (including password) and OAuth AccessToken models and controllers are\npre-built for you and can be added easily to your project.\n\nPackaged with Nodal are workers, scheduling modules, and much more for all of\nyour data needs.\n\nWe can look at what an API Controller might look like for, say, blog posts:\n\n```javascript\nclass BlogPostsController extends Nodal.Controller {\n\n  index() {\n\n    BlogPost.query()\n      .join('user')\n      .join('comments')\n      .where(this.params.query)\n      .end((err, blogPosts) =\u003e {\n\n        this.respond(err || blogPosts);\n\n      });\n\n  }\n\n  show() {\n\n    BlogPost.find(this.params.route.id, (err, blogPost) =\u003e this.respond(err || blogPost));\n\n  }\n\n  create() {\n\n    BlogPost.create(params.body, (err, blogPost) =\u003e this.respond(err || blogPost));\n\n  }\n\n  update() {\n\n    BlogPost.update(this.params.route.id, params.body, (err, blogPost) =\u003e this.respond(err || blogPost));\n\n  }\n\n  destroy() {\n\n    BlogPost.destroy(this.params.route.id, (err, blogPost) =\u003e this.respond(err || blogPost));\n\n  }\n\n}\n```\n\n## Beginner's Guide\n\nYou'll be able to learn more about Nodal at [nodaljs.com](http://nodaljs.com).\n\n## Documentation\n\nCheck out the website at [nodaljs.com](http://nodaljs.com).\n\n## Roadmap\n\nView the roadmap at [ROADMAP.md](./ROADMAP.md).\n\n## About\n\nNodal is under active development and maintained by\n[Keith Horwood](http://keithwhor.com).\n\n**Contributors welcome!**\n\nFollow me on Twitter, [@keithwhor](http://twitter.com/keithwhor)\n\nFork me on GitHub, [keithwhor](http://github.com/keithwhor)\n\nThanks for checking out Nodal!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeithwhor%2Fnodal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkeithwhor%2Fnodal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeithwhor%2Fnodal/lists"}