What I’m trying to do:
What I’ve tried and what’s not working:
Before diving into the particularities of Anvil and trying to make this work, I’m seeking advise from some of the more experienced Anvil developers on the likely success of such an endeavor. I need to avoid wasting a month or two in time and having to give up in the end. Any pitfalls to look out for?
I would say if you have something working on a stand-alone machine already, you might try dipping your toes into
On the server side, you can use any preinstalled package, or create your own Python 3.10 environment.
My apps include Excel files and test folders that I add after cloning the app to my computer, stuff that is only used while developing and testing offline. You can add any library, just try to avoid including too much stuff that you don’t need.
What you’re proposing looks thoroughly achievable! If you’re building something in JS, the approach I’d recommend is to build the JS project with a standard JS toolchain (Webpack, etc), bundling it into a single
.js file with all it’s dependencies. Then include that file in your Anvil assets, and use
anvil.js to access the JS libraries from your Python code. You’ll probably want to check your app out in Git and have a shell script/batch file/build step that builds your JS code, copies the bundle into your Anvil app, commits it and pushes it up into Anvil (that’s what I do in those cases).
Remember that most Anvil components use concrete DOM nodes rather than React’s virtual DOM, so you’ll want your JS module to have an entrypoint for “render what you want to into [this DOM node]”.
Thank you, Meredydd, Stefano & Ian! Your answers make total sense. Will give it a try per your suggestions.