title: "Introducing Vendure" date: 2019-02-11T10:27:46+01:00 draft: false author: "Michael Bromley" images:
- "./blog/introducing-vendure/introducing-vendure.jpg"
Vendure is a new open-source headless e-commerce framework built on Node.js with TypeScript and exposing a GraphQL API. Today it is available to try with its first alpha release. In this post I'll outline some of the of major features and give some background to its development.
{{< figure src="/blog/introducing-vendure/introducing-vendure.jpg" >}}
The term "headless" or "API-first" refers to an architecture in which the server does not concern itself with rendering HTML pages. Instead, it exposes an API which can then be consumed by a client application which can be developed and evolve independently of the back end. This is in contrast to the traditional "monolithic" e-commerce frameworks wherein the storefront is part of the back-end framework and is typically customised via themes or templates.
Headless architecture is becoming increasingly popular with the advent of powerful browser-based frameworks, mobile applications, and the trend toward progressive web apps (PWA). Several of the established e-commerce frameworks are moving towards this approach, and there is a crop of new front-end solutions such as Vue Storefront and Deity which build upon this trend.
Vendure exposes a GraphQL API, through which all interactions with the back end are conducted. GraphQL offers a number of advantages over REST-like APIs, such as the ability of the client application to ask for only the data that it needs, and the improved tooling afforded by static typing. The 2018 developer survey conducted by npm (the package manager for JavaScript) had this to say about GraphQL:
GraphQL, tracked by its most popular client library Apollo, continues to explode in popularity. We think it’s going to be a technical force to reckon with in 2019.
{{< figure src="/features-code.png" >}}
TypeScript is a statically-typed superset of JavaScript. Also from the 2018 npm survey:
Something of a surprise, however, was TypeScript, with 46% of survey respondents reporting they use Microsoft’s the type-checked JavaScript variant. This is major adoption for a tool of this kind and might signal a sea change in how developers write JavaScript.
Since the survey quoted above, a number of major JavaScript projects have announced a switch to TypeScript, including Vue, Jest and Yarn. It is also gaining massive traction in the React ecosystem. It seems it will take the place as the de facto language for large-scale JavaScript projects. Note: Vendure also works just fine with JavaScript.
{{< figure src="/features-dev.png" >}}
The development of Vendure is sponsored by Ken Bromley Art Supplies, a leading UK art supplies retailer which has been in the e-commerce business for over 15 years, starting from a static HTML site built with Netscape Composer.
As our business expanded, our requirements outgrew the capabilities of the available off-the-shelf e-commerce solutions (even Magento was 5 years away from its first release at that point). So I did what any over-confident youngster would do; I rolled up my sleeves, dived into a couple of 6-inch-thick PHP & MySQL books (replete with CD ROMs in the back cover) and built one myself.
This solution has served us well, but over the years it became apparent that we needed something new. The e-commerce software landscaped had changed drastically in the intervening decade or so, but broadly there are two options available to retailers looking to build a store:
For a number of reasons (which could fill an entire blog post) we chose the second option. So I started to look around at what e-commerce frameworks were available. For context, I've spent the past five years primarily as a front-end developer, mainly working with TypeScript. For three of those years I was part of the team building the pioneering Gentics Mesh headless CMS. So I had a number of items on my wish list:
There are a number of excellent frameworks out there which answer one or two of these criteria - Spree for Ruby, Sylius for PHP, Saleor for Python, ReactionCommerce for JavaScript and so on.
But I saw a gap for something that aimed for all of the above, and with Vendure I aim to fill it!
This is an alpha release and is not intended for production use. However, I'd love to get feedback on the implementation so far. Over the coming months I'll be working on rounding out the features for a beta phase, including:
A primary goal of mine is to bring a simple and enjoyable developer experience to e-commerce development. To that end I've worked to make installation as painless as possible. As the video below demonstrates, you can be up and running with Vendure in a matter of minutes.
Please try it out and let me know your feedback!
{{< vimeo id="315862294" >}}