{"id":29063756,"url":"https://github.com/nodecraft/spawnpoint","last_synced_at":"2025-06-27T09:06:09.749Z","repository":{"id":41293777,"uuid":"41878482","full_name":"nodecraft/spawnpoint","owner":"nodecraft","description":"Agnostic JS framework that empowers devs to focus on quickly building apps, rather than application config, structure, health-checks, or architecture to build a 12 factor app in Docker.","archived":false,"fork":false,"pushed_at":"2025-02-18T00:35:28.000Z","size":2036,"stargazers_count":8,"open_issues_count":3,"forks_count":5,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-06-01T15:47:56.557Z","etag":null,"topics":["hacktoberfest","spawnpoint"],"latest_commit_sha":null,"homepage":"","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/nodecraft.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-09-03T19:06:39.000Z","updated_at":"2024-12-15T15:58:05.000Z","dependencies_parsed_at":"2023-11-15T21:31:20.760Z","dependency_job_id":"cddfdf49-f42b-4618-802e-1c21bc088916","html_url":"https://github.com/nodecraft/spawnpoint","commit_stats":{"total_commits":159,"total_committers":13,"mean_commits":12.23076923076923,"dds":0.7987421383647799,"last_synced_commit":"9c6850a7e38b23439a1492f508164152c774083c"},"previous_names":["nodecraft/appframe.js"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nodecraft/spawnpoint","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodecraft%2Fspawnpoint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodecraft%2Fspawnpoint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodecraft%2Fspawnpoint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodecraft%2Fspawnpoint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nodecraft","download_url":"https://codeload.github.com/nodecraft/spawnpoint/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodecraft%2Fspawnpoint/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262227895,"owners_count":23278264,"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":["hacktoberfest","spawnpoint"],"created_at":"2025-06-27T09:01:55.831Z","updated_at":"2025-06-27T09:06:09.731Z","avatar_url":"https://github.com/nodecraft.png","language":"JavaScript","readme":"![Spawnpoint Logo](https://raw.githubusercontent.com/nodecraft/spawnpoint/master/logo/logo-banner.png)\n[![npm version](https://badge.fury.io/js/spawnpoint.svg)](https://badge.fury.io/js/spawnpoint)\n[![dependencies Status](https://david-dm.org/nodecraft/spawnpoint/status.svg)](https://david-dm.org/nodecraft/spawnpoint)\n[![Build Status](https://github.com/nodecraft/spawnpoint/workflows/Test/badge.svg)](https://github.com/nodecraft/spawnpoint/actions?workflow=Test)\n[![Coverage Status](https://coveralls.io/repos/github/nodecraft/spawnpoint/badge.svg)](https://coveralls.io/github/nodecraft/spawnpoint)\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fnodecraft%2Fspawnpoint.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fnodecraft%2Fspawnpoint?ref=badge_shield)\n\n# Spawnpoint\nAgnostic JS framework that empowers devs to focus on quickly building apps, rather than focusing on application config, health-checks, application structure, or architecture to build a 12 factor app in Docker.\n\n## Quickstart\nThis quick demo shows that you can create a basic API in just a couple files that's defined by configuration, but is 12 factor ready, Docker ready, and much more! [Check out the full demo here](/examples/express).\n\n`npm install spawnpoint --save`\n\n```javascript\n// ~/app.js\nconst spawnpoint = require('spawnpoint');\n\nconst app = new spawnpoint();\napp.setup();\n```\n\n```javascript\n// ~/config/app.json\n{\n\t\"name\": \"Example App\",\n\t\"plugins\": [\n\t\t\"spawnpoint-express\", // this creates an express server\n\t\t\"spawnpoint-redis\"\t// this establishes a connection to a redis server via redisio\n\t],\n\t\"autoload\": [\n\t\t// this autoloads all js files in the ~/controllers folder\n\t\t{\n\t\t\t\"name\": \"Controllers\",\n\t\t\t\"folder\": \"controllers\"\n\t\t}\n\t]\n}\n```\n\n```javascript\n// ~/controllers/app.js\nmodule.exports = (app) =\u003e {\n\t// express is already setup and configured via JSON\n\tapp.server.get('/user/:id', (req, res) =\u003e {\n\t\t// redis is already connected and ready\n\t\tapp.redis.get(`user:${req.params.id}`, (err, results) =\u003e {\n\t\t\tif(err){ res.fail(err); } // automatic error handling\n\n\t\t\t// return JSON formated success with a success code\n\t\t\tres.success('users.list', {\n\t\t\t\tuser: JSON.parse(results)\n\t\t\t});\n\t\t});\n\t});\n};\n```\n\n\n## Plugins\nSpawnpoint plugins create opinionated \u0026 re-usable components that reduce the code needed to kickstart projects. Plugins are configured via JSON config files, making them easier to share between projects with different needs.\n\n - [Express](https://github.com/nodecraft/spawnpoint-express) - [Express](https://expressjs.com/): web server\n - [Redis](https://github.com/nodecraft/spawnpoint-redis) - [Redis](https://redis.io/): Key/value database/store\n - [RethinkDB](https://github.com/nodecraft/spawnpoint-rethinkdb) - [RethinkDB](https://rethinkdb.com/): - NoSQL document database\n - [NATS](https://github.com/nodecraft/spawnpoint-nats) - [Nats.io](https://nats.io/): Pub/Sub Message Queue\n\n\n### Another JS Framework? Why?\nWe constantly found our dev team rebuilding the same components to our micro services that make up the [Multiplayer Gaming Cloud platform at Nodecraft](https://nodecraft.com). Most of the features had blatant copy/paste to ensure our applications could:\n\n - Building [12 factor apps](https://12factor.net/)\n - Auto-loading multiple folders for product folder structure\n - File `require()` recursion management overhead [?](#Hoisting%20app)\n - Support basic `--command=\"args\"` that override config files\n - ENV variables that override config files\n - Docker Secrets that override config files\n - Dev config overrides\n - Rebuilding a basic JSON REST API via express\n - Database connect/reconnect management\n - Healthchecks\n - Application lifecycle\n   - Tracks app startup\n   - Graceful shutdown\n - Making a Docker friendly NodeJS app\n\n### Hoisting app\nThe most opinionated design choice that Spawnpoint makes is hoisting the entire framework runtime into each file. You can name this variable anything, but the best practice is to name this variable `app`. All system models, libraries, and config are hoisted to this variable with several namespaces:\n\n###### `app.config`\nAll application config is mounted here. For example `app.config.express` is where all configuration is available to the [spawnpoint-express](https://github.com/nodecraft/spawnpoint-express) plugin.\n\n###### `app.status`\nTracks the current application lifecycle.\n\n###### `app.containerized`\nDetects if app is running in a container.\n\n###### `app.cwd`\nReturns the main folder where your application lives.\n\n#### Hoisting your own Libraries\nWhen you hoist your library on the `app` variable you can access it on any other autoloaded js file.\n```javascript\nmodule.exports = (app) =\u003e {\n\tapp.yourLibName = {\n\t\tadd(a, b){\n\t\t\treturn a + b;\n\t\t}\n\t};\n}\n```\n```javascript\napp.server.post('/add', (req, res) =\u003e {\n\t// redis is already connected and ready\n\tlet results = app.yourLibName.add(req.body.a, req.body.b);\n\tres.success('math.add', {\n\t\tresults: results\n\t});\n});\n\n```\n\n\n### Framework Examples\n - [ExpressJS: using spawnpoint autoloading](examples/framework-express) - Using Spawnpoint autoloading and plugins to create a HTTP server.\n - [ExpressJS: unframework](examples/framework-express) - Using Spawnpoint core methods to build a basic HTTP server, without the automatic framework.\n - __More coming soon__\n\n### Documentation\nGet the [full API Docs here](docs.md).\n\n## License\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fnodecraft%2Fspawnpoint.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fnodecraft%2Fspawnpoint?ref=badge_large)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnodecraft%2Fspawnpoint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnodecraft%2Fspawnpoint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnodecraft%2Fspawnpoint/lists"}