<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: dailson-igo</title>
    <description>The latest articles on DEV Community by dailson-igo (@dailsonigo).</description>
    <link>https://dev.to/dailsonigo</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1129364%2F3043784f-a05a-4434-807b-3943a7db9b24.png</url>
      <title>DEV Community: dailson-igo</title>
      <link>https://dev.to/dailsonigo</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dailsonigo"/>
    <language>en</language>
    <item>
      <title>Ready System with a Modern Stack and Many Features Using Ruby 3.2, Rails 7.0 and Avo 2</title>
      <dc:creator>dailson-igo</dc:creator>
      <pubDate>Mon, 18 Sep 2023 00:50:59 +0000</pubDate>
      <link>https://dev.to/dailsonigo/ready-system-with-a-modern-stack-and-many-features-using-ruby-32-rails-70-and-avo-2-ni4</link>
      <guid>https://dev.to/dailsonigo/ready-system-with-a-modern-stack-and-many-features-using-ruby-32-rails-70-and-avo-2-ni4</guid>
      <description>&lt;p&gt;Avo is much more than an admin panel, and you don't need to spend a lot of time understanding that. Built on top of Ruby on Rails, one of the most productive languages ​​and frameworks, it has a modern stack using Tailwind CSS, &lt;a href="https://github.com/hotwired/turbo"&gt;Turbo&lt;/a&gt; and &lt;a href="https://github.com/hotwired/stimulus"&gt;Stimulus JS&lt;/a&gt;. Better to leave the Avo overview for a next post.&lt;/p&gt;

&lt;p&gt;If you still don't know Avo, you should at least appreciate all the care they took to deliver an interface that, in my opinion, is very good, guaranteeing a better experience for users.&lt;/p&gt;

&lt;p&gt;So let's download from GitHub and run locally a system with many of its features.&lt;/p&gt;

&lt;p&gt;TL;DR:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Get a Avo 2 Pro trial license;&lt;/li&gt;
&lt;li&gt;Ruby 3.2 language and the Rails 7.0 framework installed;&lt;/li&gt;
&lt;li&gt;Download the Avo demo from GitHub;&lt;/li&gt;
&lt;li&gt;Configure to access PostgreSQL;&lt;/li&gt;
&lt;li&gt;Change the Gemfile to use the latest Ruby 3.2;&lt;/li&gt;
&lt;li&gt;Enter Avo license&lt;/li&gt;
&lt;li&gt;Install packages and dependencies;&lt;/li&gt;
&lt;li&gt;Build CSS assets;&lt;/li&gt;
&lt;li&gt;Create and initialize the database;&lt;/li&gt;
&lt;li&gt;Start the Rails server;&lt;/li&gt;
&lt;li&gt;Ready, browse to your heart's content;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  1. Get a Avo 2 trial license
&lt;/h2&gt;

&lt;p&gt;Avo, in addition to the community version, has other types of licensing. To have broad access to the features, we will use an Avo 2 Pro trial license.&lt;/p&gt;

&lt;p&gt;Access the &lt;a href="https://avohq.io/"&gt;Avo&lt;/a&gt;, and click on &lt;code&gt;Sign Up&lt;/code&gt;. After completing registration, click on your &lt;code&gt;profile icon&lt;/code&gt; and select &lt;code&gt;Subscriptions&lt;/code&gt;, then &lt;code&gt;Choose a plan&lt;/code&gt;, choose the &lt;code&gt;Pro&lt;/code&gt; version and click on &lt;code&gt;Start 30 day trial&lt;/code&gt;. The system URL is not required, click &lt;code&gt;Subscribe&lt;/code&gt;. Now you will have your key to use the Avo 2 Pro version for 30 days.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--b8aV2b26--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g33uqihy2bn3bb94ol3d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--b8aV2b26--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g33uqihy2bn3bb94ol3d.png" alt="Avo Licenses" width="800" height="372"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Ruby 3.2 language and the Rails 7.0 framework installed
&lt;/h2&gt;

&lt;p&gt;You probably installed Ruby with asdf, Rbenv or RVM. Check if you have ruby ​​and rails installed:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ ruby -v
ruby 3.2.2 (2023-03-30 revision e51014f9c0) +YJIT [x86_64-linux]
$ rails -v
Rails 7.0.8
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  3. Download the Avo demo from GitHub
&lt;/h2&gt;

