DEV Community

Meredydd Luff
Meredydd Luff

Posted on • Originally published at anvil.works on

Why We Open Sourced the Anvil App Server

Why Open Source?

A little while ago, we open-sourced the Anvil App Server. The community reaction has been great, even a little overwhelming (yes, every reply to that announcement really did land in my inbox!). We’ve already incorporated a bunch of that feedback into our version 1.2 release. But we keep getting asked, “ Why did you open-source such a core part of your product?

Why do this at all?

Anvil is a tool that makes it as simple as possible to build a web app. We do that by enabling you to build the whole application in one language, Python.

Yes, really. All of these, for a simple web app.

Yes, really. All of these, for a simple web app.

If you want to build a web application today, it’s a mess. Even for the simplest application, you’ll need to know HTML, Javascript, CSS, Python, SQL, React, Redux, Bootstrap, Sass, Webpack…and that’s a simple app. (Trust me, it gets way worse.)

But even then, you’re not done! You need to know all about Git, about AWS, about how to secure a Linux system, how to set up a database…and then you’re on call to keep it all running. Forever.

Or…you could use Anvil. Build your UI with a drag-and-drop designer, write all your logic in Python, and we’ll take care of the rest. We replace that whole teetering stack with “just write Python”. (Intrigued? We’ve got tutorials.)

Simple hosting is part of that.

The web platform is broken , and Anvil is our attempt to fix it. And, because there is so much complexity in deploying a web app, a cloud-hosted service was the best way to provide the simplicity we want. That way, you can build your app in the Anvil Editor, and make it live on the Internet with one click.

But we kept hearing from people who said, “that’s great, but…”

  • ”…but I need to run this on an offshore platform without reliable internet access”
  • ”…but I want to package my app into an IoT device I sell”
  • or simply, ”…but if I’m putting my eggs in this basket, how can I be sure I can still run my app in ten years’ time?”

These are all good points! A cloud service isn’t the right solution for everyone. If we want to serve these users, there’s got to be some way for them to get their apps out of Anvil and run them locally, under their own complete control.

Open Source: Escape hatch, not an ejector seat

We believe in escape hatches, not ejector seats. At conferences, we sometimes get asked, “can I export this as a Flask+JS app?”. Sure, it would be possible – we could generate a server package, compile the client-side Python to Javascript, and spit out a classic web app. But it would have serious drawbacks, because:

Not a comfy ride.

Not a comfy ride.

Code generation is an ejector seat. Generated code is better than nothing – at least you can edit it! But the moment you edit that code, you lose all the benefits of the system that generated it. If you’re using Anvil because of its drag-and-drop editor and Python in the browser, why should our locally-hosted users have to use vim and Javascript?

So we did it the right way: we open-sourced Anvil’s runtime engine. It’s the same code that serves your app in our hosted service, and it represents your app the same way. You can edit your code with a text editor, run it, then git push it back into our online IDE. It’s not an ejector seat: there’s no explosive transition. It’s an escape hatch: you can climb out, and climb right back in.

What about our business model?

Anvil was never meant to be one of those enterprise low-code systems that charge you $20/mo for each person who uses your app. Anvil is a developer tool. The apps you develop are yours. Enabling you to run them on a Raspberry Pi is cool, but it doesn’t change our business model.

We’re doing what we always were: We make and sell a development tool that makes it drastically simpler to build web applications. We provide hosting for Anvil apps. We offer the entire development-and-hosting platform on-site for enterprise customers. And, of course, we offer a free plan so that everyone can use Anvil for hobby or educational purposes – or to start building something and see how it goes.

We’ve open-sourced the Anvil App Server for the (relatively small) number of people who need it, and to provide the ultimate insurance policy. Sure, you can build an app with vim and host it yourself, without even registering an account with us (we’ve got docs to show you how!). But the Anvil Editor is the world’s easiest way to build a web app, and our hosted service is the easiest way to deploy it – so that’s what we expect most of our users to continue doing. And you can build with confidence, knowing that the open-source code is right there if you need it.

Try it yourself

If our development philosophy resonates with you, why not try Anvil yourself?

Go on – it’s free, and now it’s open source too:

Try Anvil

or

Read a tutorial

Top comments (0)