You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Forestadmin, when initiated, recognizes all models and it can be used as CMS for adding fields directly to the DB.
Actual behavior
Forestadmin when initiated
locally with local database shows just a subset of fields that each Mongo collection has
locally with remote (dev) database (Mongo Atlas) shows only "id" fields
Stack
We use Heroku for deployment, and a month ago we had to transition from mLab MongoDB provider due to Heroku’s breaking up with mLab company, so we successfully transitioned to Mongo Atlas provider and just updated the URL in the app. Mongo Atlas has free and paid plans and we are currently on the free plan.
We use Typescript instead of plain Javascript in Foodtrucker app for more robust approach and type system, and instead of the usual:
models/user.js
structure we have a different file and folder structure with Onion architecture, grouped by features, not by models/controllers etc. such as:
user/user.model.js user/user.interface.js
Trying the integration
So when I installed Forest admin (FA in short) for the first time on my local machine to test out the UI, I realized that the FA app didn’t recognize all models from the database it connected to, because the Mongo Atlas free plan does not support script execution of some sort which would allow this.
And then I found out official FA blog post which describes that instead of buying paid plan, you can actually avoid this known issue just by building the app locally first, and then somehow rewiring it to point into your real database, and thus creating the models locally needed but point to the real DB after that.
So I thought okay, it’s a hack - but let’s try it. And then I realized an even bigger problem, it looks like that it can be done locally, but the models in the FA dashboard only have fields that the DB has, not all that is defined in the DB.
Explained simply, even though I had defined isComingSoon field for Brands in my model file until an object in the DB has that property, forest admin does not know it exists.
So I thought, okay the FA needs to have files from which it can know the proper database structure. And I saw that the FA app has a copy of my model files, but the thing is - they are javascript files, not typescript.
I spent the last few days trying to:
add our existing TS files …
add our compiled JS files …
manually rewrite our TS -> JS files …
…into FA folder structure to try and see whether dashboard will see all fields, but no success to run the app.
I think the combination of Typescript and ForestAdmin is a problem, and to add to that, this issue with Mongo Atlas. There is just a lot of variables included and I am not that experienced with this framework to know whether we can run a dashboard on a TS project just by changing the DB provider or something like that.
Questions
Is this possible to use FA with a complex project structure like this?
Does Forestadmin gets all information on models from the files you put in the folder structure, and can they be TS files from my actual project?
Since we are using Heroku, I think the FA app needs to be clearly separated from the actual backend app so that it can be deployed, so my question would be, does that mean that on every model update in the actual project, I'd need to add those changes to model files in the FA project?
The text was updated successfully, but these errors were encountered:
Expected behavior
Forestadmin, when initiated, recognizes all models and it can be used as CMS for adding fields directly to the DB.
Actual behavior
Forestadmin when initiated
Stack
models/user.js
structure we have a different file and folder structure with Onion architecture, grouped by features, not by models/controllers etc. such as:
user/user.model.js
user/user.interface.js
Trying the integration
So when I installed Forest admin (FA in short) for the first time on my local machine to test out the UI, I realized that the FA app didn’t recognize all models from the database it connected to, because the Mongo Atlas free plan does not support script execution of some sort which would allow this.
And then I found out official FA blog post which describes that instead of buying paid plan, you can actually avoid this known issue just by building the app locally first, and then somehow rewiring it to point into your real database, and thus creating the models locally needed but point to the real DB after that.
So I thought okay, it’s a hack - but let’s try it. And then I realized an even bigger problem, it looks like that it can be done locally, but the models in the FA dashboard only have fields that the DB has, not all that is defined in the DB.
Explained simply, even though I had defined isComingSoon field for Brands in my model file until an object in the DB has that property, forest admin does not know it exists.
So I thought, okay the FA needs to have files from which it can know the proper database structure. And I saw that the FA app has a copy of my model files, but the thing is - they are javascript files, not typescript.
I spent the last few days trying to:
…into FA folder structure to try and see whether dashboard will see all fields, but no success to run the app.
I think the combination of Typescript and ForestAdmin is a problem, and to add to that, this issue with Mongo Atlas. There is just a lot of variables included and I am not that experienced with this framework to know whether we can run a dashboard on a TS project just by changing the DB provider or something like that.
Questions
Is this possible to use FA with a complex project structure like this?
Does Forestadmin gets all information on models from the files you put in the folder structure, and can they be TS files from my actual project?
Since we are using Heroku, I think the FA app needs to be clearly separated from the actual backend app so that it can be deployed, so my question would be, does that mean that on every model update in the actual project, I'd need to add those changes to model files in the FA project?
The text was updated successfully, but these errors were encountered: