{"id":14989344,"url":"https://github.com/sombriks/simple-knex-koa-example","last_synced_at":"2026-02-05T00:35:59.085Z","repository":{"id":146515468,"uuid":"606840150","full_name":"sombriks/simple-knex-koa-example","owner":"sombriks","description":"sample application touring API, tests, continuous integration, continuous deployments, image publishing and so on","archived":false,"fork":false,"pushed_at":"2023-12-16T15:27:31.000Z","size":606,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"develop","last_synced_at":"2025-03-21T21:15:17.282Z","etag":null,"topics":["argocd","docker","docker-compose","dotenv-flow","github-actions","gitops","knex","koa","kubernetes","migrations","mocha","node","sinon","sqlite"],"latest_commit_sha":null,"homepage":"http://example.sombriks.org/books","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/sombriks.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","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},"funding":{"github":["sombriks"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null}},"created_at":"2023-02-26T18:09:10.000Z","updated_at":"2024-07-07T18:09:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"f982ee6e-e660-45f6-85b2-0f9b676c6f88","html_url":"https://github.com/sombriks/simple-knex-koa-example","commit_stats":{"total_commits":77,"total_committers":2,"mean_commits":38.5,"dds":0.1298701298701299,"last_synced_commit":"884d4b6a813e8886b1b5735a331597f38a3e1cb8"},"previous_names":[],"tags_count":13,"template":true,"template_full_name":null,"purl":"pkg:github/sombriks/simple-knex-koa-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sombriks%2Fsimple-knex-koa-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sombriks%2Fsimple-knex-koa-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sombriks%2Fsimple-knex-koa-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sombriks%2Fsimple-knex-koa-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sombriks","download_url":"https://codeload.github.com/sombriks/simple-knex-koa-example/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sombriks%2Fsimple-knex-koa-example/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264506771,"owners_count":23619063,"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":["argocd","docker","docker-compose","dotenv-flow","github-actions","gitops","knex","koa","kubernetes","migrations","mocha","node","sinon","sqlite"],"created_at":"2024-09-24T14:18:09.926Z","updated_at":"2026-02-05T00:35:54.065Z","avatar_url":"https://github.com/sombriks.png","language":"JavaScript","funding_links":["https://github.com/sponsors/sombriks"],"categories":[],"sub_categories":[],"readme":"# [simple knex koa example](https://github.com/sombriks/simple-knex-koa-example)\n\n[![tests](https://github.com/sombriks/simple-knex-koa-example/actions/workflows/node.js.yml/badge.svg)](https://github.com/sombriks/simple-knex-koa-example/actions)\n[![Docker Image Version (latest semver)](https://img.shields.io/docker/v/sombriks/simple-knex-koa-example?logo=docker\u0026color=lightblue)](https://hub.docker.com/r/sombriks/simple-knex-koa-example/tags)\n\nsample application for [this blog post](https://sombriks.com/blog/0043-knex-still-rocks-on-modern-node/)\nand for [this one too](https://sombriks.com/blog/0055-containers-part-3-app-container-friendly/)\n\n## This is a project template\n\nIf starting a backend node project with [koa](https://koajs.com), consider\neither use this template directly or just grab some inspiration.\n\n## Requirements\n\n- node 18\n\nIf you plan to run in production mode\n\n- postgresql\n\nIf you plan to create a docker image container\n\n- docker\n\nSee the `infrastructure` folder for further details.\n\nIf you plan to deploy the image into a kubernetes cluster, there are several\noptions, but try to set up [kind](https://kind.sigs.k8s.io/), since you already\nhad to setup docker.\n\n## How to run this application\n\nThere are several ways to run this app:\n\n### Bare metal\n\nInstall node dependencies and run the project:\n\n```bash\nnpm install\nnpm run dev\n```\n\n### Docker\n\nCreate an image:\n\n```bash\ndocker build -f infrastructure/Dockerfile \\\n  -t sombriks/simple-knex-koa-example:development .\n```\n\nThen spin up a container:\n\n```bash\ndocker run -it \\\n  -e NODE_ENV=development \\\n  -e PORT=3000 \\\n  -p 3000:3000 sombriks/simple-knex-koa-example:development\n```\n\n### Docker compose\n\nCreate the image as shown in the previous section, then spin up\n[the provided docker compose example file](infrastructure/docker-compose.yml):\n\n```bash\nNODE_ENV=development docker compose -f infrastructure/docker-compose.yml up\n```\n\nIn all examples above, the app will start in `development mode`.\n\n### Kubernetes\n\nSee the details [here](infrastructure/README.md).\n\n## The articles\n\nAs mentioned in the beginning of this document, this source code was used to\noffer support for a blog post. Eventually other articles came.\n\n### [knex rocks](https://sombriks.com/blog/0043-knex-still-rocks-on-modern-node/)\n\nKnex will help you to build your queries and that's it, no ORM, M-N relations,\nnothing. it does only one thing and does it well.\n\n### [containers, images, registries and so on](https://sombriks.com/blog/0055-containers-part-3-app-container-friendly/)\n\nAt some point container images became the de-facto standard for application\npublishing and there is no way back from there.\n\nbut this is not a bad thing, once you figure out that good practices still\nmostly the same.\n\n### [Testing kubernetes configurations with kind](https://sombriks.com/blog/0058-containers-part-4-k8s-with-kind/)\n\nKubernetes is how people put things in production nowadays and sometimes\nit can be tricky to test because it's heavy.\n\nBy using kind as kubernetes runtime, part of this issue is solved and the\ndeveloper can be more confident on how the application will behave inside\nthe belly of the beast.\n\n### [The GitHub Actions playground](https://sombriks.com/blog/0061-github-actions-recipes/)\n\nGitHub Actions can be a very handy too to implement continuous Integration,\nContinuous Delivery and Continuous Deployment.\n\nI built some simple, useless yet educational examples so when building more\ncomplex workflows this material could be consulted.\n\nIt was key to build [this good enough example](.github/workflows/_base.yml) of\ndeployment workflow base for GitOps pull based solutions combined with\n[ArgoCD](https://argo-cd.readthedocs.io/en/stable/getting_started/).\n\n## References\n\n- [node](https://nodejs.org)\n- [knex](https://knexjs.org)\n- [sqlite](https://sqlite.org)\n- [postgresql](https://postgresql.org)\n- [koa](https://koajs.com)\n- [docker](https://docker.com)\n- [kind](https://kind.sigs.k8s.io/)\n- [github actions recipes](https://github.com/sombriks/gh-actions-playground)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsombriks%2Fsimple-knex-koa-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsombriks%2Fsimple-knex-koa-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsombriks%2Fsimple-knex-koa-example/lists"}