LucasSGomide / React-CleanArch

ReactJS, Hooks, Recoil, TDD, Clean Architecture, SOLID

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

JOB-STATUS Coverage Status

API Documentation:

Notes:

  • Receive an Complex Object as params instead of primitive types
  • To decouple a Classes, create an interface and inject it.
  • Implement Factories to keep class instanciation centralized
  • Testing Practices:
    • SUT: System Under Test
    • MockFunction: It's used for testing INPUT values
    • StubFunction: It's used for testing OUTPUT values
    • SpyFunction: It's used for testing INPUT and OUTPUT values.
  • Make imports more readable
    • TypeScript: add attribute "paths" into "tsconfig.json"
    • Jest: add attribute "moduleNameMapper" into "jest.config.js"
    • Create "index.ts" files to export data located in shared folders
  • Implement "Adapter" design pattern to enforce external libraries to follow a defined interface
  • YAGNI principle ("You Aren't Gonna Need It"): features should only be added when required
  • Implement "Composite" design pattern to execute different kinds of field validations (Ex: Required Field, Min Length, Email, Phone Number, etc...) for a specific field name.
    • Ex:
      • Field: fullName
      • Validations: RequiredField, MinLength
  • Implement "Builder" design pattern to "build" an array of validation methods
    • Ex:
      • Field: fullName
      • Validations: RequiredField, MinLength
      • builder.field('fullName').required().minLength(5)

About

ReactJS, Hooks, Recoil, TDD, Clean Architecture, SOLID


Languages

Language:TypeScript 86.0%Language:SCSS 7.6%Language:JavaScript 4.3%Language:HTML 1.9%Language:Shell 0.3%