Reputation: 895
Does it make sense to use Angular (Frontend) and NestJS (Backend) in a monorepo (e.g. Nx or Lerna)?
What kind of code could you share? I only can think of Models (e.g. User-Class). However, NestJS uses TypeORM, which "pollutes" the Model with additional decorates (@Entity
, @Column
, ...). These decorators are fine in a NestJS context, but you don't want these decorators in a Angular context.
Why does this still make sense? What are the advantages of it? What are your thoughts?
Upvotes: 0
Views: 168
Reputation: 31235
Entities should definitely stay on backend side, never expose your database structure.
You can share :
Which means less duplication. With this configuration, OpenAPI/Swagger becomes useless. You directly share DTOs and get live reload on both sides as soon as you modify a DTO
Upvotes: 0