{"id":38934596,"url":"https://github.com/agungsptr/node-clean-ts","last_synced_at":"2026-01-17T15:47:17.101Z","repository":{"id":71612318,"uuid":"598905166","full_name":"agungsptr/node-clean-ts","owner":"agungsptr","description":"A TypeScript version of node-clean","archived":false,"fork":false,"pushed_at":"2024-02-05T02:15:32.000Z","size":1918,"stargazers_count":4,"open_issues_count":6,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-05-21T02:39:07.441Z","etag":null,"topics":["clean-architecture","express","grpc","mongodb","nodejs","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/agungsptr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":["https://www.buymeacoffee.com/agungsptr","https://trakteer.id/agungesptr/tip"]}},"created_at":"2023-02-08T03:14:55.000Z","updated_at":"2023-11-17T13:40:54.000Z","dependencies_parsed_at":"2023-11-11T08:26:57.809Z","dependency_job_id":"3df968bb-8e4f-4572-adea-3b65e060db1a","html_url":"https://github.com/agungsptr/node-clean-ts","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/agungsptr/node-clean-ts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agungsptr%2Fnode-clean-ts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agungsptr%2Fnode-clean-ts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agungsptr%2Fnode-clean-ts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agungsptr%2Fnode-clean-ts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/agungsptr","download_url":"https://codeload.github.com/agungsptr/node-clean-ts/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agungsptr%2Fnode-clean-ts/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28511851,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T13:38:16.342Z","status":"ssl_error","status_checked_at":"2026-01-17T13:37:44.060Z","response_time":85,"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":["clean-architecture","express","grpc","mongodb","nodejs","typescript"],"created_at":"2026-01-17T15:47:16.396Z","updated_at":"2026-01-17T15:47:17.070Z","avatar_url":"https://github.com/agungsptr.png","language":"TypeScript","funding_links":["https://www.buymeacoffee.com/agungsptr","https://trakteer.id/agungesptr/tip"],"categories":[],"sub_categories":[],"readme":"\u003cbr /\u003e\n\u003cdiv align=\"center\"\u003e\n  \u003ch2 align=\"center\" style=\"font-size:8vw;\"\u003eNode Clean \u003c/br\u003e TypeScript\u003c/h2\u003e\n\n  \u003cp align=\"center\"\u003e\n    A Node.js project template with clean architecture implementation\n    \u003cbr /\u003e\n    \u003ca href=\"https://github.com/agungsptr/node-clean-ts\"\u003e\u003cstrong\u003eExplore the docs »\u003c/strong\u003e\u003c/a\u003e\n    \u003cbr /\u003e\n    \u003cbr /\u003e\n    \u003ca href=\"https://github.com/agungsptr/node-clean-ts/stargazers\"\u003e\n      \u003cimg src=\"https://img.shields.io/github/stars/agungsptr/node-clean-ts.svg\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/agungsptr/node-clean-ts/network\"\u003e\n      \u003cimg src=\"https://img.shields.io/github/forks/agungsptr/node-clean-ts.svg?color=blue\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/agungsptr/node-clean-ts/network\"\u003e\n      \u003cimg src=\"https://img.shields.io/github/contributors/agungsptr/node-clean-ts.svg?color=blue\"\u003e\n    \u003c/a\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eTable of Contents\u003c/summary\u003e\n  \u003col\u003e\n    \u003cli\u003e\n      \u003ca href=\"#about-the-project\"\u003eAbout The Project\u003c/a\u003e\n      \u003cul\u003e\n        \u003cli\u003e\u003ca href=\"#feature\"\u003eFeature\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"#built-with\"\u003eBuilt With\u003c/a\u003e\u003c/li\u003e\n      \u003c/ul\u003e\n    \u003c/li\u003e\n    \u003cli\u003e\n      \u003ca href=\"#getting-started\"\u003eGetting Started\u003c/a\u003e\n      \u003cul\u003e\n        \u003cli\u003e\u003ca href=\"#prerequisites\"\u003ePrerequisites\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"#installation\"\u003eInstallation\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"#alternative-installation\"\u003eAlternative Installation\u003c/a\u003e\u003c/li\u003e\n      \u003c/ul\u003e\n    \u003c/li\u003e\n    \u003cli\u003e\n      \u003ca href=\"#usage\"\u003eUsage\u003c/a\u003e\n      \u003cul\u003e\n        \u003cli\u003e\u003ca href=\"#web-services\"\u003eWeb Services\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"#grpc\"\u003egRPC\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"#unit-test\"\u003eUnit Test\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"#coverage-test\"\u003eCoverage Test\u003c/a\u003e\u003c/li\u003e\n      \u003c/ul\u003e\n    \u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#contributing\"\u003eContributing\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#license\"\u003eLicense\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#contact\"\u003eContact\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#acknowledgments\"\u003eAcknowledgments\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#support-me\"\u003eSupport Me\u003c/a\u003e\u003c/li\u003e\n  \u003c/ol\u003e\n\u003c/details\u003e\n\n## About The Project\n**This a TypeScript version of Node Clean**, if you want to see the JavaScript version follow this [way](https://github.com/agungsptr/node-clean).\n\n\nThis project aims to be used as a base backend project which implements clean architecture.\nI create this project to help me build a backend application faster as a template project.\nFeel free to use this project as your base application.\nI am very happy if you are helped by using this template.\n\n### Features\n\n* RESTful\n* gRPC\n* Authentication using JWT\n* CRUDS Resources\n* Unit Test\n* Coverage Test\n* Load Test\n\n### Built With\n\n* [![NodeJS](https://img.shields.io/badge/node.js-6DA55F?style=for-the-badge\u0026logo=node.js\u0026logoColor=white)](https://nodejs.dev)\n* [![Express](https://img.shields.io/badge/Express.js-404D59?style=for-the-badge\u0026logo=express)](https://expressjs.com)\n* [![Mongodb](https://img.shields.io/badge/MongoDB-4EA94B?style=for-the-badge\u0026logo=mongodb\u0026logoColor=white)](https://www.mongodb.com)\n* [![Docker](https://img.shields.io/badge/docker-%230db7ed.svg?style=for-the-badge\u0026logo=docker\u0026logoColor=white)](https://www.docker.com)\n\n## Getting Started\n\nLet's start this project...\n\n### Prerequisites\n\nBefore you dig into this project it very nice if you understand the clean architecture concept. I recommend you to read about the **Clean Architecture** first.\n\n* Basic javascript\n* VS Code (Recommend)\n* Node \u003e= v16.15.0\n* Yarn\n* GNU Make\n* Docker\n\n### Installation\n\n1. Clone the repo\n\n   ```sh\n   git clone https://github.com/agungsptr/node-clean-ts.git\n   ```\n\n2. Install Yarn packages\n\n   ```sh\n   yarn install\n   ```\n\n3. Copy `.env.example` to `.env`\n\n4. Setup `MongoDB` container\n\n   ```sh\n   make infra\n   ```\n\n5. Seed database\n\n   ```sh\n   make seed\n   ```\n\n6. Now you can run this project, this project running on port 7000 in your local\n\n   ```sh\n   make dev\n   ```\n\n### Alternative Installation\n\nFollow this instruction if you do not use `docker` or in `Windows` or if you having trouble with the installation above.\n\n1. Clone the repo\n\n   ```sh\n   git clone https://github.com/agungsptr/node-clean-ts.git\n   ```\n\n2. Make sure that you have installed `Node`, `Yarn`, and `Mongodb` in your local\n\n3. Install Yarn packages\n\n   ```sh\n   yarn install\n   ```\n\n4. Copy `.env.example` to `.env`\n\n5. Setup `Mongodb`, for this you need to match your `Mongodb` to the `.env` file. To do that, please update the followings variable\n\n   ```sh\n   - MONGO_HOST (your MongoDB host, ex. localhost if using your local machine)\n   - MONGO_PORT (your MongoDB port)\n   - MONGO_DBNAME (database name, you need to create it first in MongoDB)\n   - MONGO_USER (username to access your MongoDB)\n   - MONGO_PW (password for the user)\n   ```\n\n6. Seed database\n\n   ```sh\n   yarn seed\n   ```\n\n7. Now you can run this project, this project running on port 7000 in your local\n\n   ```sh\n   yarn dev\n   ```\n\n## Usage\n\n### Web Services\n\n* Login\n\n```sh\n  curl --location --request POST 'localhost:7000/api/auth/login' \\\n  --header 'Content-Type: application/json' \\\n  --data-raw '{\n      \"username\": \"agungsptr\",\n      \"password\": \"24434\"\n  }'\n```\n\n* Get All Users\n\n```sh\n  curl --location --request GET 'localhost:7000/api/users' \\\n  --header 'Authorization: Bearer \u003cAuthToken\u003e'\n```\n\nFor more request examples please use this postman collection [here](./NodeClean.postman_collection.json).\n\n### gRPC\n\n* Start gRPC Server\n\n```sh\n  make grpc\n```\n\nAfter running the gRPC server, you can run example gRPC client, using this command\n\n* Start gRPC Client\n\n```sh\n  make grpc_client\n```\n\n### Unit Test\n\n```sh\n  make test\n```\n\nThe tests carried out include:\n\n* Data Access (./data-access)\n* Models (./models)\n* Routes (./drivers/webservice/routes)\n\nScreenshots result\n\n![Unit Test 1](.github/resources/images/unit-test1.png)\n\n![Unit Test 2](.github/resources/images/unit-test2.png)\n\n### Coverage Test\n\n```sh\n  make coverage_test\n```\n\nScreenshots result\n\n![Coverage Test](.github/resources/images/coverage-test.png)\n\n### Load Test\n\n```sh\n  make load_test\n```\n\nAfter you run load test command above you can see the test result in graphic, for that please open html file in `test/output/report.html`.\n\nScreenshots result\n\n![Load Test 1](.github/resources/images/load-test1.png)\n\n![Load Test 2](.github/resources/images/load-test2.png)\n\n### Available Make Commands\n\n```sh\n# Infrastructure\nmake infra              # Run only db container\nmake build              # Build image\nmake compose-up         # Run all container including db and app\nmake compose-down       # Stop all containers\nmake purge              # Delete all images\nmake auto               # Auto command, to build image and run all containers\nmake wait-db            # Check db is ready\nmake wait-app           # Check app is ready\n\n# Application\nmake start              # Run webservice\nmake dev                # Run webservice in dev mode with watching mode\nmake grpc               # Run gRPC\nmake grpc_client        # Run example gRPC client\n\n# Database\nmake seed               # Seeding database\n\n# Testing\nmake test               # Unit testing\nmake coverage_test      # Coverage testing\nmake load_test          # Load testing, to testing the app performace\n```\n\n## Contributing\n\nContributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.\n\nIf you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag \"enhancement\".\nDon't forget to give the project a star! Thanks again!\n\n1. Fork the Project\n2. Create your Feature Branch ( `git checkout -b feature/magic` )\n3. Commit your Changes ( `git commit -m 'feature/magic: Add some magic'` )\n4. Push to the Branch ( `git push origin feature/magic` )\n5. Open a Pull Request\n\n## License\n\nDistributed under the MIT License. See [LICENSE](./LICENSE) for more information.\n\n## Contact\n\nAgung Saputra - agung.e.sptr@gmail.com\n\nProject Link: [here](https://github.com/agungsptr/node-clean-ts)\n\n## Acknowledgments\n\nResources that help me to build this project.\n\n* [Clean Architecture Node.js - Build a REST API](https://mannhowie.com/clean-architecture-node)\n* [Clean Architecture in ExpressJS Applications (NodeJS)](https://merlino.agency/blog/clean-architecture-in-express-js-applications)\n* [JavaScript dependency injection in Node – friend or foe?](https://tsh.io/blog/dependency-injection-in-node-js)\n* [Patterns — Generic Repository with Typescript and Node.js](https://medium.com/@erickwendel/generic-repository-with-typescript-and-node-js-731c10a1b98e)\n* [Express.js](https://expressjs.com)\n* [MongoDB Documentation](https://www.mongodb.com/docs)\n* [Mongoose Documentation](https://mongoosejs.com/docs)\n* [gRPC Intoduction](https://grpc.io/docs/what-is-grpc/introduction)\n* [gRPC Node Quick Start](https://grpc.io/docs/languages/node/quickstart)\n* [Understanding Protocol Buffers](https://betterprogramming.pub/understanding-protocol-buffers-43c5bced0d47)\n* [Official TypeScrip Doc](https://www.typescriptlang.org/docs)\n* [Learn Typescript at freecodecamp](https://www.youtube.com/watch?v=30LWjhZzg50)\n\n## Support Me\n\n[![\"Buy Me A Coffee\"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/agungsptr)\n\u003ca href=\"https://trakteer.id/agungesptr/tip\" target=\"_blank\"\u003e\u003cimg id=\"wse-buttons-preview\" src=\"https://cdn.trakteer.id/images/embed/trbtn-red-1.png\" height=\"40\" style=\"border:0px;height:40px;\" alt=\"Trakteer Saya\"\u003e\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagungsptr%2Fnode-clean-ts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fagungsptr%2Fnode-clean-ts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagungsptr%2Fnode-clean-ts/lists"}