Skip to content

Code Practices #12

@optimm

Description

@optimm
  • Create a folder repository and all executions with database to be done in repository files (for ex: create auth.repo.ts and create find user, create user functions in there and use in the auth service file) , we can also create a base repository file in future then adding basic functions there.
  • Always create DTOs (classes or interfaces ) for function payload (and for controller functions , validation will also be done by them).
  • Do not use env files directly (just not convenient to use caps), create a file envconfig.ts ,pull all the variables there and use it from there.
  • Naming : Try to name in a way that it is both descriptive and not to long (ex: Function getMe can be renamed to getCurrentUserData.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions