Context
I am creating an app which uses multiple server api points to perform different functions such as writing to Firebase Firestore. These api points are set up in the server directory like so:
server/
api/
foo.ts
bar.ts
lib/
firebaseConfig.ts
firebaseHelpers.ts
The two api endpoints under api/ import helper methods (such as writing to and reading from the database) from the firebaseHelpers.ts file. The firebaseHelpers.ts file imports the Firebase configuration from the firebaseConfig.ts file.
Question
My goal is to separate the endpoints, helper-functions and config files from each other. Also, the helper-functions and config files only need to be available in the server.
Considering this, my question is if this is a good structure to use in Nuxt? I have seen others use the plugins/ and utils/ directories, is that how I should divide my lib/ directory in my case? Is it okay to use a lib/ directory like this?