Avo as a starter kit

The difference between Avo and Rails starter kits

January 20, 2023 13:55

TL;DR

Avo is a gem that helps you build any type of CMS that you need on Ruby on Rails.

Long version

I often get the question "How is Avo different from other starter kits?". And the simple answer is that they provide different functions.

Starter kits are Rails apps with added gems and functionality. They give you a ready-to-use app to develop (usually) a SaaS application.

Some pieces of functionality they provide are:

  • authentication; Users can log in
  • authorization; Users have restricted access to your content based on their role
  • multi-tenancy; Users have accounts or teams on which they can use your services
  • assets management; You have a theming system and/or the assets system already set up
  • APIs; You have API endpoints that you can start to develop and use
  • CI integration built-in

Some provide less, and some provide more, but this is your application's starting point.
Next, after you clone the repo and get the starter kit, you must start building your app. The unique business logic that brings value to your customers or team members.
This business logic can be split into a few parts like (but not limited to) back-end logic, queue systems, ETL, APIs, and UI work.
When working on the UI and data management (view and update the database records), you traditionally use generators, set up business logic in controllers and routes, and create and maintain views for different pages and partials.

The CRUD feature

That is where Avo comes in. We figured out that most apps do kind of the same thing.
You have a place where you see a list of items; you click on one to see the details, then click on an "Edit" button to get a form to update those details.
You can create items, search, filter, sort, and apply actions to them.
Those things may look different in different apps, but that's what you usually do in an app.

We took those patterns and extracted away all of that UI work and some of the business logic needed to manage your record.

Example time

We're going to use one of the most basic examples. Let's say you want to build a blog. In your back-office, you'll need a way to allow your team to manage your articles.
Instead of generating a new controller, set up all the actions needed, create a route, then create (or edit) erb partials, fiddle with the CSS and JS assets to make everything look good, set up field-level error validation, make it look pretty in your current layout, and other boilerplate operations, you can generate one resource file and let it know what you want to display and update.

class PostResource
  field :title, as: :text
  field :body, as: :trix
  field :category, as: :select, enum: Post.categories
  field :comments, as: :has_many
end

Just from glancing at this, you know what it will look like. That will create for you a paginated listing of all your posts, with dedicated pages to view the details of a post and its comments, a page where you can edit the properties with all the business logic of actually writing to the database, a way to delete them, create new ones, and manage the comments.
You get a lot for six lines of code.

That is just the surface. The CRUD API goes very deep into advanced validations, controlling different states (read-only, required, default values, etc.), conditional visibility, making them sortable, filterable, dynamic, and computed, and applying different styling to them.
The resource itself (PostResource) takes a large amount of customization from custom scopes, search queries, records ordering, and more.
Of course, it supports advanced authorization rules to permit or restrict access to different parts of your app and on the record-level and to hide or show buttons or links.

That is the simplicity of Avo. A straightforward interface in which you declare what you want and where you have the power to go deep and customize it when you have more advanced use cases.

The Dashboards

Another common feature is that apps have dashboards. In the same familiar way, Avo provides an API to create dashboards and cards.
You give the chart type and the data you crunched for that chart, and Avo takes care of the rest. So you don't need to meddle with CSS and JS files to set everything up, but jump straight to business and get your work done fast!

The Custom content

I'm a developer, and I know I want to know that if I'm going to use something that's going to do so much for me, I can customize it when I need it. So that's why Avo is customizable on so many levels.

  • Custom fields add even more ways to interact with your data
  • Custom resource tools inject partials to your resources' pages
  • Custom tools are new pages where you can add any type of content you'd like
  • Insert CSS and JavaScript assets to tailor the experience as you need it
  • You can customize every data query on any screen
  • Add Stimulus JS controllers
  • and so much more

I ensured that you have all the outlets necessary to hook in and build whatever Avo doesn't provide out of the box.

So it's genuinely an app development platform that can build fantastic business apps.

What is a business app?

A business app is at the intersection of a back-office, internal tool, and admin panel. It's something you can have for team members or give out to your customers to use as the interface to your app.
Shopify's admin panel, where one manages a store, is a business app. Airbnb is one where you manage your bookings. Reddit is one where you post and manage your content.
So, any app can be a business app.

So, how is Avo different from Starter kits?

The main difference is that it does not provide the parent app on which it's mounted. Instead, you need to generate that.
Avo isn't opinionated. It works with devise, warden, omniauth, basic auth, or anything custom; it lets you set up your own roles system and other gems you might want to use. It's a BYOG (Bring Your Own Gem) system.

Avo will sit next to your app (as an engine) and provide you with the tools to create the UI you need to manage and protect your data.

To see an example of what you can build with Avo, check out the demo app.

That is not all. When you start to build with Avo, you get access to proper documentation and an active Discord and GitHub community.

So, if you were wondering if Avo is a good fit for your project, wonder no more and give it a try today at https://avohq.io. The setup is really quick!

Twitter: https://twitter.com/avo_hq
Repo: https://github.com/avo-hq/avo