I am trying to apply DDD to a Vue project (so it's DDD on the frontend) and I have a doubt as to where store a props type. A Vue component can have props
, which is basically named data passed to the component. Most of my components that work as a page are stored inside the application
folder, because they manage all the data flux, that is, the repositories that make API calls, instanciating domain classes, etc. For each of these application
components, I have a .ts
file that speciafies its props; so together with my Profile.vue
, I have a ProfileProps.ts
.
Profile.vue
: the props being defined
import type { ProfileProps } from './ProfileProps'
const props = defineProps<ProfileProps>()
The props type inside ProfileProps.ts
export type ProfileProps = {
user: IBackendUser
}
As you can see, there's only one prop and it's also typed as what I expect the backend to pass to my component: the user. My question is, where should I keep this interface of mine IBackendUser
: maybe a folder in the application called interfaces
, or maybe put it in the domain
folder?
PS.: I have a separate file for the props because some components have extense props (big objects), and I want to keep the pattern for all the project.