{"id":18927531,"url":"https://github.com/jakemmarsh/expressed-boilerplate","last_synced_at":"2025-04-15T13:33:56.221Z","repository":{"id":36433566,"uuid":"40738574","full_name":"jakemmarsh/expressed-boilerplate","owner":"jakemmarsh","description":"A boilerplate for quickly building APIs on node.js and Express.","archived":false,"fork":false,"pushed_at":"2017-01-05T20:11:18.000Z","size":353,"stargazers_count":59,"open_issues_count":1,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-28T22:11:21.999Z","etag":null,"topics":[],"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/jakemmarsh.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-08-14T22:31:19.000Z","updated_at":"2022-04-16T19:08:33.000Z","dependencies_parsed_at":"2022-09-03T10:51:49.247Z","dependency_job_id":null,"html_url":"https://github.com/jakemmarsh/expressed-boilerplate","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/jakemmarsh%2Fexpressed-boilerplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakemmarsh%2Fexpressed-boilerplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakemmarsh%2Fexpressed-boilerplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakemmarsh%2Fexpressed-boilerplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jakemmarsh","download_url":"https://codeload.github.com/jakemmarsh/expressed-boilerplate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249080614,"owners_count":21209548,"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-08T11:19:26.931Z","updated_at":"2025-04-15T13:33:55.878Z","avatar_url":"https://github.com/jakemmarsh.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# expressed\n\n[![Build Status](https://travis-ci.org/jakemmarsh/expressed-boilerplate.svg)](https://travis-ci.org/jakemmarsh/expressed-boilerplate) [![Dependency Status](https://david-dm.org/jakemmarsh/expressed-boilerplate.svg)](https://david-dm.org/jakemmarsh/expressed-boilerplate) [![devDependency Status](https://david-dm.org/jakemmarsh/expressed-boilerplate/dev-status.svg)](https://david-dm.org/jakemmarsh/expressed-boilerplate#info=devDependencies)\n\nA boilerplate for quickly building an API on [node.js](https://nodejs.org/) and [Express](http://expressjs.com/). Includes:\n\n- Authentication via [Passport](http://passportjs.org/)\n- Automated testing framework with code coverage results\n- Automated documentation\n\n---\n\n### Getting up and running\n\n1. Clone this repo from `https://github.com/jakemmarsh/expressed-boilerplate.git`\n2. Run `npm install` from the root directory\n3. Run `npm start`\n\nYour API will now be served to `localhost:3000` by default.\n\n**Note:** While developing, `npm run dev` can be used in place of `npm start` to use Supervisor, allowing your server to automatically restart any time a file is changed.\n\n---\n\n### Sample .env file\n\nAPI credentials, secret keys, etc. should all be stored in `process.env.*`. This boilerplate achieves this through the use of a `.env` file along with the [dotenv](https://github.com/bkeepers/dotenv) library. The file is gitignored to avoid checking any credentials into source control. This boilerplate currently only uses one environment variable, and so the `.env` file looks like this:\n\n```\n\nSECRET='abcefgqwerty123'\n\n```\n\n---\n\n### API Architecture\n\n\n```\n/api              (Contains all files relevant to the API and database logic)\n  /controllers    (Contains all route controllers, separated by entity type)\n    auth.js       (Methods related to user authentication)\n    user.js\n    index.js      (Exports all controllers to be required in the API)\n  /models         (Will contain all database models/schema definitions)\n  /utils          (Contains miscellaneous files used within the API)\n    passport.js   (Initializes Passport authentication)\n  index.js        (Associates endpoints with route controllers)\n/__tests__        (Contains tests for the API, organized in the same structure as the /api directory)\n  helper.js       (Runs before any of the tests, defining test libraries and starting the server)\n/__coverage__     (gitignored, but contains HTML coverage results automatically generated by running the tests)\n/docs             (Contains the auto-generated documentation)\nserver.js         (The Express server which loads and serves the API)\n```\n\n**Note:** none of the authorization or database logic has been provided. Any places in which code has been omitted or stubbed are marked with `TODO` comments.\n\n---\n\n### Tests and Coverage\n\nAll tests are contained within the `/__tests__` directory, arranged in the same structure as the `/api` directory. The `helper.js` file automatically loads the testing libraries [sinon.js](http://sinonjs.org/) and [should.js](https://shouldjs.github.io/), making them available on the global scope for any of your tests. It also loads and starts the server before running your tests.\n\nTests are written and run using [mocha](https://mochajs.org/). Code coverage is automatically calculated using [Istanbul](https://github.com/gotwarlost/istanbul), which also generates HTML results pages in the `/__coverage__` directory.\n\n**To run your tests, use the command `npm test`.**\n\n![Image of generated code coverage results](https://raw.githubusercontent.com/jakemmarsh/expressed-boilerplate/master/coverage.png)\n\n---\n\n### Auto-Documentation\n\nDocumentation can be auto-generated for your API using [apiDoc](http://apidocjs.com/) if you annotate your controller methods in the correct format. The format and other options can be seen in the apiDocs documentation.\n\n**To generate your docs, use the command `npm run gen-docs`.**\n\n![Image of generated documentation](https://raw.githubusercontent.com/jakemmarsh/expressed-boilerplate/master/docs.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjakemmarsh%2Fexpressed-boilerplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjakemmarsh%2Fexpressed-boilerplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjakemmarsh%2Fexpressed-boilerplate/lists"}