- Check
tree.mdfor folder structure
Can contain the rest api endpoints
Will contain connection details e.g. getGqlClient(), getApolloClient()
This dir will include all the react query functions
This dir will include all the gql schema definitions
Will contain any demo or local data files e.g.
Can contain mobx, redux, jotai, reactContexts
This dir can contain the typescript type definitions, interfaces.
Can contain react hooks
utility functions for a specific feature
entry point for the feature, it should serve as the public API of the given feature and exports everything that should be used outside the feature
- directory will contain all the code which cannot be fit into features or we do not know yet. this will behave as entry point.
- App directory can import other features but cannot export anything outside of that directory
- any code which can be used in more than 2 features and we do not know yet if that code can be put into it's own feature or not. Then put that code into this dir. E.g. CountryDropdown it will be too soon to create a new
features/geodirectory just for a single components. - We could put countrydropdown into app code also but as we know any code inside
appdir cannot be exported. bitedir cannot import any other features e.g.authno matter what. this can only export the code and can be reused by other features.- we can declare
gql/connectionas bite feature as this can be used by any other features. - bite can contain global context that can be included further in all other features
adapters/gql/connections- can use authToken or any other variable so connection will have to import the e..gimport auth/auth.tsand then userauth.getToken()but we want the connections loosely coupled.- find a way to share variables between components using JS event instead of importing the code. E.g. some component want to get the token from the
auth.getToken()