What I’m trying to do:
We are right at the start of our Redesign of our zoho creator app into Anvil.
We need some strategic advice around the following questions:
Is it possible to build a form in Anvil using data stored in a Table. For example we need to create a checklist form builder so our clients can fill out a form with questions and then we take the questions and create a form with checkboxes or radio buttons that use that table data of questions to fill the choices
Are there any best practive methods for implementing a multi tenant solution in Anvil. Do we use a Tenant ID on every table and every lookup field and every piece of code to ensure we filter only for the tenant or can we implement something at a lower level that filters for the tenant so the code can be easily developed without having to remember the tenant id filter every time
We have been thinking of creating a Sysadmin app, a Operations app and a mobile app. Can the tenant and user data in the sysadmin app be shared with the other two apps easily OR do we build one big app and then hide or show different pages depending on the user role?
We have users that want to create reports for printing to PDF or emailing to some with groupings and totals etc and possible pivots, has anyone found a good JavaScript control that would plug into Anvil for this?
Does the PWA include the ability to use mobile commands like swipe left or swipe right or long press etc?
Sure!
I have an app where I define a list of variables, each variable has a type of input ui element, page name, bitmap name, condition and other properties. The app shows a list of pages in sequence, each page with its ui elements. It started as a simple wizard maker and it evolved into my own survey monkey.
In simple cases you can add a column to the users table of type link to table with the list of rows of the data table. This only works when the number of new columns is not too large and when the number of rows in the list is not too large. If this doesn’t work, you can use the q.() query filters on any column. If you need more complex queries you can use sql with a dedicated plan.
You decide what tables or databases are used by what apps or by what version of the same app. The apps can also share the login. I like to make small apps that share tables and login rather than one large app. Users can click on remember me on one app and be logged in the others. I usually disable the remember me in the amin apps.
I like to do as much as possible in Anvil. I create my pdfs by creating a form that shows whatever I want to show using repeating panels and other standard Anvil components as in any other form and render it as pdf. Sometimes I need to play with css and settle with less than perfect because I don’t have easy control over the behavior of the form when there is a page break, but I have never used any other tool or library.
As you’ve discovered, this is a great place to build out pretty robust apps. I don’t have answers to all of your questions but will attempt to be as helpful as I can.
The short answer is yes – ultimately, all of the core functionality in Anvil can be programmatically configured as things are Python objects.
Check out the “Everything is Code” section in the docs showing how to add components for an example
I’d say this depends on how you decide to structure your app.
I tend to think of the server-side in Anvil as a Flask app. You could use the concept of Blueprints to structure each “app” within a single project (also similar to how apps function in Django).
You can also keep each project separate in Anvil, and use a base layer as a dependency for each of the front end apps (more here)
Looks like the community are already on this, just wanted to add a bit more detail here:
Broadly, there are two ways to do “multi-tenant”:
Build one application that supports users from many organisations, using linked rows in Data Tables, and uses application logic to separate them (this is what’s being discussed above)
Build an application and deploy it in a separate deployment environment for each customer - so, separate domain name, database tables, etc.
Both of these approaches work - #1 is preferable if you want to support lots of organisations, especially if they’re self-provisioning, but does rely on your application logic to prevent cross-tenant data leaks. #2 allows you to create entirely isolated installations between customers.
Thanks @meredydd , we have 600 users on our current product in zoho creator so the first option you talked about is our goal as we need to 100x factor our user count number and zoho is costing us too much money from the base licensing point of view to scale to that size.
Also we are running into performance issues and the ability to include awesome javascript libraries like DHTMLX etc
I have had a great chat with @owen.campbell and @mark.breuss . The community is HUGELY helpful as we are not starting from scratch and have been spending a LONG time selecting our next tech stack to replace zoho creator. I wish I had found you 4 years ago but alas there you go lol