Anvil: full stack web apps built only with Python
anvil.works
anvil.works
For the last 15 years Microsoft has been putting out the same RAD tools, but based on ASP.NET/C#/Visual Studio. Things like drop-in provider-based OAuth, editing versioned database projects, WYSIWYG UI, etc. Publishing to the web, even the flow of clicking on a button to edit its handler looks like it was based directly on Winforms which is a 12 year old technology.
Why aren't there more of these things out there?
How much time now is spent learning the latest and greatest framework/toolkit/etc. only to spend more time configuring individual components and cobbling them together vs. just getting the product finished and published to users? I don't mean to be cynical but I wish there was some way all these different tools somehow built on each other instead of constantly resetting the dev stacks.
For example, Create React App - I'm constantly impressed by how it has eschewed configuration in favor of getting things done while still having a lot of flexibility. It draws on a lot of great, previous past projects and seems to define the train of thought for other react projects. It seems to me that people like Dan Abramov, Brent Jackson, and others are on the same wavelength which is incredibly powerful for the react community.
There should be a way for that sentiment to extend beyond React, into the database world, the IDE world so that we can collaborate and create more nice things like this.
There are a few - I did like the MS PowerApps recently. But these things work well in an enterprise environment where "works" is important, but "users don't want to kill themselves during interaction" is not. These tools are usually great at putting together a quick CRUD app that fits requirements. But they're typically not flexible enough to give you that finished and polished for users product. If you want to do that rather than a flow of basic forms and tables, you'll start fighting the framework at some point and then think "maybe I should've just used X from the start".
Maybe it doesn't have to be that way, but I did see this a lot.
I agree with you, but taking the create-react-app example again - I can very quickly scaffold a react app with necessary toolsets, built on top of webpack. This gets me up and running without having to mess with webpack config.
At some point, I need to break out of these opinionated guardrails and do my own thing. At that point create react app has an 'Eject' feature which opens up the black box and dumps all webpack configuration and scripts for me to hack away on. The Anvil tool seems to have something similar where you can grab all the sources, download, run, and publish it yourself.
A much more interesting approach is to acknowledge that your system will always be incomplete, and provide ways of using more complex external features without abandoning simplicity for the other 90% of your project. We call this pattern an "escape hatch", rather than an "ejector seat", because you don't need to jump all the way out at once.
Anvil has escape hatches all over the place:
* If you need to use code (or hardware) outside our server environment, you can use our Uplink library to connect arbitrary code anywhere in the world to your app - but you still get our drag'n'drop front end and seamless RPC. (You can even use our built-in database from uplink code.)
* If you need a browser feature we don't support yet, you can call to/from Javascript with our FFI - but you can still wrap it up in a Python form and use that from our visual designer.
* If you need to use a front end that isn't built with the Anvil UI toolkit, you can expose Anvil server functions as REST endpoints and use them from your {iOS|Android|vue.js} app. But you can still use those same server functions from Anvil client code, with full autocomplete.
* If you need direct textual access to your source code, or to do advanced version control operations, or to do CI/CD, you can clone your app as a Git repository. But the moment you push those branches back up into Anvil, you can edit your app with all our tools. (The editor will happily represent Git histories that it cannot [yet] create itself.)
Give me an escape hatch over an ejector seat any day.
It sounds like these features go a long way toward addressing the concerns people had re. my parent comment. You can provide custom frontend or backend code with sacrificing too much of the power of Anvil.
It is not as easy a problem as it seems...beyond the technical hurdle, a major obstacle is developers :)
While you like this paradigm, I am afraid a lot of developers generally scuff at these types of products.
http://blog.codesolvent.com/2017/03/what-happened-to-sharing...
... making it onto the front page of HN isn't some mysterious process, it's as a result of people who are viewing https://news.ycombinator.com/newest when you posted an article voting it up. Due to the fast churn rate on the 'New' page (and to the lower traffic on the New page) it often a matter of luck if a post reaches the front page, but what it isn't is some kind of conspiracy to exclude new entrants.
That aside, your tech looks interesting. What licence(s) is it released under?
But I guess my question is, is it really depressing, because how would the indutry otherwise motivate giants like MS to innovate without such competition?
Or maybe I just misunderstood?
One example is the way the request context works in flask, I venture to say thats just terrible software design in my book (from flask import request, g). And seriously to have your framework give you a "global" variable to put random stuff in, wth?
Also I rather not use Flask-SQLAlchemy since why should my database models be tied so incredibly closely to some library of my web MICRO framework, it doesn't make sense, I mean its not django why introduce this coupling?
It seems if you need all the dependent libraries (like webassets and wtforms) just use django from the get go instead of going through the pain of trying to cleanly integrate dozens of flask libraries.
To see how a proper simple middleware-based framework should look like consider express, koa (nodejs), or bottle, falcon. Aiohttp and tornado also have their place of course.
Flask/etc was useful magic only until I figured out what it really does between me and underlying socket.
> I literally just spent about a month hacking on flask-security to get the login/email-confirmations/email templates/argon2-hashing/2-factor-auth the way I need it.
I don't know Anvil but I am sure it has a specific way of dealing with login/signup/... - just like every other framework. And if you want to modify it, well, that takes time. And I am guessing it was the same with other tasks.
There is nothing wrong with that, of course. Just saying. :)
Anvil's built in "Users" service is incredibly simple and un-magical (user records are just database rows, and you can reimplement vanilla password login in four lines). This makes hacking on it an awful lot easier than some magically injected extension that needs to be configured just so.
(Check out the API: https://anvil.works/doc#users)
With AWS Lambda, Python, AWS Cognito, Postgres and ReactJS I can build large scale complete applications.
I think I'm vastly more productive today than I was then. That's partly a function of being a much better programmer in general, partly about now having developed expertise with my chosen technology set.
There's no way I'd go back to something as bare bones as Bottle or Flask any more. If I had to use a Python framework I'd look at a batteries included system like Django. As I say however, I've settled on Lambda, Cognito, Python, Postgres and ReactJS. I've done the hard yards... years of learning and many thousands of lines of code written.
>> Need to subclass and override much of it to finally have something usable.
This is really not something you should be spending your minimal available programming time doing.
After having done it a few times I personally don't find Flask auth very time consuming to implement.
But I'll admit I really like Flask. I find it just the right approach between something simple and something that can be much more complex with extensions. I don't like all of the extension (WTF Forms for instance can do without and SQL Alchemy usually is better independent of Flask IMOP) but these don't need to be used. I've stuck with Flask as much as possible over the years and that alone has led to a huge productivity increase for me because of familiarity.
In the 90s we had RAD tools like Delphi or Visual Basic which allow you to create simple apps very quickly. I feel that we are missing RAD on the web these days. There are so many different moving pieces. To do a full modern web app you need to learn different languages and frameworks plus other technologies for hosting such as containers or AWS, etc. That might work for complex apps, but sometimes you just want to do something simple that you can easily design visually, use one language and hit one button to publish. I have the feeling that Anvil is moving in this direction.
And extra love for using Python :D
http://www2.sys-con.com/itsg/virtualcd/java/archives/0403/be...
I started out on QBASIC and Visual Basic, back in the day, and as far as I'm concerned it's practically dereliction of duty that there wasn't something similar available for the web. Eventually, we got fed up enough to go and build it ourselves.
I learned to program with Turbo Pascal and then moved to Delphi. While watching your introduction demo my thoughts were "this is like Delphi for the web". I've also missed something like this for a long time.
I'm definitely going to try your product!
You can control which columns do and don't collapse on mobile or tablets. See this post from our user forum: https://anvil.works/forum/t/how-do-i-make-my-apps-look-nice-...
Happy Pythoning :)
Containers and container schedulers should be employed when it’s harder to not use them, at which point you can afford full-time SREs.
We also have a bunch of tutorial-cum-demo videos at: https://anvil.works/learn#tutorials
Or are you worried about clones?
I'd also discourage a patreon- or kickstarter-style offering for a B2B product, because it signals very clearly that you're not playing with the big fish.
As for signaling, one would not have to use those providers if they felt it did not fit their brand, and could roll their own platform. But if signaling that you want to "play with the big fish" is what one wants, most companies hire sales team who go out and play golf with prospects. Having an open source product and using other forms of funding certainly does not preclude doing that. (Though being a small bootstrapped business might make it more difficult).
While charging for use might seem like a good business model, I think an awful lot of potential customers will just never use it because of it. You may be able to find a model where you charge for the front-end page designer or something, but open source everything needed to run the site so that being locked in to a product you have to pay for and can't modify is less of a concern.
Right now we're taking it all as it comes, but we never want to lose our focus on accessibility: It's way too hard to build web apps with today's traditional tools, and we want to make it easier for everyone.
You might be interested in my talk from PyCon US this summer, where I talked about the compiler, and how we turn blocking Python code into non-blocking Javascript code:
I'm really not a fan of Python client side. Or RAD. Or closed source services.
And I'm hugely impressed by the potential of your product.
Good luck.
I never though I would say that one day. But don't listen to people asking you to open sourcing it now. You can always do it once you are profitable. But right now, you need money to get this going. And if your product does what you say it does, people will be happy to pay.
Although not to be locked up on the long run. You will need to address that one day. One day.
I want to second that, entirely.
Don't do it until you are comfortable.
My only suggestion is if you are closing the product for any reason, then open source the core as much as possible.
Being a penny pinching student, do you guys offer any discounts for students?
My question is about scaling - what are some large apps on this platform and how big do you think these apps can get in terms of db size and qps?
Our infrastructure is all on AWS and designed to scale horizontally, so we're pretty confident we can handle whatever traffic you throw at your app. (Ask about our dedicated-resource hosting plans!)
As for examples, it's a bit Catch-22. Our smaller customers, you haven't heard of; and our largest ones, we can't talk about in public. And a lot of it is internal/intranet stuff anyway.
One customer has kindly allowed us to talk a bit about their app - see https://news.ycombinator.com/item?id=15589020
I just had a video demo tutorial with your colleague @daviesian. He is such an intelligent and effective communicator. I learned a lot about your platform in a short 30-minute screen sharing.
In the crowded world of PaaS, human factors might have equal (if not more) importance than the technology magic. From my experience with Ian, I do see the bright future of your platform. You have a great team that people will trust.
Keep up the good work!
1. Great idea, just what "we" need in the language we need. (Python cloud RAD).
2. But I don't want to do all this work and be locked into your system forever. I want to be able to run this on Digital Ocean or AWS etc. if I want.
I think am open source version where you give people an option of hosting on your site at first would be the best compromise. Please consider it.
But its worse than that: if I don't have the security that I can leave, I won't dedicate time to use this.
I am happy to pay for the convenience and to try to create MVPs or proofs of service etc.
Anyway, it hardly matters what I think. Imagine what all the students and start ups think when they see it.
If you want control, you don't use a closed source saas RAD.
I would not use the product for myself. I would hate been locked down.
But I can see the value for others. For some, having one easy but clear solution is the important value.
That said, I agree with you that it's probably not their best approach right now. Even if it pains me to say so :)
So in a sense, Anvil is valuable at its price point for just as a web prototyping service. Most new developers obsess on things like "scalability" and "MVC separation", etc and in 95% of cases their creations never ever generate enough traffic to warrant any of that. I see Anvil as a tool that would allow developers to sketch out an idea, quickly iterate features based on feedback, and when warranted, move to a full production stack.
It does make figuring out your business model more complicated, but having SOME story for what will happen if you go out of business or start being a bad actor is something you need to figure out.
It isn't impossible though, our SAAS is Open Source and we survive, though yes, some customers do choose to self host. You just end up with fewer enterprise customers and more smaller clients.
But let's be real, if it became open source, I would just host it and never pay for it. They would have to do more work for less money. Hardly fair.
They can always start with a strong commercial offer, then later address the user locking issue. For them, I think it's a way better strategy. FOSS first is very hard to monetize. The Libre community is a terrible customer.
Doing it the other way around is wrong.
I don't know any actual numbers, but I think DHH and basecamp almost certainly profited from the popularity of Rails. That's probably up for grabs, since integrated web environments in non-js languages may become a big deal over the next decade.
The fact they are built with RoR is an implementation details. 37signals was very good at communication, Ror or not. Their blog and books were fantastic.
ROR as a FOSS may have helped, but I doubt it was instrumental.
EDIT: I agree with you that the product is good, and that the communication was excellent, but I disagree that the success of ROR was minor to the success of that company. It brought a tremendous amount of attention.
Specifically on the point of accessing your code:
- if you Architect your code well enough you can keep reasonable separation between generic Python code and code that is tightly-coupled to Anvil (I.e. keep it modular)
- and Anvil does actually provide a means for you to directly clone your Anvil app code locally from their servers using Git. This would give you a copy of all your code including front end templates etc.
I think tie-in is always a consideration but we are increasingly getting into that situation with things like AWS, and so we really must balance the pros and cons. I’d rather by tied in and profitable if I’m trying to get something off the ground...
I'd ideally want to try it out in production with a real, small commercial job. But if I do and decide not to expand my use of the platform, then I'm committed to a $600/year hosting deal for a small client...
And I won't use it on a bigger client at first due to the risk of lock-in.
In fact - lock-in is the biggest problem with using this. It's a paradox. I'll only willingly get locked in to platforms that I'm 100% happy with and I am only 100% happy when I've been using a platform for a reasonable length of time.
Otherwise I risk having to rewrite a 5 year old website for a client out of my own pocket when you decide to pivot or you run out of cash/luck.
Starting from scratch seems to be the only option here, so I would hesitate to even start a small prototype. Which is a shame because I really like your model.
Their pricing page doesn't show anything about usage limits and if it is "per site" or "per domain" or "per project".
Usage limits are pretty soft right now (depends heavily on what you do in your code and how hard you're hammering our servers), but the general intention is to charge you more as you scale up your team, rather than because you got a few thousand users.
My issue is if being used for websites, on average our sites get ~50k visitors a month or even spikes with that amount.
The same goes for complexity of the system, for simple html sites it will not matter much but for very dynamic apps this will require a lot of CPU time.
[heads over now]
So if we build something that becomes wildly successful, we could suddenly be in a world of hurt if our site is deemed too heavy and we're throttled or worse. It would be like Pokemon Go - big explosion, lots of tiny pieces, customers gone.
I urge you to have some kind of professional plan with guaranteed tiers. Otherwise, only naive people or people who really don't care about the future will use it (outside of the prototyping case everyone else is mentioning).
On the other hand, it would be the perfect tool for someone on upwork or the like to do a gig ultra fast, leaving the client to deal with all the future pains. But since most projects end up not huge and successful, that might be just fine!
Edit: My son is going to love this when he gets home!
It seems good enough that you could push the prototype live as an MVP.
I am interested if you grow to something to the stage where you want to move off this and onto something more customised, do you have access to be able to properly migrate the DB somewhere else?
https://twitter.com/anvil_works/status/924648315983155200
As to your second point - yes, that's a common pattern. We see people going "oh, let me just sketch out the UI...well, I'll add a bit of code...oh, look, it's in production and scaling!"
We do have a lot of support for integrating with external systems, so it's easy to gradually move off from (or on to) Anvil. External access to the database is just the start of it :)
I don't think I would use it for anything production though without an option to export the app (database & source for my app). I would pay the listed monthly subscription fees in a heartbeat. That is a no brainer for the time this appears to save but I have learned the hard way too many times in the past on being locked into a platform for business crucial stuff.
I would be fine even paying a one-time fee of few hundred dollars to be able to export my app if I need to. Simply for the peace of mind of not being locked in if something happens.
But now I'd probably still take the upfront cost to get a bigger app started without tie-ing in with a service. For rapid prototyping it seems awesome!
One thing I really don't like about it is how the free pricing level doesn't have authentication. Seems like I can't really build a toy project that I then "graduate" to a real app. Or maybe the plan is that you build it as a private app as a toy and then start paying $45/mo when you want to make it public and have auth?
I feel like if the free level was limited by something else, like database size or something?
I can understand why they want to drive people to revenue-generation. Just seems like a feature that hurts more than it helps, by keeping people from even trying it?
I’m excited to try the Python-based Anvil for quickly prototyping interactions to share with my product and dev teams.
Edit: Typo!
.NET has evolved into a totally different beast so I don't use it any more. This framework brings back the simplicity that I feel has been lost from drag and drop tools.
Drag and drop tools exist for the web, but there's nothing that introduces and organises the use of simple programming languages within the mix - at least that I know of - so this is definitely going into my list of cool tools.
The market is heating up though, we are growing fast and our competitors do as well. Moreover, Google (AppMaker) and Microsoft (PowerApps) have entered the race in the last two years.
Looking forward to seeing more of Anvil.
My three questions:
- I have a client whose app sits idle but then gets hit by maybe 300 concurrent users, all reading and writing within a few seconds of each other - do you have anything in place to deal with that kind of spike in usage?
- It looks like it's designed to be always online - any plans to make it offline-and-sync capable?
- Any documentation or hints on automated testing?
We're starting to post some larger examples (check out our "download portal" example at https://anvil.works/learn#examples - I'm also working on a video series building a SaaS app over the course of a few hours). But the biggest apps are, of course, our customers', and we can't really publish them as examples.
Their control panel drives companies' entire online marketing operation - creative, targeting, performance, and more - across multiple advertising services. That's a whole lotta UI. Their back end drives the advertising platforms' APIs (eg Google and Facebook), and it all hooks into great big machine learning operations that run on big beefy servers out in EC2. Not just a pretty CRUD app, that's for sure.
(Unfortunately, they know what their services are worth, so I can't just point you at a live demo ;) )
The wonderful thing about the Uplink is that the boundary between "inside Anvil" and "outside Anvil" can be very fuzzy, because you use the same APIs. (See my "escape hatch" post above)
That said, even with the standard plans you can plug into your own Postgres database from server code (just `import psycopg` - it's only Python, after all). And using the Uplink, you can access Anvil's database from your code anywhere on the internet, with the same API as Anvil server code.
Installing and running it is typically a single 'docker-compose' command. If you're interested in this option, please do drop us an email at sales@anvil.works.
Also things like bulk uploads to a table for migration, would I have to write a service for this? I have an app I would like to migrate that has a sqlite table with static data in it, that I could see using this. I suppose I could use the server connector, but what other tools does this have?
https://forum.bubble.is/uploads/default/optimized/2X/8/856f6...
It's a library you `pip install`, which lets you connect Python code running anywhere in the world to your Anvil app. Everything you can do from Anvil server code, you can do from your Python code, wherever it's running. You can define server functions, HTTP endpoints, access data tables, etc.
We have customers controlling IoT devices with it (like that Raspberry Pi video). We also have companies driving big machine learning jobs on EC2 servers with tons of GPUs - but with all the UI and housekeeping in Anvil.
One, if you're using it commercially, it's going to pay for itself pretty quickly. I rarely do client projects for less than several thousand pounds; I reckon I could probably churn a lot of them out using this in half the time.
Two if you're not using it commercially, it's still a very low cost; maybe more than pure hosting but it does a lot more than just hosting.
I’m always upfront about the tools I use with my clients as the value isn’t in the tool, it’s in their requirements.
But being able to move away quickly is important to me because I have client relationships (and production code) that is 9 years old.
(I also don’t consider myself a contractor, more a consultant - a semantic difference but an important one)
Our consulting rates are way above that per week.
We'll also be adding more built-in themes before long :)
On the other hand, I gotta give it to them that it does some things well. I definitely see it solving problems in industries that need custom software but simply don't have the resources or capital to get a completely custom, from-scratch system.
On-site installation
For when you need to keep sensitive data or apps inside your firewall. Anvil on-site installations allow you to develop and deploy your apps entirely in-house.
Also, a great job with the demo video explaining what it is.
The only feedback I could give for now is that the "Free" plan should include some extra feature from the paid plans (e.g. User Authentication, Custom Domains, etc.) as it seems way to basic and the first paid plan is quite expensive.
I may sound like a cheapskate but you'll pull in the right crowd if you tax other metrics like traffic/bandwidth/cpu/ram/etc.
Can you explain what are the differences between Anvil and Bubble? I am currently using Bubble right now to make web apps. What makes Anvil better?
* Front-end code is compiled from Python to JS with Skulpt (http://skulpt.org)
* The back-end code runs in a custom Python sandbox. Calls to server functions go over a secure web socket (this lets us do fun things like returning database rows directly from server functions, rather than faffing with REST APIs all day)
* The built-in database (Data Tables) is based on Postgres, using its JSONB and GIN indexing to create a table you can search efficiently on any column. This also means that things like transactions are properly robust.
(Right now, it does run in the browser, but we'll be moving it to the back-end soon to improve performance. For now it's good enough.)
From the Skulpt website: "Skulpt is an entirely in-browser implementation of Python."
It sounds like you implemented python in JS, so there is no compilation to JS. The application code is always python and is evaluated on the client, no?
If you move it to the back end, would that not be something like Trascrypt?
Skulpt has a separate compiler stage that compiles Python to JS, and a runtime library. There's no need to eval() that code in the same JS VM that compiled it, so it's totally feasible to ship the JS to the client and run it there.
Bottom line: Traditional web dev has starved us of decent tool support. Give us even a really basic autocompleter (especially one that knows about what's happening in the server and database) and it feels like borderline magic :)
Multi-tenant/single-DB is a pretty common and straightforward pattern with a lot of support in Anvil (eg restricted views, as described in the video).
I'm also currently working on a multi-part video series, showing the creation of a SaaS product, from scratch to monetisation. Sign up for our mailing list, and watch this space :D
(Nothing magic - it's just a database. Even user records are just table rows, so you can link or categorise them however you like!)
However, we run full CPython (2.7 and 3.6) on the server, so any language feature you like is just a function call away :)
As Py2 is EOL in about two years it feels risky for anything to be built on it.
The client-side code is Python 2 only for now, but we're already upgrading our Python-to-Javascript compiler to include Python 3 syntax.
https://twitter.com/anvil_works/status/924352019258920960
He just copied and pasted his code from the notebook into an Anvil server function, and it ran first time! It's all just Python, at the end of the day.
Urk? Firefox is an officially supported platform for the editor. What didn't work, and what version of FF are you using?
Once you've written an app, it should work in everything since IE11.
We've now been in touch by email about this bug, and we'll make sure a fix is pushed ASAP!
The world does not need more interpreted languages on the backend.
Visual UI layout is cool for beginners but almost useless for serious projects. Plus if you're a beginner (or a non-programmer) maybe an existing CMS is better? e.g. WordPress.
If a project started with this tool was to ever evolve and get big, I can't imagine that maintaining it will be anything but a nightmare.
Regarding CMS, I view those as high level languages. And in that regard I think we can improve on them a lot.
I think this is already what is happening. Computers now are orders of magnitude faster than they were 15 years ago, and yet fundamentally nothing really got better. We just have more people producing lesser quality programs. While producing something is easier than before, the new things are not necessarily of good value, because a lot of the tools that enable this are layers upon layers of abstractions and virtualization (e.g. Electron).
I'm not sure that this is any good.
And fundamentally this is not that different from VB6, for example.
Writing code is not the same. In general, programming tools _are_ getting better (text editors, debuggers, IDEs, etc).
The only barrier to non-programmers is learning how to program.
It's the same with writing. The tools _are_ available. But you still need to know how to write. I mean how to put words together in a way that people would want to read.
personally, I'm going to stick to flask and django.
this is nice and all... but you still have to learn python to get it going. My preference is to learn Python/Flask via books, tutorials, and as part of a big community (websites/forums, IRC, etc).
But... I really don't see the benefit of this, even after watching some videos.
the drag and drop stuff? that's just html and css (child's play)
python? that's still python.
I'd much rather just open a blank Ubuntu 16.04 server on DigitalOcean and pull my repository from github. I.e. work like a real developer :)
I wouldn't mess with Anvil, personally. I'd prefer to do code by hand, with a framework that has been around for a while.
But come on. 6 minutes with DB, responsive design, registration (including social auth or AD) and online deployment ? I can't top that. No even close. Even with boostrap and pythonanywhere. And I know the freaking API by heart while most people are just trying to figure out what's going on.
This stuff is amazing for somebody who just want to fiddle with a CRUD app. The ratio investment / return is crazy.
Wish Django had a mature integrated client-side UI toolkit like this, I'm amazed given how advanced django.contrib.admin is that the Django team hasn't already generalized much of the admin components. If anyone is aware of something like this already let me know, with React eating the world it looks like DRF + React is the only way to go these days..
Yes you can! Check out all the code examples in: https://anvil.works/doc#forms