{"id":17749890,"url":"https://github.com/mat3e/js-arch","last_synced_at":"2025-08-29T13:26:08.819Z","repository":{"id":41226460,"uuid":"508794603","full_name":"mat3e/js-arch","owner":"mat3e","description":"JS Clean Architecture: folder-by-feature, MVC, APIs at the top","archived":false,"fork":false,"pushed_at":"2022-10-12T22:18:29.000Z","size":806,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-02T09:12:12.111Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/mat3e.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}},"created_at":"2022-06-29T17:55:48.000Z","updated_at":"2022-11-05T22:14:34.000Z","dependencies_parsed_at":"2022-09-07T09:12:00.614Z","dependency_job_id":null,"html_url":"https://github.com/mat3e/js-arch","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mat3e/js-arch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mat3e%2Fjs-arch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mat3e%2Fjs-arch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mat3e%2Fjs-arch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mat3e%2Fjs-arch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mat3e","download_url":"https://codeload.github.com/mat3e/js-arch/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mat3e%2Fjs-arch/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272691867,"owners_count":24977232,"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","status":"online","status_checked_at":"2025-08-29T02:00:10.610Z","response_time":87,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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-10-26T11:25:22.342Z","updated_at":"2025-08-29T13:26:08.781Z","avatar_url":"https://github.com/mat3e.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JS Clean Architecture\n\n[My tech talk](https://github.com/mat3e/talks/tree/master/docs/js-arch), [example slides](https://mat3e.github.io/talks/js-arch/charity.html#/)\n\n## Context\n\n* Focuses on React as this is the most popular solution looking at [weekly npm downloads](https://www.npmjs.com/package/react)\n* It was like that almost since 2016, [evidence](https://hackernoon.com/how-it-feels-to-learn-javascript-in-2016-d3a717dd577f) :D\n* At the same time React doesn't have as many conventions as e.g. Angular (~framework vs. lib)\n\n## Level 1 - Clean Code\n\n### Single file level\n\n* [Uncle Bob](https://stackoverflow.com/questions/1760850/best-practice-ordering-of-public-protected-private-within-the-class-definition/1760877#1760877): most important things on top\n* [johnpapa/angular-styleguide](https://github.com/johnpapa/angular-styleguide/blob/master/a1/README.md#bindable-members-up-top) with similar hints\n* TypeScript to introduce more hints on your APIs\n\n## Level 2 - Clean Architecture\n\n### Organizing files\n\n* [Recommendation from Dan Abramov](https://react-file-structure.surge.sh/) :D\n* [_LIFT_ in the previous Style Guide](https://github.com/johnpapa/angular-styleguide/blob/master/a1/README.md#application-structure-lift-principle)\n* [Folders-by-Feature](https://github.com/johnpapa/angular-styleguide/blob/master/a1/README.md#folders-by-feature-structure)\n\n### Files responsibility\n\n* [Presentational and Container Components](https://medium.com/@dan_abramov/smart-and-dumb-components-7ca2f9a7c7d0)\n* MVC\n   * Model - external API \u0026 processing\n   * View - JSX\n   * Controller - `.service.ts`\n* Exporting public APIs (available to use outside the directory) with `index.ts` files\n\n## Level 3 - Clean System Architecture\n\n### Introducing own packages\n\n* Introduce `layout` part of the system\n   * Treat it as a future design system\n* Try to have self-sufficient subdirectories, easy to extract as packages\n* Gradually introduce monorepos and actual external packages (when needed)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmat3e%2Fjs-arch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmat3e%2Fjs-arch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmat3e%2Fjs-arch/lists"}