&lt;p&gt;Avo 3 is in the final testing phase for release, but in this tutorial we will use the latest stable version of Avo 2 compatible with the repository &lt;a href="https://github.com/avo-hq/main.avodemo.com"&gt;demo&lt;/a&gt;. Download the &lt;code&gt;pre-avo-3&lt;/code&gt; branch to your Ruby on Rails project folder.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ git clone -b pre-avo-3 https://github.com/avo-hq/main.avodemo.com
Cloning into 'main.avodemo.com'...
remote: Enumerating objects: 2540, done.
remote: Counting objects: 100% (682/682), done.
remote: Compressing objects: 100% (290/290), done.
remote: Total 2540 (delta 495), reused 503 (delta 388), pack-reused 1858
Receiving objects: 100% (2540/2540), 7.92 MiB | 1.65 MiB/s, done.
Resolving deltas: 100% (1463/1463), done.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  4. Configure to access PostgreSQL
&lt;/h2&gt;

&lt;p&gt;Go to the main.avodemo.com project folder.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ cd main.avodemo.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Open the project in your favorite editor or IDE.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ code .
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The Avo 2 demo uses features that are not supported in SQLite3, so we need to configure PostgreSQL username, password and other necessary parameters in the &lt;code&gt;config/database.yml&lt;/code&gt; file. Don't forget to configure it for development and test environments, or configure it on default for all environments.&lt;/p&gt;

&lt;p&gt;Save Changes.&lt;/p&gt;

&lt;p&gt;If you have not yet used PostgreSQL from within a Ruby on Rails application, you will need to install the &lt;code&gt;libpq-dev&lt;/code&gt; package, required by the pg gem.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ sudo apt install libpq-dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  5. Change the Gemfile to use the latest Ruby 3.2
&lt;/h2&gt;

&lt;p&gt;Open the Gemfile and update the file to match the latest version of Ruby 3.2 installed on your machine.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ruby "3.2.2"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save Changes.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Enter Avo license
&lt;/h2&gt;

&lt;p&gt;Edit the &lt;code&gt;config/initializers/avo.rb&lt;/code&gt; file&lt;br&gt;
and check if the &lt;code&gt;pro&lt;/code&gt; license type is defined and if the key code obtained in step 1 was inserted or passed as an environment variable.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;config.license = 'pro'
config.license_key = 'dd8....586b'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In your case, you will put the full key in the file or environment variable.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Install packages and dependencies
&lt;/h2&gt;

&lt;p&gt;All commands from here onwards must be executed in the project root directory.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ bundle install
Using rake 13.0.6
Using concurrent-ruby 1.2.0
Using i18n 1.12.0
(... many packages ...)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  8. Build CSS assets
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ rails tailwindcss:build
(...)

Done in 501ms.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  9. Create and initialize the database
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ rails db:setup --trace
** Invoke db:setup (first_time)
** Invoke db:create (first_time)
** Invoke db:load_config (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:load_config
** Execute db:create
Created database 'avodemo_development'
Created database 'avodemo_test'
** Invoke environment 
** Invoke db:schema:load (first_time)
** Invoke db:load_config 
** Invoke db:check_protected_environments (first_time)
** Invoke db:load_config 
** Execute db:check_protected_environments
** Execute db:schema:load
** Invoke db:seed (first_time)
** Invoke db:load_config 
** Execute db:seed
** Invoke db:abort_if_pending_migrations (first_time)
** Invoke db:load_config 
** Execute db:abort_if_pending_migrations
** Execute db:setup
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note that the &lt;code&gt;rails db:migrate&lt;/code&gt; command will not work. If necessary, drop the database with &lt;code&gt;rails db:drop&lt;/code&gt; and run &lt;code&gt;rails db:setup&lt;/code&gt; again.&lt;/p&gt;

&lt;h2&gt;
  
  
  10. Start the Rails server
&lt;/h2&gt;

&lt;p&gt;You are ready to start your Rails server. Note that the Avo 2 demo was configured to use port &lt;code&gt;3020&lt;/code&gt;, rather than the default port 3000.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ rails server
=&amp;gt; Booting Puma
=&amp;gt; Rails 7.0.4 application starting in development 
=&amp;gt; Run `bin/rails server --help` for more startup options
Puma starting in single mode...
* Puma version: 5.6.4 (ruby 3.2.2-p53) ("Birdie's Version")
*  Min threads: 5
*  Max threads: 5
*  Environment: development
*          PID: 246413
* Listening on http://127.0.0.1:3020
* Listening on http://[::1]:3020
Use Ctrl-C to stop


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  11. Ready, browse to your heart's content
&lt;/h2&gt;

&lt;p&gt;If the Avo 2 Pro license key was not entered correctly, you will be informed after authenticating in the system.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2tTBLiCB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ng78vps562566vv5znvp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2tTBLiCB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ng78vps562566vv5znvp.png" alt="Authentication screen" width="800" height="604"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--uTCfnPjw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ozma727n5hxu7pqjb0lg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--uTCfnPjw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ozma727n5hxu7pqjb0lg.png" alt="Inside Avo, on the dashboard screen" width="800" height="604"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ruby</category>
      <category>rails</category>
      <category>avo</category>
      <category>tailwindcss</category>
    </item>
  </channel>
</rss>
