{"id":22547491,"url":"https://github.com/firmanjs/knex-express-for-backend-team","last_synced_at":"2026-03-09T10:33:41.034Z","repository":{"id":64032386,"uuid":"496082445","full_name":"firmanJS/knex-express-for-backend-team","owner":"firmanJS","description":null,"archived":false,"fork":false,"pushed_at":"2024-05-03T00:18:15.000Z","size":801,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-08T11:52:05.307Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/firmanJS.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":"2022-05-25T04:32:22.000Z","updated_at":"2023-05-25T04:46:03.000Z","dependencies_parsed_at":"2023-12-05T01:41:59.089Z","dependency_job_id":"baf65e79-400f-4c0b-b517-2a0cc472da33","html_url":"https://github.com/firmanJS/knex-express-for-backend-team","commit_stats":null,"previous_names":[],"tags_count":4,"template":true,"template_full_name":null,"purl":"pkg:github/firmanJS/knex-express-for-backend-team","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firmanJS%2Fknex-express-for-backend-team","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firmanJS%2Fknex-express-for-backend-team/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firmanJS%2Fknex-express-for-backend-team/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firmanJS%2Fknex-express-for-backend-team/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/firmanJS","download_url":"https://codeload.github.com/firmanJS/knex-express-for-backend-team/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firmanJS%2Fknex-express-for-backend-team/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30291807,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-09T02:57:19.223Z","status":"ssl_error","status_checked_at":"2026-03-09T02:56:26.373Z","response_time":61,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-12-07T15:12:02.540Z","updated_at":"2026-03-09T10:33:40.958Z","avatar_url":"https://github.com/firmanJS.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Knex Express API\n\n[![Maintainability](https://api.codeclimate.com/v1/badges/cf5d695145d250eb622a/maintainability)](https://codeclimate.com/github/firmanJS/knex-express-for-backend-team/maintainability)\n[![Test Coverage](https://api.codeclimate.com/v1/badges/cf5d695145d250eb622a/test_coverage)](https://codeclimate.com/github/firmanJS/knex-express-for-backend-team/test_coverage)\n[![Node.js CI](https://github.com/firmanJS/knex-express-for-backend-team/actions/workflows/nodejs.yml/badge.svg?branch=main)](https://github.com/firmanJS/knex-express-for-backend-team/actions/workflows/nodejs.yml)\n[![made-with-nodejs](https://img.shields.io/badge/Made%20with-Nodejs-1f425f.svg)](https://nodejs.org)\n[![made-with-expressjs](https://img.shields.io/badge/Made%20with-Expressjs-1f425f.svg)](https://expressjs.com/)\n[![Ask Me Anything !](https://img.shields.io/badge/Ask%20me-anything-1abc9c.svg)](https://github.com/firmanJS)\n[![GitHub license](https://img.shields.io/github/license/Naereen/StrapDown.js.svg)](https://github.com/firmanJS/knex-express-for-backend-team/blob/master/LICENSE)\n[![GitHub release](https://img.shields.io/github/release/firmanjs/knex-express-for-backend-team.svg)](https://github.com/firmanJS/knex-express-for-backend-team/releases)\n[![Github all releases](https://img.shields.io/github/downloads/firmanjs/knex-express-for-backend-team/total.svg)](https://github.com/firmanJS/knex-express-for-backend-team/releases)\n[![GitHub issues](https://img.shields.io/github/issues/firmanjs/knex-express-for-backend-team.svg)](https://gitHub.com/firmanJS/knex-express-for-backend-team/issues/)\n[![GitHub pull-requests](https://img.shields.io/github/issues-pr/firmanjs/knex-express-for-backend-team.svg)](https://gitHub.com/firmanjs/knex-express-for-backend-team/pulls/)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)\n\n## Getting started\n\n- **Clone This Repository Using HTTPS**\n\n```bash\ngit clone https://github.com/firmanJS/knex-express-for-backend-team.git\ncd existing_repo\n```\n\n### Run Application\n\nrunning application three methods manually, using docker or via Makefile\n\n- Manually :\n\n```bash\n# Copy enviroment variables from .env.sample to .env\ncp .env.sample .env\n\n# Copy Makefile sesuai environment\ncp Makefile.sample Makefile\n\n# Install package via npm or yarn\nnpm install\n\n# Run application via npm or yarn\nnpm run dev\n\n# Run migration or create migration file\nnpm i -g knex\n\n# Create migration\nknex migrate:make create_users_table --cwd=src\n\n# Run migration\nknex migrate:latest --cwd=src\n\n# Create Seed\nknex seed:make users_seed --cwd=src\n\n# Run Seed\nknex seed:run --cwd=src\n```\n\n- Via Docker :\n\n```bash\n# Copy enviroment variables from .env.sample to .env\ncp .env.sample .env\n\n# Copy Makefile sesuai environment\ncp Makefile.sample Makefile\n\n# Build application\ndocker-compose -f docker-compose-dev.yml up --build --remove-orphans --force-recreate\n\n# Stop aplication\nCTRL+C\n# then\ndocker-compose -f docker-compose-dev.yml down\n\n# After build you can run command with this\ndocker-compose -f docker-compose-dev.yml up\n# Or you can hide log with command\ndocker-compose -f docker-compose-dev.yml up -d\n\n# Create migration in docker container\ndocker-compose -f docker-compose-dev.yml exec knex-express-template knex migrate:make create_core_users_table --cwd=src\n\n# Run migration in docker container\ndocker-compose -f docker-compose-dev.yml exec knex-express-template knex migrate:latest --cwd=src\n\n# Create Seed in docker container\ndocker-compose -f docker-compose-dev.yml exec knex-express-template knex seed:make seed_users --cwd=src\n\n# Run Seed in docker container\ndocker-compose -f docker-compose-dev.yml exec knex-express-template knex seed:run --cwd=src\n```\n\n- Via Make :\n\n```bash\n# Copy enviroment variables from .env.sample to .env\ncp .env.sample .env\n\n# Copy Makefile sesuai environment\ncp Makefile.sample Makefile\n\n# Build application\nmake docker-build\n\n# Stop aplication\nCTRL+C\n# then\nmake docker-down\n\n# After build you can run command with this\nmake docker-start\n```\n\n### Start Code\n\n## Project Structure\n\n```\n├── coverage/           * all output coverage\n├── docker/             * all dockerfile\n├── src/                * all source code in here\n  └── config/           * all configuration file here\n  |  └── database.js    * configuration database\n  └── modules/          * all file modules in here\n  |   └── index.js      * register all modules here\n  └── lang/             * setup language\n  |   └── index.js      * register all language here\n  └── middlewares/      * all middleware file here, for check before next to api\n  └── repository/       * all file repository for single db or multiple db\n  |   └── monggo        * register all monggo\n  |   └── mysql         * register all mysql\n  |       └── migrations * all migrations file\n  |       └── seeders    * all seeders file\n  |   └── postgresql    * register all postgresql\n  |       └── migrations * all migrations file\n  |       └── seeders    * all seeders file\n  └── routes/           * all file route here\n  |   └── index.js      * register all route\n  └── __test__/         * all test case file here\n  |   └── index.js      * test apps\n  └── utils/            * all utils file here\n```\n\n### 1. Coverage\n\nDirectory `coverage` acts as `coverage code score` this directory automatic generated by `jest`.\n\n### 2. Docker\n\nDirectory `docker` acts as `container setup` this directory is used to setup docker container for local development and production.\n\n### 3. **Test**\n\nThis directory has all test case file unit test or integraion test and measurement coverage.\n\n### 4. Config\n\nThis directory is for create all config like a database, monitoring, aws, gcp, elasticsearch, etc.\n\n### 5, Handlers\n\nThis directory for handlers all business logic like a controllers in MVC pattern.\n\n### 6. Lang\n\nThis directory for set language for all message in api set to ['en', 'id', 'jp'].\n\n### 7. Middlewares\n\nThis directory for all middlewares before access to api/bussines logic.\n\n### 8. Repository\n\nThis directory for handle all use case for database, transaction and file seed or migrations register here.\n\n### 9. Routes\n\nThis directory for register all route api.\n\n### 10. Utils\n\nThis directory for all utils function.\n\n## Code Style Guides\n\n- Guideline:\n  - Use camelCase for variable name, naming function, load module or other functions\n  - Use UpperCase for Constant Variable\n  - Use PascalCase for class name, models\n  - Use snake_case for file name\n  - Function name use Verb\n  - Variable name use Noun\n\n## Benchmark\n\nthis benchmark is used to measure the performance of your application using apache bench [https://httpd.apache.org/docs/2.4/programs/ab.html](https://httpd.apache.org/docs/2.4/programs/ab.html).\n\n```bash\n# -c concurency -n number of requests -t time to run\nab -k -c 20 -n 250 \"http://localhost:2000/\"\n\n#result becnhmark with 50 user and 1000 request\nBenchmarking localhost (be patient)\nCompleted 100 requests\nCompleted 200 requests\nCompleted 300 requests\nCompleted 400 requests\nCompleted 500 requests\nCompleted 600 requests\nCompleted 700 requests\nCompleted 800 requests\nCompleted 900 requests\nCompleted 1000 requests\nFinished 1000 requests\n\n\nServer Software:\nServer Hostname:        localhost\nServer Port:            2000\n\nDocument Path:          /api/v1/todos\nDocument Length:        797 bytes\n\nConcurrency Level:      50\nTime taken for tests:   5.689 seconds\nComplete requests:      1000\nFailed requests:        0\nKeep-Alive requests:    1000\nTotal transferred:      1842000 bytes\nHTML transferred:       797000 bytes\nRequests per second:    175.78 [#/sec] (mean)\nTime per request:       284.452 [ms] (mean)\nTime per request:       5.689 [ms] (mean, across all concurrent requests)\nTransfer rate:          316.19 [Kbytes/sec] received\n\nConnection Times (ms)\n              min  mean[+/-sd] median   max\nConnect:        0    0   0.4      0       3\nProcessing:    12  279  52.8    277     470\nWaiting:        9  278  52.8    277     470\nTotal:         12  279  52.8    277     471\n\nPercentage of the requests served within a certain time (ms)\n  50%    277\n  66%    298\n  75%    310\n  80%    319\n  90%    348\n  95%    366\n  98%    405\n  99%    414\n 100%    471 (longest request)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirmanjs%2Fknex-express-for-backend-team","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffirmanjs%2Fknex-express-for-backend-team","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirmanjs%2Fknex-express-for-backend-team/lists"}