{"id":15207114,"url":"https://github.com/trufa-me/node-es6-api-framework","last_synced_at":"2025-10-02T23:35:42.604Z","repository":{"id":96349724,"uuid":"89487155","full_name":"Trufa-me/Node-ES6-API-Framework","owner":"Trufa-me","description":"Node ES6 API Framework","archived":true,"fork":false,"pushed_at":"2018-06-09T08:30:22.000Z","size":263,"stargazers_count":4,"open_issues_count":2,"forks_count":0,"subscribers_count":7,"default_branch":"release/continuous","last_synced_at":"2024-09-29T06:22:03.859Z","etag":null,"topics":["api","api-framework","babel","babeljs","boilerplate","boilerplate-api","coverage-report","docker","es6-javascript","express","husky","nodejs","nodemon","nvm","prettier","yarn"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Trufa-me.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2017-04-26T13:58:06.000Z","updated_at":"2023-01-28T10:32:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"d448de5c-c78e-41a4-8840-d00ca889132b","html_url":"https://github.com/Trufa-me/Node-ES6-API-Framework","commit_stats":{"total_commits":45,"total_committers":7,"mean_commits":6.428571428571429,"dds":0.4,"last_synced_commit":"df8db770e01c42695ef4f330a8493ab8de49c3f1"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Trufa-me%2FNode-ES6-API-Framework","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Trufa-me%2FNode-ES6-API-Framework/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Trufa-me%2FNode-ES6-API-Framework/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Trufa-me%2FNode-ES6-API-Framework/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Trufa-me","download_url":"https://codeload.github.com/Trufa-me/Node-ES6-API-Framework/tar.gz/refs/heads/release/continuous","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235051584,"owners_count":18928185,"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":["api","api-framework","babel","babeljs","boilerplate","boilerplate-api","coverage-report","docker","es6-javascript","express","husky","nodejs","nodemon","nvm","prettier","yarn"],"created_at":"2024-09-28T06:22:04.963Z","updated_at":"2025-10-02T23:35:42.234Z","avatar_url":"https://github.com/Trufa-me.png","language":"JavaScript","readme":"# Boilerplate API\n\nThis boilerplate is responsible for being the base from which to start creating an API.\n\nThis project is using babel to transpile back to ES5 on server! YAY! For performance reasons it is advisable not to run babel-node in production.\nIts is therefore extremely important to pre-compile the project and run the compiled version instead. This is what the command npm run build\nis used for.\n\nWays to run the app are outlined later in this readme file.\n\nCurrent endpoints:\n\nPOST /v1/someapi/example\nPOST /v1/someapi/example\n\n### Version\n1.0.0\n\n### Tech\n\nThis API uses a number of open source projects to work properly:\n\n* [babeljs] - Use next generation JavaScript, today! Transforms code back to ES5!\n* [docker] - Ensure environment is configured the same anywhere it is deployed.\n* [node.js] - evented I/O for the backend\n* [Express] - fast node.js network app framework [@tjholowaychuk]\n\nAnd of course this boilerplate can be seen here [public repository][git-repo-url]\n on Stash.\n\n### Installation\n\nBoilerplate API requires [Node.js](https://nodejs.org/) v6+ to run.\n\nOpen your favorite Terminal and run these commands.\n\n```sh\n$ git git@github.com:Trufa-me/Node-ES6-API-Framework.git\n$ cd Node-ES6-API-Framework\n```\n\nYou can move confg/example_default.js to more convenient place e.g.  /etc/jobsite/Node-ES6-API-Framework/default.json and point confg/example_default.js symlink to a new target.\n\nIn your terminal, run the following as below:\n\n```sh\n$ ln -s /etc/jobsite/Node-ES6-API-Framework/default.json config/default.json\n```\n\n### Start application for Development\n\nOpen your favorite Terminal and run these commands.\n\n\nIn development project relies on nvm as well as yarn so install those:\n\nInstall nvm:\n```sh\nwget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash\nnvm install v8.9.0\n\n```\n\nInstall yarn:\n```sh\n$ npm install -g yarn\n```\n\nRun the following:\n\n```sh\n$ ./bin/start.sh\n```\n\nThis command should start api in development mode with [nodemon] and restart api every time you save a file.\n\n### Production - this is for running production locally (Docker handles building the compiled version)\n\nOpen your favorite Terminal and run these commands.\n\nRun the following:\n\n```sh\n$ ./bin/start.sh build\n$ ./bin/start.sh start:prod\n```\n\nYou should get below output:\n```[developer@myMachine Node-ES6-API-Framework]$ ./bin/start.sh\nFound '/home/developer/projects/Node-ES6-API-Framework/.nvmrc' with version \u003cv6.10.0\u003e\nNow using node v6.10.0 (npm v4.1.2)\nyarn install v0.20.3\nwarning boilerplate-api@1.1.0: \"dependencies\" has dependency \"nodemon\" with range \"^1.11.0\" that collides with a dependency in \"devDependencies\" of the same name with version \"^1.9.0\"\n[1/4] Resolving packages...\nsuccess Already up-to-date.\nDone in 0.64s.\n\n\u003e boilerplate-api@1.1.0 start:dev /home/developer/projects/Node-ES6-API-Framework\n\u003e cross-env NODE_ENV=development ./node_modules/nodemon/bin/nodemon.js nodemon\n\n[nodemon] 1.11.0\n[nodemon] to restart at any time, enter `rs`\n[nodemon] watching: /home/developer/projects/Node-ES6-API-Framework/src/**/*\n[nodemon] starting `npm run babel-node -- src/index.js nodemon`\n\n\u003e boilerplate-api@1.1.0 babel-node /home/developer/projects/Node-ES6-API-Framework\n\u003e babel-node --ignore node_modules,tests \"src/index.js\" \"nodemon\"\n\nFront-End server is running at http://localhost:40001\nTry me: http://localhost:40001/v1/someapi/promise\n```\n\n### Tests\n\nOpen your favorite Terminal and run these commands.\n\nRun the following:\n\n```sh\n$ ./bin/start.sh test\n```\n\nOutput:\n```[developer@myMachine Node-ES6-API-Framework]$ ./bin/start.sh test\n\n\u003e boilerplate-api@1.1.0 test /home/developer/projects/Node-ES6-API-Framework\n\u003e mocha --recursive ./tests/ --compilers js:babel-core/register\n\n\n\n  boilerplate api configuration\n    ✓ should contain all the correct configuration options\n\n\n  1 passing (58ms)\n\n[developer@myMachine Node-ES6-API-Framework]$\n```\n\n### Generate test coverage report\n\nRun the following:\n\n```sh\n$ ./bin/start.sh test:coverage\n```\n\nOutput:\n```[developer@myMachine Node-ES6-API-Framework]$ ./bin/start.sh test:coverage\n\n\u003e boilerplate-api@1.1.0 test:coverage /home/developer/projects/Node-ES6-API-Framework\n\u003e nyc --reporter=lcov --reporter=text ./node_modules/.bin/mocha --recursive --require babel-register ./tests/\n\n\n\n  boilerplate api configuration\n    ✓ should contain all the correct configuration options\n\n\n  1 passing (11ms)\n\n----------|----------|----------|----------|----------|----------------|\nFile      |  % Stmts | % Branch |  % Funcs |  % Lines |Uncovered Lines |\n----------|----------|----------|----------|----------|----------------|\nAll files |  Unknown |  Unknown |  Unknown |  Unknown |                |\n----------|----------|----------|----------|----------|----------------|\n[developer@myMachine Node-ES6-API-Framework]$\n```\n\nViewing the coverage report:\n\nOpen explorer and navigate to your project dir and open coverage/lcov-report/index.html\n\n### Docker\nAPI Framework is very easy to install and deploy as a Docker container.\n\n```sh\ncd boiler-plate-api\ndocker build .\n```\n\nThis will create the Boilerplate API image and pull in the necessary dependencies. Once done, run the Docker and map the port to whatever you wish on your host 40001 in this case:\n\n```sh\ndocker run -d -t -p 40001:40001  --name boiler_plate_api --restart=always boiler_plate_api\n```\n\nVerify the deployment by navigating to your server address in your preferred browser.\n\ne.g http://localhost:40001/v1/someapi/example\n\n[//]: # (These are reference links used in the body of this note and get stripped out when the markdown processor does its job. There is no need to format nicely because it shouldn't be seen. Thanks SO - http://stackoverflow.com/questions/4823468/store-comments-in-markdown-syntax)\n\n\n   [babeljs]: \u003chttps://babeljs.io/\u003e\n   [docker]: \u003chttps://www.docker.com/\u003e\n   [git-repo-url]: \u003chttps://github.com/Trufa-me/Node-ES6-API-Framework\u003e\n   [git-clone-url]: \u003cgit@github.com:Trufa-me/Node-ES6-API-Framework.git\u003e\n   [node.js]: \u003chttp://nodejs.org\u003e\n   [express]: \u003chttp://expressjs.com\u003e\n   [nodemon]: \u003chttps://github.com/remy/nodemon/blob/master/README.md\u003e\n\n\n## Node.JS Debugging\n\n### Local debugging\nFirst you need to run process that will be continuously transpile your code:\n\n ```sh\n$ npm run compile\n```\n\nWith transpile running you can use Visual Studio Code -\u003e Debugging\n\nAnd run **Launch App.js** launch settings.\n\n### Remote debugging\n1) Run process that will be continuous transpile your code:\n\n ```sh\n$ npm run compile\n```\n\n 2) Start application in debug mode listening on a desired:\n\n ```sh\nnode_modules/nodemon/bin/nodemon.js --config nodemon-debug.json\n```\n\n3) Having both commands running on remote machine\nVisual Studio Code -\u003e Debugging\n\nMake sure **host** and **remoteRoot** are pointing to correct locations.\n\nAnd run **Launch Remote Ap** launch settings.\n\nUnfortunately in this mode breakpoints cannot be set correctly from VSCode and instead you need to add:\n``` javascript\ndebugger;\n```\n\nIn place where you want debugger to stop. From there you can step over as usual in any IDE having preview on any local variables and references.\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrufa-me%2Fnode-es6-api-framework","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrufa-me%2Fnode-es6-api-framework","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrufa-me%2Fnode-es6-api-framework/lists"}