{"id":14975906,"url":"https://github.com/tagmus-software/clean-arc","last_synced_at":"2025-09-04T20:35:59.056Z","repository":{"id":106449921,"uuid":"424687251","full_name":"tagmus-software/clean-arc","owner":"tagmus-software","description":"Typescript back end with clean arquitecture, design pattern, single responsability of each component for extreme maintence facility","archived":false,"fork":false,"pushed_at":"2024-05-09T16:54:34.000Z","size":1097,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-05T15:38:16.223Z","etag":null,"topics":["back-end","clean","clean-architecture","clean-code","docker","docker-compose","eslint","node","nodejs","prettier","typeorm","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tagmus-software.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2021-11-04T17:46:27.000Z","updated_at":"2024-05-09T16:54:38.000Z","dependencies_parsed_at":"2024-09-18T18:03:48.376Z","dependency_job_id":null,"html_url":"https://github.com/tagmus-software/clean-arc","commit_stats":{"total_commits":62,"total_committers":2,"mean_commits":31.0,"dds":0.08064516129032262,"last_synced_commit":"6110f9072a36a14102bc0e3afa9ce83d8a80bd23"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tagmus-software%2Fclean-arc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tagmus-software%2Fclean-arc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tagmus-software%2Fclean-arc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tagmus-software%2Fclean-arc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tagmus-software","download_url":"https://codeload.github.com/tagmus-software/clean-arc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219868660,"owners_count":16555694,"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":["back-end","clean","clean-architecture","clean-code","docker","docker-compose","eslint","node","nodejs","prettier","typeorm","typescript"],"created_at":"2024-09-24T13:52:50.538Z","updated_at":"2024-10-11T13:01:23.629Z","avatar_url":"https://github.com/tagmus-software.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Overview\n\nThis is a back-end clean architecture project designed with the following technologies:\n\n```bash\n  node -v\n  # v16+\n  tsc -v\n  # version 4.4.+\n```\n\n## Summary\n\n-   [Setup and Install](https://github.com/kevingamaa/typescript-backend-example/blob/main/README.md#setup-and-install)\n-   [Logging Configuration](https://github.com/kevingamaa/typescript-backend-example/blob/main/README.md#logging)\n-   [Migration, Seeders, and Database related stuff](https://github.com/kevingamaa/typescript-backend-example/blob/main/README.md#database)\n-   [HTTP Application documentation Routes/Controller/Error Handling](https://github.com/kevingamaa/typescript-backend-example/tree/main/src/interfaces/http)\n\n##### Directory structure\n\n```bash\n-- src/\n---- app/\n---- infra/\n---- interfaces/\n```\n\n## Setup and Install\n\nSteps to setup everything is simple 4 steps to do, follow the steps below:\n\n##### 1º - Git Clone\n\nIn your terminal go in the directory where you want to clone the project\n\n```bash\ngit clone https://github.com/kevingamaa/typescript-backend-example.git\n```\n\n##### 2º - Environment\n\nyou will notice that we have the `.env.example` file in the root directory, create another file named `.env`, and copy and paste the content from `env.example` in your `.env` file. It's something like this.\n\n```bash\nAPP_NAME='Back-end example'\nAPP_LOGS=true\n\nMYSQL_PORT=3306\nMYSQL_HOST='db'\nMYSQL_DATABASE='app'\nMYSQL_USERNAME='root'\nMYSQL_PASSWORD='example'\n```\n\n##### 3º - Dependencies\n\nThe project is decoupled from any third parties libraries, so if you decide to work with another logging library or database ORM the choice is up to you, in case yes go ahead and adjust the dependencies and create the adapters for whatever you integrating with. In the meanwhile, we're working with [typeorm](https://typeorm.io/) as our ORM, [express](https://expressjs.com/pt-br/) to provide an HTTP interface and [pinno](https://github.com/pinojs/pino) for logging. Finally to install everything you run:\n\n```bash\nnpm install\n```\n\n##### 4º - Build and Running\n\nIf you're here I'll guess everything went great and you only need to get the project running for that go ahead and run the script below in your terminal:\n\n```bash\nnpm start:dev\n```\n\nafter your application started you should check if the localhost:3000 or localhost:3200 receive the response \"hello world\"\n\n---\n\n#### Production\n\nIt would be the following commands\n\n```bash\nnpm run build\n```\n\nand then\n\n```bash\nnpm start\n```\n\n---\n\n#### docker setup\n\nIn case you prefer to use docker, there is a docker-compose file binding everything you need to get the project running\n\n```bash\ndocker compose up\n```\n\n!!!Remember in case of using docker every command should be executed inside the container!!!\n\n## Logging\n\nIn case you need to visualize better your terminal output if you're using Pino as your logging tool just install [pino-pretty](https://github.com/pinojs/pino-pretty) with the following command:\n\n```bash\nnpm install --save-dev pino-pretty\n```\n\nand then in the `src/main.ts` file, you edit the line creating your application with the following configuration for pretty log\n\n```typescript\n  const app = await ApplicationFactory.createHttpApplication({\n    logger: {\n      engine: \"pino\",\n      pinoOptions: {\n        transport: {\n          target: \"pino-pretty\", // this will load pino pretty\n        },\n      },\n    },\n    ...\n  })\n```\n\n## Database\n\nThe following commands for database connection was implemented with [typeorm](https://typeorm.io/), if you feel that you should be using a different ORM go ahead and change, but would be necessary to config the CLI for your setup.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftagmus-software%2Fclean-arc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftagmus-software%2Fclean-arc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftagmus-software%2Fclean-arc/lists"}