{"id":14989415,"url":"https://github.com/systangotechnologies/koach-javascript","last_synced_at":"2025-04-12T00:31:45.939Z","repository":{"id":42111233,"uuid":"88360781","full_name":"SystangoTechnologies/koach-javascript","owner":"SystangoTechnologies","description":"Production ready Koa2 boilerplate.","archived":false,"fork":false,"pushed_at":"2022-12-30T17:52:59.000Z","size":2008,"stargazers_count":79,"open_issues_count":14,"forks_count":5,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-25T20:51:13.564Z","etag":null,"topics":["es2017","koa","koa-boilerplate","koa2","koajs","nodejs"],"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/SystangoTechnologies.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":"2017-04-15T16:49:06.000Z","updated_at":"2024-01-26T12:45:29.000Z","dependencies_parsed_at":"2023-01-31T12:30:34.481Z","dependency_job_id":null,"html_url":"https://github.com/SystangoTechnologies/koach-javascript","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SystangoTechnologies%2Fkoach-javascript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SystangoTechnologies%2Fkoach-javascript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SystangoTechnologies%2Fkoach-javascript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SystangoTechnologies%2Fkoach-javascript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SystangoTechnologies","download_url":"https://codeload.github.com/SystangoTechnologies/koach-javascript/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248501322,"owners_count":21114652,"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":["es2017","koa","koa-boilerplate","koa2","koajs","nodejs"],"created_at":"2024-09-24T14:18:19.788Z","updated_at":"2025-04-12T00:31:45.572Z","avatar_url":"https://github.com/SystangoTechnologies.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![KOACH](https://github.com/SystangoTechnologies/Koach/blob/master/static/koach.png)\n\n## KOACH\nProduction ready boilerplate for building APIs with [koa2](https://github.com/koajs/koa/) using mongodb as the database and http/2 as the communication protocol.\n\n## Description\nThis project covers basic necessities of most APIs.\n* Authentication (passport \u0026 jwt)\n* Database (mongoose)\n* Testing (mocha)\n* http/2 support for websites and apis\n* Doc generation with apidoc\n* linting using standard\n* Contains two versions of API\n\nPlease note, if you are planning to use this boilerplate for creating a web application then the 'https' protocol should be used to access its pages.\n\nVisit `https://localhost:3000/` to access the root page.\n\n## Requirements\n* node = v10.15.3\n* MongoDB\n\n## .env Configuration\nTo simulate environment variables in Dev environment, please create .env file at the root location and define the following properties -\n\n```\nNODE_ENV=production                                 // Node environment development/production\nPORT=8000                                           // Server Port\nSESSION=0.0.0.0                                     // secret-boilerplate-token\nJWT_SECRET=This_Should_be_32_characters_long        // Jwt secret\nDATABASE_URL=mongodb://localhost:27017/koach-dev    // Mongo database url\n#DATABASE_URL=mongodb://mongodb:27017/koach-dev     // Mongo database url while using docker\nDB_PATH=/home/ulap28/work/systango-frameworks       // path where database volumen mounted.\n\n## Installation\n```bash\ngit clone https://github.com/SystangoTechnologies/Koach.git\n```\n\n## Features\n* [koa2](https://github.com/koajs/koa)\n* [koa-router](https://github.com/alexmingoia/koa-router)\n* [koa-bodyparser](https://github.com/koajs/bodyparser)\n* [koa-generic-session](https://github.com/koajs/generic-session)\n* [koa-logger](https://github.com/koajs/logger)\n* [koa-helmet](https://github.com/venables/koa-helmet)\n* [koa-convert](https://github.com/koajs/convert)\n* [MongoDB](http://mongodb.org/)\n* [Mongoose](http://mongoosejs.com/)\n* [http/2](https://github.com/molnarg/node-http2)\n* [Passport](http://passportjs.org/)\n* [Nodemon](http://nodemon.io/)\n* [Mocha](https://mochajs.org/)\n* [apidoc](http://apidocjs.com/)\n* [Babel](https://github.com/babel/babel)\n* [ESLint](http://eslint.org/)\n* [PM2](https://github.com/Unitech/pm2/)\n* [Swagger](https://github.com/SystangoTechnologies/swagger-generator-koa/blob/master/README.md)\n\n## Structure\n```\n├── bin\n│   └── server.js            # Bootstrapping and entry point\n├── cert\n│   ├── server.cert          # SSL certificate\n│   └── server.key           # SSL certificate key\n├── config                   # Server configuration settings\n│   ├── env                  # Environment specific config\n│   │   ├── common.js\n│   │   ├── development.js\n│   │   ├── production.js\n│   │   └── test.js\n│   ├── index.js             # Config entrypoint\n│   └── passport.js          # Passportjs config of strategies\n├── src                      # Source code\n│   ├── modules              # Module-specific controllers\n│   │    ├── common          # Contains common modules\n│   │    │   ├─── home              \n│   │    │   └─ index.js\n│   │    ├── v1              # Version 1 of APIs\n│   │    │   ├─ Auth\n│   │    │   ├─ User   \n│   │    │   └─ index.js            \n│   │    └─── v2             # Version 2 of APIs\n│   │         ├─ Auth\n│   │         ├─ User   \n│   │         └─ index.js\n│   ├── models               # Mongoose models\n|   ├── requestModel\n|   |    ├── v1\n|   |    |  ├── auth.js\n|   |    |  └── users.js\n|   |    └── v2\n|   |       ├── auth.js\n|   |       └── users.js\n|   ├── responseModel\n|   |    ├── v1\n|   |    |  ├── auth.js\n|   |    |  └── users.js\n|   |    └── v2\n|   |       ├── auth.js\n|   |       └── users.js\n│   └── middleware           # Custom middleware\n│       └── validators       # Validation middleware\n└── test                     # Unit tests\n└── pm2.config.js            # PM2 configuration file\n└── Dockerfile               # Docker file\n└── docker-compose.yml       # Docker Compose file\n```\n\n\n## Usage\n* `npm start` Start server on development mode with Nodemon\n* `npm run prod` Start server on production mode with PM2\n* `npm run docs` Generate API documentation\n* `npm test` Run mocha tests\n\n## Running the server in Docker Container\n\nPrerequisite For Docker Configuration : Docker and docker compose must be installed on the system.\n\nSteps to run app in docker container :\n  1. CD to project dir\n  2. Create build using cmd: $ docker-compose build\n  3. Start the server in daemon thread using cmd: $ docker-compose up -d \n  4. Stop the server using cmd : $ docker-compose down\n\n## Documentation\nAPI documentation is written inline and generated by [apidoc](http://apidocjs.com/).\n\nVisit [https://localhost:3000/docs/](https://localhost:3000/docs/) to view docs\n\nTo view swagger API documentation\n\nVisit [https://localhost:3000/swagger](https://localhost:3000/swagger) to view Swagger UI.\n\n## Performance Comparison\nThe environment for the test cases are following-\n* Node Version: **8.9.4**\n* Number of Users: **1500**\n* Ramp-up Period: **300 seconds**\n* Loop Count: **100**\n\n![Average](https://raw.githubusercontent.com/SystangoTechnologies/Koach/master/static/Average.png)\n![Throughput](https://github.com/SystangoTechnologies/Koach/raw/master/static/Throughput.png)\n\n## Contributors\n[Arpit Khandelwal](https://github.com/arpit-systango)\n[Anurag Vikram Singh](https://www.linkedin.com/in/anuragvikramsingh/)\n[Vikas Patidar](https://www.linkedin.com/in/vikas-patidar-0106/)\n[Sparsh Pipley](https://www.linkedin.com/in/sparsh-pipley-6ab0b1a4/)\n\n## License\nMIT.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsystangotechnologies%2Fkoach-javascript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsystangotechnologies%2Fkoach-javascript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsystangotechnologies%2Fkoach-javascript/lists"}