<?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: Malek Hijazi</title>
    <description>The latest articles on DEV Community by Malek Hijazi (@malekhijazi).</description>
    <link>https://dev.to/malekhijazi</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%2F469611%2F3beacd58-bf49-438a-997b-b2dbc66d6d03.png</url>
      <title>DEV Community: Malek Hijazi</title>
      <link>https://dev.to/malekhijazi</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/malekhijazi"/>
    <language>en</language>
    <item>
      <title>Setting up projects &amp; SDKs for Sentry self-hosted</title>
      <dc:creator>Malek Hijazi</dc:creator>
      <pubDate>Wed, 23 Mar 2022 14:25:34 +0000</pubDate>
      <link>https://dev.to/malekhijazi/setting-up-projects-sdks-for-sentry-self-hosted-3a57</link>
      <guid>https://dev.to/malekhijazi/setting-up-projects-sdks-for-sentry-self-hosted-3a57</guid>
      <description>&lt;p&gt;This blog is the 5th post in the Sentry self-hosted &lt;a href="https://theappsguy.dev/series/sentry" rel="noopener noreferrer"&gt;series&lt;/a&gt;. In this article, we will be going through the process of creating a project with Sentry to track and monitor performance and errors. This post will assume you already went over the previous posts in the series to set up Sentry.&lt;/p&gt;

&lt;h2&gt;
  
  
  Creating a project
&lt;/h2&gt;

&lt;p&gt;The first thing you need to do is create a project on sentry. To do that head to your Sentry self-hosted domain and click on the projects in the side menu: ![Screen Shot 2022-03-17 at 2.40.42 PM.png](&lt;a href="https://cdn.hashnode.com/res/hashnode/image/upload/v1647520846126/-" rel="noopener noreferrer"&gt;https://cdn.hashnode.com/res/hashnode/image/upload/v1647520846126/-&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, create a project using the button at the top right: &lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1647520879478%2FNympGtzmr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1647520879478%2FNympGtzmr.png" alt="Screen Shot 2022-03-17 at 2.41.15 PM.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Choose the needed SDK from the list of platforms&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1647520960001%2FAs8yE70N0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1647520960001%2FAs8yE70N0.png" alt="Screen Shot 2022-03-17 at 2.42.34 PM.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Add a project name and select the team (you can also create a new team) &lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1647521000444%2FtlGDh52CO.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1647521000444%2FtlGDh52CO.png" alt="Screen Shot 2022-03-17 at 2.43.13 PM.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click on create project.&lt;/p&gt;

&lt;p&gt;After creating, it will redirect you to a setup page where they have a tutorial on how to set it up. Follow the instructions and you should be good to go&lt;/p&gt;

&lt;p&gt;I will setup Vue.js as an example, others should be similar (but platform specific):&lt;/p&gt;

&lt;h1&gt;
  
  
  Example Vue Configuration
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Installing dependency
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Using yarn
yarn add @sentry/vue @sentry/tracing

# Using npm
npm install --save @sentry/vue @sentry/tracing

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  Configuration
&lt;/h2&gt;

&lt;h3&gt;
  
  
  For Vue 2
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import Vue from "vue";
import Router from "vue-router";
import * as Sentry from "@sentry/vue";
import { BrowserTracing } from "@sentry/tracing";

Vue.use(Router);

const router = new Router({
  // ...
});

Sentry.init({
  Vue,
  dsn: "dsn_to_your_instance",
  integrations: [
    new BrowserTracing({
      routingInstrumentation: Sentry.vueRouterInstrumentation(router),
      tracingOrigins: ["localhost", "my-site-url.com", /^\//],
    }),
  ],
  // Set tracesSampleRate to 1.0 to capture 100%
  // of transactions for performance monitoring.
  // We recommend adjusting this value in production
  tracesSampleRate: 1.0,
});

// ...

new Vue({
  router,
  render: h =&amp;gt; h(App),
}).$mount("#app");

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

&lt;/div&gt;



&lt;h3&gt;
  
  
  For Vue 3
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { createApp } from "vue";
import { createRouter } from "vue-router";
import * as Sentry from "@sentry/vue";
import { BrowserTracing } from "@sentry/tracing";

const app = createApp({
  // ...
});
const router = createRouter({
  // ...
});

Sentry.init({
  app,
  dsn: "dsn_to_your_instance",
  integrations: [
    new BrowserTracing({
      routingInstrumentation: Sentry.vueRouterInstrumentation(router),
      tracingOrigins: ["localhost", "my-site-url.com", /^\//],
    }),
  ],
  // Set tracesSampleRate to 1.0 to capture 100%
  // of transactions for performance monitoring.
  // We recommend adjusting this value in production
  tracesSampleRate: 1.0,
});

app.use(router);
app.mount("#app");

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

&lt;/div&gt;



&lt;p&gt;A few things to note that must be changed:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;dsn&lt;/strong&gt; : can be found in the project settings&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;tracingOrigins&lt;/strong&gt; : the URLs you will be reporting from&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;tracesSampleRate&lt;/strong&gt; : For development purposes you can keep it at 1.0. For production it is better to decrease this to 0.1 (meaning 10% of your user's will report performance analytics)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;After changing the above fields, your Sentry SDK should start sending usage analytics back to your Sentry self-hosted instance. (it might take a few mins for data to start appearing).&lt;/p&gt;

&lt;p&gt;As usual, if you have any questions don't hesitate to DM me or ask it in the comments.&lt;/p&gt;

&lt;p&gt;Good Luck!&lt;/p&gt;

</description>
      <category>sentry</category>
      <category>errormonitoring</category>
      <category>sdks</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Configuring mail for sentry self-hosted</title>
      <dc:creator>Malek Hijazi</dc:creator>
      <pubDate>Fri, 18 Mar 2022 11:18:33 +0000</pubDate>
      <link>https://dev.to/malekhijazi/configuring-mail-for-sentry-self-hosted-544f</link>
      <guid>https://dev.to/malekhijazi/configuring-mail-for-sentry-self-hosted-544f</guid>
      <description>&lt;p&gt;This blog is the fourth post in the Sentry self-hosted &lt;a href="https://theappsguy.dev/series/sentry" rel="noopener noreferrer"&gt;series&lt;/a&gt;. We will set up the mail configuration for your Sentry self-hosted instance in this post. This post will assume you already went over the previous posts in the series to set up the Sentry instance and configure the DNS AND NGINX configuration.&lt;/p&gt;

&lt;p&gt;There are two ways to configure mail on Sentry:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Built-in mail server&lt;/li&gt;
&lt;li&gt;Third-party mail server&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Built-in mail server
&lt;/h2&gt;

&lt;p&gt;Sentry ships with a built-in outgoing SMTP server set up out of the box.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Self-hosted Sentry ships with a built-in outgoing SMTP server powered by exim4. The default configuration is set to use this server. All you need to do is to set a valid address for &lt;code&gt;mail.from&lt;/code&gt; setting in config.yml and the FQDN of your Sentry instance for SENTRY_MAIL_HOST in .env. Keep in mind that if you start sending too many emails to public addresses, your new server may get marked as a spammer and banned.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;To enable the default mail server, you will need to update the config.yml file under &lt;code&gt;path_to_installation/sentry/config.yml&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1647350968519%2FK8YbAIFEw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1647350968519%2FK8YbAIFEw.png" alt="Screen Shot 2022-03-15 at 3.28.49 PM.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You will need to change the &lt;code&gt;mail.from&lt;/code&gt; to the email from which you wish to receive emails. It could be something like &lt;code&gt;sentry@yourdomain.com&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;After saving the changes to &lt;code&gt;config.yaml&lt;/code&gt;, you must restart Sentry instance. You can do so with the following command in the root directory of your installation.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker-composer restart

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  Third-party mail server
&lt;/h2&gt;

&lt;p&gt;If you prefer to use a third-party service for sending emails, you can also do that. There are a lot of services that you can use; here are a few:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://mailchimp.com/?utm=theappsguy" rel="noopener noreferrer"&gt;MailChimp&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.mailgun.com/" rel="noopener noreferrer"&gt;MailGun&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://sendgrid.com/" rel="noopener noreferrer"&gt;SendGrid&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;...&lt;/p&gt;

&lt;p&gt;After signup up to an account, you would need the following information:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;SMTP host&lt;/strong&gt; : this is a URL to the mail server host&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SMTP port&lt;/strong&gt; : the port number &lt;/li&gt;
&lt;li&gt;&lt;strong&gt;SMTP username&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;SMTP password&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;After retrieving the following information, you will need to update the &lt;code&gt;config.yaml&lt;/code&gt; file with the above information.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1647352286501%2F8JuLrLCiK.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1647352286501%2F8JuLrLCiK.png" alt="Screen Shot 2022-03-15 at 3.50.43 PM.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After saving the changes to &lt;code&gt;config.yaml&lt;/code&gt;, you must restart Sentry instance. You can do so with the following command in the root directory of your installation.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker-composer restart

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;After updating the &lt;code&gt;config.yaml&lt;/code&gt; file and initiating a restart. You can go into the sentry instance and send a test email in the &lt;a href="https://sentry.weareshft.com/manage/status/mail/" rel="noopener noreferrer"&gt;settings&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1647352442953%2FiwLU88Mxl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1647352442953%2FiwLU88Mxl.png" alt="Screen Shot 2022-03-15 at 3.53.04 PM.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you send a test mail and do not receive it, check your spam folder as it might have been marked as spam. If the email was not being sent for other reasons, like misconfiguration, Sentry would display a message with the error. If it fails with no message, you will need to put on your debugging hat and check the logs for more details.&lt;/p&gt;

&lt;p&gt;If you have any questions or need any help, don't hesitate to DM me or ask your question in the comments.&lt;/p&gt;

&lt;p&gt;Good luck!&lt;/p&gt;

</description>
      <category>sentry</category>
      <category>selfhosted</category>
      <category>errortracking</category>
    </item>
    <item>
      <title>Configuring NGINX configuration for Sentry self-hosted</title>
      <dc:creator>Malek Hijazi</dc:creator>
      <pubDate>Tue, 15 Mar 2022 14:32:50 +0000</pubDate>
      <link>https://dev.to/malekhijazi/configuring-nginx-configuration-for-sentry-self-hosted-4hif</link>
      <guid>https://dev.to/malekhijazi/configuring-nginx-configuration-for-sentry-self-hosted-4hif</guid>
      <description>&lt;p&gt;This blog is the third post in the Sentry self-hosted &lt;a href="https://theappsguy.dev/series/sentry"&gt;series&lt;/a&gt;. You will set up the NGINX configuration for your Sentry self-hosted instance in this post. This post will assume you already went over the previous &lt;a href="https://dev.to/malekhijazi/configuring-domain-name-for-sentry-self-hosted-1o4o"&gt;post&lt;/a&gt; that explains how to set up your custom subdomain to point to the server with Sentry self-hosted instance installed.&lt;/p&gt;

&lt;p&gt;If you did everything correctly, your domain would still not be working as we need to tell NGINX how to redirect to the port Sentry is running on. To do so, you will need to set up the NGINX configuration.&lt;/p&gt;

&lt;p&gt;There's an &lt;a href="https://www.digitalocean.com/community/tutorials/how-to-set-up-nginx-server-blocks-virtual-hosts-on-ubuntu-16-04"&gt;article&lt;/a&gt; on the DigitalOcean blog that explains this in detail. However, I will go through the needed steps to set it up.&lt;/p&gt;

&lt;p&gt;First, you will need to ssh into the server.&lt;/p&gt;

&lt;p&gt;The NGINX configuration directory is usually at &lt;code&gt;/etc/nginx&lt;/code&gt;. Inside this directory, you will see a few directories/files. We will be using 2 of these directories.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;sites-available&lt;/code&gt;: This is where we will configure the available domains.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;sites-enabled&lt;/code&gt;: This is where we will configure the enabled domains.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Note: you can have many domains available but not enabled. If a domain is not enabled, it won't be publicly accessible.&lt;/p&gt;

&lt;p&gt;We will be creating a new configuration file inside the &lt;code&gt;sites-available&lt;/code&gt; directory. &lt;code&gt;cd&lt;/code&gt; into the &lt;code&gt;sites-available&lt;/code&gt; directory, and you should have a &lt;code&gt;default&lt;/code&gt; file present in the directory. You can either copy this file into a new file using the below command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo cp /etc/nginx/sites-available/default /etc/nginx/sites-available/sentry.domain.com

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

&lt;/div&gt;



&lt;p&gt;PS: make sure to change the name of the second file from &lt;code&gt;sentry.domain.com&lt;/code&gt; to the domain you used in the previous article.&lt;/p&gt;

&lt;p&gt;Or you can copy the below code and modify the content:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;server {
        listen 80 default_server;
        listen [::]:80 default_server;

        root /var/www/sentry.domain.com;
        index index.html index.htm index.nginx-debian.html;

        server_name _;

        location / {
             # this will route to port 9000
            proxy_pass http://localhost:9000;
        }
}

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

&lt;/div&gt;



&lt;p&gt;Once you're done, save the file.&lt;/p&gt;

&lt;p&gt;Now you have your site available, but it is not enabled yet.&lt;/p&gt;

&lt;p&gt;We can create symbolic links from the file you just created to the &lt;code&gt;sites-enabled&lt;/code&gt; directory, which Nginx reads from during startup.&lt;/p&gt;

&lt;p&gt;To enable the domain, you will need to use the below command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo ln -s /etc/nginx/sites-available/sentry.domain.com /etc/nginx/sites-enabled/

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

&lt;/div&gt;



&lt;p&gt;PS: don't forget to change the &lt;code&gt;sentry.domain.com&lt;/code&gt; to the one you used while setting up.&lt;/p&gt;

&lt;p&gt;Your site is now enabled, though it won't be working just yet. There's one more step you need to do for it to work. We need to restart NGINX so that the configuration would be applied.&lt;/p&gt;

&lt;p&gt;Restart NGINX with the below command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl restart nginx

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

&lt;/div&gt;



&lt;p&gt;After NGINX restarts, the domain should be working.&lt;/p&gt;

&lt;p&gt;Good luck!&lt;/p&gt;

</description>
      <category>sentry</category>
      <category>errortracking</category>
    </item>
    <item>
      <title>Configuring domain name for Sentry self-hosted</title>
      <dc:creator>Malek Hijazi</dc:creator>
      <pubDate>Sat, 19 Feb 2022 19:23:52 +0000</pubDate>
      <link>https://dev.to/malekhijazi/configuring-domain-name-for-sentry-self-hosted-1o4o</link>
      <guid>https://dev.to/malekhijazi/configuring-domain-name-for-sentry-self-hosted-1o4o</guid>
      <description>&lt;p&gt;This blog post is the second post in the Sentry self-hosted &lt;a href="https://theappsguy.dev/series/sentry"&gt;series&lt;/a&gt;. In this post, we will set up a domain name for your Sentry self-hosted instance. This post will assume you already went over the previous &lt;a href="https://theappsguy.dev/setting-up-sentry-self-hosted"&gt;post&lt;/a&gt; that explains the setup process and requirements for Sentry.&lt;/p&gt;

&lt;p&gt;To proceed with this tutorial, you will need a domain name and access to change its DNS configuration. If you are not familiar with this, you can check with your domain registrar's FAQs or help center. The most popular registrar (at least from my side of the world) is &lt;a href="https://www.godaddy.com/"&gt;GoDaddy&lt;/a&gt;, and this &lt;a href="https://ae.godaddy.com/help/add-an-a-record-19238"&gt;link&lt;/a&gt; will provide you with the details on how to do so. For those who are you using &lt;a href="https://www.cloudflare.com/"&gt;CloudFlare&lt;/a&gt;, this is the &lt;a href="https://support.cloudflare.com/hc/en-us/articles/360019093151-Managing-DNS-records-in-Cloudflare"&gt;link&lt;/a&gt; to help you accomplish that&lt;/p&gt;

&lt;p&gt;After you've set up Sentry and logged in with the user you've created, you will be presented with a configuration screen like the one below (this might be different depending on the version you installed, as of the time of writing the below is what it shows)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--bLOTogYN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1645280381288/CCE1AMep6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bLOTogYN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1645280381288/CCE1AMep6.png" alt="Screen Shot 2022-02-17 at 9.46.39 PM.png" width="880" height="650"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--xi4Su2t1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1645279815794/fqV8_IDCO.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--xi4Su2t1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1645279815794/fqV8_IDCO.png" alt="Screen Shot 2022-02-17 at 9.46.45 PM.png" width="880" height="649"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Setup screen
&lt;/h1&gt;

&lt;h3&gt;
  
  
  Root URL
&lt;/h3&gt;

&lt;p&gt;The first input ( &lt;strong&gt;Root URL&lt;/strong&gt; ) is the URL address of the current installation. Sentry uses this to prefix links and any redirection URLs to the following instance.&lt;/p&gt;

&lt;p&gt;You should enter the URL that your instance will reside behind in this input field. So let us say your domain is &lt;code&gt;xyz.com&lt;/code&gt;. You will enter &lt;code&gt;xyz.com&lt;/code&gt; into that input field. It's a good practice to use a subdomain in this case. Something like &lt;code&gt;sentry.xyz.com&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Admin email
&lt;/h3&gt;

&lt;p&gt;The second input is the admin email for this installation. This email is used as a technical contact for this Sentry installation.&lt;/p&gt;

&lt;p&gt;You should add the email that you want to receive technical information on.&lt;/p&gt;

&lt;h3&gt;
  
  
  Outbound email
&lt;/h3&gt;

&lt;p&gt;This section is dedicated to setting up the email server that will be used for sending email notifications from your Sentry self-hosted installation.&lt;/p&gt;

&lt;p&gt;Self-hosted Sentry ships with a built-in outgoing SMTP server powered by &lt;a href="https://hub.docker.com/r/tianon/exim4"&gt;exim4&lt;/a&gt;. The default configuration is set to use this server. If you're not very familiar with what this is, I suggest leaving this section as is. I'll be covering how to set up your email configuration in the next part of this series.&lt;/p&gt;

&lt;h3&gt;
  
  
  Authentication
&lt;/h3&gt;

&lt;p&gt;This section has one toggle. If you have this toggle turned on, it will allow people to signup for an account on your self-hosted Sentry. If you're using this for personal reasons or work-related reasons, most probably you want this option turned off.&lt;/p&gt;

&lt;h3&gt;
  
  
  Beacon
&lt;/h3&gt;

&lt;p&gt;This section is about sending information (usage statistics and security information) to Sentry about this installation. This is totally up to you, in the end, you are getting software for free, the least you can do is help out Sentry with anonymous usage statistics.&lt;/p&gt;

&lt;h1&gt;
  
  
  DNS setup
&lt;/h1&gt;

&lt;p&gt;As previously mentioned, to be able to accomplish setting up the domain. You will need access to the domain DNS configuration page of your registrar provider.&lt;/p&gt;

&lt;p&gt;Head to the DNS configuration page and check for the Add record button.&lt;/p&gt;

&lt;h3&gt;
  
  
  Type
&lt;/h3&gt;

&lt;p&gt;It will prompt you to select the &lt;strong&gt;type&lt;/strong&gt;. You will need to choose the &lt;code&gt;A&lt;/code&gt; type (it should be selected by default).&lt;/p&gt;

&lt;h3&gt;
  
  
  Name
&lt;/h3&gt;

&lt;p&gt;Then for the &lt;strong&gt;name&lt;/strong&gt; field, this should be the same as the one you entered into the Sentry setup page after logging in. The one we discussed at the beginning of this article &lt;code&gt;sentry.xyz.com&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  IPv4
&lt;/h3&gt;

&lt;p&gt;In the &lt;strong&gt;IPv4&lt;/strong&gt; field, you will enter the IP address of your server.&lt;/p&gt;

&lt;p&gt;This way the registrar will know to forward any request with &lt;code&gt;sentry.xyz.com&lt;/code&gt; domain to your server (using the IP address you provided).&lt;/p&gt;

&lt;p&gt;DNS configuration takes up to 24 hours to propagate, but depending on your registrar this might take a few minutes. In some cases though, it takes more than that. So don't get frustrated if it doesn't work right away.&lt;/p&gt;

&lt;p&gt;After the DNS propagation has gone through, you should be able to access your self-hosted Sentry installation using the domain name you chose.&lt;/p&gt;

&lt;p&gt;Let me know if you have any questions or run into any problems in the comments.&lt;/p&gt;

&lt;p&gt;Good luck!&lt;/p&gt;

</description>
      <category>sentry</category>
      <category>selfhosted</category>
      <category>errortracking</category>
    </item>
    <item>
      <title>Setting up Sentry self-hosted</title>
      <dc:creator>Malek Hijazi</dc:creator>
      <pubDate>Thu, 17 Feb 2022 20:32:47 +0000</pubDate>
      <link>https://dev.to/malekhijazi/setting-up-sentry-on-premise-3mdf</link>
      <guid>https://dev.to/malekhijazi/setting-up-sentry-on-premise-3mdf</guid>
      <description>&lt;p&gt;&lt;a href="https://sentry.io?utm_source=theappsguy" rel="noopener noreferrer"&gt;Sentry&lt;/a&gt; is an open-source full-stack error tracking system which supports a wide range of &lt;a href="https://sentry.io/platforms?utm_source=theappsguy" rel="noopener noreferrer"&gt;platforms&lt;/a&gt;. Sentry is a paid service that offers a lot of &lt;a href="https://sentry.io/for/full-stack??utm_source=theappsguy" rel="noopener noreferrer"&gt;features&lt;/a&gt; but it also offers a &lt;a href="https://sentry.io/pricing?utm_source=theappsguy" rel="noopener noreferrer"&gt;free plan&lt;/a&gt; for developers with limited events and features. The free plan is a good place to start experimenting with Sentry and its features. If you have an enormous amount of projects connected to sentry, the free plan won't be sufficient anymore as it has a limit of 5000 events per month. You can either upgrade to a paid plan or deploy Sentry on your own servers.&lt;/p&gt;

&lt;p&gt;Since Sentry is an open-source system, the code is available online to deploy on your own infrastructure. In this post we will be going through the steps to deploy sentry on your own server using &lt;a href="https://m.do.co/c/cf2577dd219e" rel="noopener noreferrer"&gt;DigitalOcean&lt;/a&gt;. If you're not familiar with DIgitalOcean, it is an affordable cloud computing provider. You can signup &lt;a href="https://m.do.co/c/cf2577dd219e" rel="noopener noreferrer"&gt;here&lt;/a&gt; for 100$ in credit valid for 2 month.&lt;/p&gt;

&lt;p&gt;According to the &lt;a href="https://github.com/getsentry/self-hosted" rel="noopener noreferrer"&gt;Github repository&lt;/a&gt; you will need the following requirements:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Docker&lt;/strong&gt; 19.03.6+&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Compose&lt;/strong&gt; 1.28.0+&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;4 CPU&lt;/strong&gt; Cores&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;8 GB&lt;/strong&gt; RAM&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;20 GB&lt;/strong&gt; Free Disk Space&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These are the most optimal server requirements. On digital ocean you can get these requirements for 40$ a month. If this is not in your current budget, use a 20$ server that can do the job but with slower performance (I've personally tried it for a while on a 20$ server, but had to upgrade it later on as our user base and platforms grew)&lt;/p&gt;

&lt;p&gt;After creating a server on DigitalOcean (or any other provider you might be using), you will need to connect to the server using SSH.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing Docker
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;a href="https://www.docker.com/" rel="noopener noreferrer"&gt;Docker&lt;/a&gt; is a set of platform as a service products that uses OS-level virtualization to deliver software in packages called containers. The service has both free and premium tiers. The software that hosts the containers is called Docker Engine. It was first started in 2013 and is developed by Docker, Inc.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;You can follow the instructions on the DigitalOcean community &lt;a href="https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-20-04" rel="noopener noreferrer"&gt;blog post&lt;/a&gt; to install Docker.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing Docker Composer
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;Compose is a tool for defining and running multi-container Docker applications. With Compose, you use a YAML file to configure your application’s services. Then, with a single command, you create and start all the services from your configuration.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;You can follow the instructions on the DigitalOcean community &lt;a href="https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-compose-on-ubuntu-20-04" rel="noopener noreferrer"&gt;blog post&lt;/a&gt; to install Docker Compose.&lt;/p&gt;

&lt;p&gt;PS: Make sure you replace the version with the newest version found on the &lt;a href="https://github.com/docker/compose" rel="noopener noreferrer"&gt;Github repository&lt;/a&gt; or you will have an outdated version of Docker Compose.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installation
&lt;/h2&gt;

&lt;p&gt;To get started with a default installation, we will need to clone the &lt;a href="https://github.com/getsentry/self-hosted" rel="noopener noreferrer"&gt;repository&lt;/a&gt;.&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 https://github.com/getsentry/self-hosted sentry
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The above will clone the repository into a folder called &lt;code&gt;sentry&lt;/code&gt;. You can change the directory name by changing the &lt;code&gt;sentry&lt;/code&gt; at the end of the command to the desired directory name. Then &lt;code&gt;cd&lt;/code&gt; into the directory you just created and run the below command to start the installation process:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;During the installation, a prompt will ask if you want to create a user account. If you require that the install not be blocked by the prompt, run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;./install.sh --skip-user-prompt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will take a while, grab a cup of coffee in the meantime ^^.&lt;/p&gt;

&lt;p&gt;If the installation is successful you should see the following&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1645121828863%2F0xB_Cvi0t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1645121828863%2F0xB_Cvi0t.png" alt="Successful screenshot"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now run the following command to start sentry:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker-compose up -d
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once the command finishes you can then open the installation on&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;http://{server_ip}:9000/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Creating a user
&lt;/h2&gt;

&lt;p&gt;If you used &lt;code&gt;--skip-user-prompt&lt;/code&gt; when running the install command, you will need to create a user through the terminal.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sentry createuser
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You might run into an error: &lt;code&gt;sentry command not found&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Run this command to create an alias for sentry&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;alias sentry="docker-compose run --rm web"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Rerun the createuser command and it should prompt you for an email, password, confirm password, and superuser confirmation.&lt;/p&gt;

&lt;p&gt;Tada! Now you can login to your self-hosted instance of Sentry.io.&lt;/p&gt;

&lt;p&gt;In later posts, I will be walking you through the configuration options, configuring SSL, domain name, and integrations.&lt;/p&gt;

&lt;p&gt;If you have any questions don't hesitate to ask me in the comments.&lt;/p&gt;

&lt;p&gt;Cheers!&lt;/p&gt;

</description>
      <category>sentry</category>
      <category>errortracking</category>
      <category>digitalocean</category>
    </item>
    <item>
      <title>Automatic injection of Vue router routes</title>
      <dc:creator>Malek Hijazi</dc:creator>
      <pubDate>Wed, 10 Nov 2021 06:36:55 +0000</pubDate>
      <link>https://dev.to/malekhijazi/automatic-injecting-of-vue-router-routes-2e1o</link>
      <guid>https://dev.to/malekhijazi/automatic-injecting-of-vue-router-routes-2e1o</guid>
      <description>&lt;p&gt;Have you ever had your Vue router file get so big that it started getting messy to maintain?  &lt;/p&gt;

&lt;p&gt;How about if you had a separate JS file for each route that can be organized into folders and sub folders. And these files are auto injected into the Vue router.&lt;/p&gt;

&lt;p&gt;Create a folder in your &lt;code&gt;/src&lt;/code&gt; directory called &lt;code&gt;/router&lt;/code&gt; and inside it create an &lt;code&gt;index.js&lt;/code&gt; file and &lt;code&gt;/routes&lt;/code&gt; directory&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0kww4ybxa9fcxaywjikp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0kww4ybxa9fcxaywjikp.png" alt="Image of the router directory containing index.js and routes directory"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Inside the &lt;code&gt;routes&lt;/code&gt; directory start creating files for each route you have in your app. You could also create these file in subdirectories inside the &lt;code&gt;routes&lt;/code&gt; directory.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe62h5gzdbjn41qzv17rq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe62h5gzdbjn41qzv17rq.png" alt="Routes directory with route files"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Each file should have the below structure.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;//this lazy loads the component&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;ViewComponent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@/views/ViewOne&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/view-one&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;View One&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;component&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;ViewComponent&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;show_in_menu&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;meta&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;search&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="na"&gt;enabled&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;As you can see each file would have the normal attributes you would normally find in a vue router config array.&lt;/p&gt;

&lt;p&gt;Loading the view component is using an arrow function, the only difference is that using an arrow function lazy loads the component instead of loading it directly.&lt;/p&gt;

&lt;p&gt;You might also find additional attributes, e.g:&lt;code&gt;show_in_menu&lt;/code&gt;, &lt;code&gt;search&lt;/code&gt; object in the meta.&lt;/p&gt;

&lt;p&gt;I use these to auto configure routes based on these configurations. The &lt;code&gt;show_in_menu&lt;/code&gt; value, if true, will inject this route into the side navigation menu. For the search, if enabled, it will show a search bar in the Toolbar. &lt;/p&gt;

&lt;p&gt;Now once you add all your routes in different files, you need to update the &lt;code&gt;index.js&lt;/code&gt; we previously created to the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;Vue&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;vue&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;VueRouter&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;vue-router&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nx"&gt;Vue&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;use&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;VueRouter&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;//automatically load all files from ./routes directory and register them&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;autoLoadedFiles&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;context&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;./routes&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// Look for files in the current directory&lt;/span&gt;
    &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// include subdirectories&lt;/span&gt;
    &lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="se"&gt;\.&lt;/span&gt;&lt;span class="sr"&gt;js$/&lt;/span&gt; &lt;span class="c1"&gt;// Only include files that end with .js&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;routes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[];&lt;/span&gt;
&lt;span class="c1"&gt;//loop over the files in the ./routes directory&lt;/span&gt;
&lt;span class="nx"&gt;autoLoadedFiles&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;keys&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;forEach&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;fileName&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;//get the default exported object from the route file and push it to the routes array&lt;/span&gt;
    &lt;span class="nx"&gt;routes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;autoLoadedFiles&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;fileName&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="k"&gt;default&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;router&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;VueRouter&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;base&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/base-url,
    routes,
});

export default router;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And finally you need to import this file in your &lt;code&gt;main.js&lt;/code&gt; or &lt;code&gt;app.js&lt;/code&gt; file&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;router&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;./router&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  BONUS:
&lt;/h1&gt;

&lt;p&gt;To retrieve the &lt;code&gt;show_in_menu&lt;/code&gt; attribute you can loop over the routes as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;$router&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;options&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;routes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;forEach&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;route&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;route&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;show_in_menu&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;navItems&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createNavItem&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;route&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;            
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To retrieve the meta object you can do so as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;$router&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;currentRoute&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;meta&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let me know what do you think of this solution in the comments and if this is something you might use in your projects.&lt;/p&gt;

&lt;p&gt;Cheers!&lt;/p&gt;

</description>
      <category>vue</category>
      <category>vuerouter</category>
      <category>autoinject</category>
    </item>
    <item>
      <title>Setting up Laravel 8 with Vue.js and Tailwind css</title>
      <dc:creator>Malek Hijazi</dc:creator>
      <pubDate>Tue, 09 Nov 2021 04:26:19 +0000</pubDate>
      <link>https://dev.to/malekhijazi/setting-up-laravel-8-with-vuejs-and-tailwind-css-f8g</link>
      <guid>https://dev.to/malekhijazi/setting-up-laravel-8-with-vuejs-and-tailwind-css-f8g</guid>
      <description>&lt;p&gt;This article assumes you already have the environment setup for running and installing &lt;a href="https://laravel.com" rel="noopener noreferrer"&gt;Laravel&lt;/a&gt; &amp;amp; &lt;a href="https://vuejs.org" rel="noopener noreferrer"&gt;Vue.js&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Laravel Installation
&lt;/h3&gt;

&lt;p&gt;We will be using &lt;a href="https://laravel.com/docs/8.x/installation#the-laravel-installer" rel="noopener noreferrer"&gt;Laravel Installer&lt;/a&gt; to create a new project of the latest Laravel version.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Before running the below command make sure you &lt;code&gt;cd&lt;/code&gt; to the directory you want to create your project in&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;laravel new project-name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once installed you will need to run your project using a php server. I use &lt;a href="https://laravel.com/docs/8.x/valet" rel="noopener noreferrer"&gt;Laravel Valet&lt;/a&gt;. It is easy to setup and use.&lt;/p&gt;

&lt;p&gt;If you want a detailed installation guide head over to the &lt;a href="https://laravel.com/docs/8.x/valet#installation" rel="noopener noreferrer"&gt;documentation&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In brief instructions:&lt;br&gt;
Install&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;composer global require laravel/valet

valet install
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Park: is used to tell valet which folder contains all projects you want to serve. By doing so, all folders in this directory will be served on &lt;code&gt;project-directory.test&lt;/code&gt; in the browser&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd ~/Sites

valet park
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Valet will automatically start its daemon each time your machine boots. There is no need to run valet start or valet install ever again once the initial Valet installation is complete.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;After opening &lt;code&gt;project-directory.test&lt;/code&gt; in the browser you will see the default Laravel welcome page.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fa33dn80c0rhva99psbf0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fa33dn80c0rhva99psbf0.png" alt="frame_generic_dark"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Vue.js Installation
&lt;/h3&gt;

&lt;p&gt;We will be using &lt;a href="https://cli.vuejs.org/" rel="noopener noreferrer"&gt;Vue Cli&lt;/a&gt; to install and create a boilerplate vue project. Its easy to install and gives you a few config options when creating vue projects. Head over to the documentation for installation instructions.&lt;/p&gt;

&lt;p&gt;After installing it, cd int your project directory and run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;vue ui
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When the command runs successfully you will have a browser tab open with a visual interface. Head on to the Create Tab and select the following destination &lt;code&gt;project-directory/resources&lt;/code&gt; &lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fxcz3xz6a5u17v6ardsw1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fxcz3xz6a5u17v6ardsw1.png" alt="Vue UI"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then click on create project. &lt;/p&gt;

&lt;p&gt;You will then be asked to fill in some information like the folder name and package manager. I use &lt;code&gt;npm&lt;/code&gt; as a package manager but you can select whatever option you prefer. The folder name should be the Vue app name. For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You might have a frontend interface and a backend interface so you can create 2 projects one called &lt;code&gt;frontend&lt;/code&gt; and one &lt;code&gt;backend&lt;/code&gt;. This will be useful when you want different configurations for each app.&lt;/li&gt;
&lt;li&gt;You might have multiple modules. So each module can have its own project. This will be useful when you want different configurations for each module.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;I will be setting the folder name as &lt;code&gt;app&lt;/code&gt; in the following post&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;After going through the features tab, select what features you want installed by default (vuex, vue-router, unit testing ...)&lt;/p&gt;

&lt;p&gt;This is my current configuration:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fhkiy91j6lp2u8hd072ox.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fhkiy91j6lp2u8hd072ox.png" alt="Screen Shot 2021-01-10 at 8.54.04 PM"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://router.vuejs.org/" rel="noopener noreferrer"&gt;Vue-Router&lt;/a&gt;: is for routing pages using vue&lt;br&gt;
&lt;a href="https://vuex.vuejs.org/" rel="noopener noreferrer"&gt;Vuex&lt;/a&gt;: is for state management. I'll be writing a post about this soon.&lt;br&gt;
E2E Testing: I use &lt;a href="https://www.cypress.io/" rel="noopener noreferrer"&gt;Cypress&lt;/a&gt; (new to it actually) its an automated UI testing library.&lt;/p&gt;

&lt;p&gt;After setting up and creating the project you will see the following folder structure.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fdu227x4y6h7wmv3oucz1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fdu227x4y6h7wmv3oucz1.png" alt="Screen Shot 2021-01-10 at 9.06.05 PM"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Vue ui can also be used to manage plugins and manage package manager tasks. Take some time and play around with it.&lt;/p&gt;

&lt;p&gt;To run your newly created project you have 2 ways:&lt;/p&gt;

&lt;p&gt;1- cd into &lt;code&gt;project-directory/resources/app/&lt;/code&gt; and run &lt;code&gt;npm run serve&lt;/code&gt;&lt;br&gt;
2- modify the &lt;code&gt;project-directory/package.json script&lt;/code&gt; to add the following script&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"serve:app": "cd resources/app &amp;amp;&amp;amp; npm run serve"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After that run the command (based on which method you went with)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm run serve:app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If all is successful you will see the serve url in the terminal an that url will give the following:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fommp39modyoc5g2hqdxt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fommp39modyoc5g2hqdxt.png" alt="Vue successful installation"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Tailwind CSS Installation
&lt;/h3&gt;

&lt;p&gt;Since we have Vue ui installed. We can install the Tailwind css pluging using the plugins section. Head over to the plugins section and click on add plugin button on the top right. Search for &lt;code&gt;tailwind&lt;/code&gt; and you will see the plugin in the search results&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F9iryoev6cnbqmwf3rp7c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F9iryoev6cnbqmwf3rp7c.png" alt="Tailwind css plugin"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click on it and then go through the installation process. You will be asked for the default config file. Choosing on &lt;code&gt;full&lt;/code&gt; will generate a file that has all the options which is very big. So if you are new to Tailwind css its better to choose the &lt;code&gt;minimal&lt;/code&gt; config file.&lt;/p&gt;

&lt;p&gt;When you're done you will have a &lt;code&gt;tailwind.config.js&lt;/code&gt; file in the main directory of your Vue app.&lt;/p&gt;

&lt;p&gt;You can test if the Tailwind css installation is successful by heading over to their &lt;a href="https://tailwindui.com/components" rel="noopener noreferrer"&gt;Components&lt;/a&gt; page and copy the code for a component. Then replace the content of Home.vue with the code you just copied. Then check the browser and you should see the component ready.&lt;/p&gt;

&lt;p&gt;If you've added linting to your project you might face some issues. Add this configuration object for the &lt;code&gt;eslintConfig&lt;/code&gt; object and this will disable some linting checks (but then the linting will be useless:p).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"rules"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"no-console"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"off"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"no-unused-expressions"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"off"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"no-unused-vars"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"off"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"vue/no-unused-components"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"off"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>laravel</category>
      <category>vue</category>
      <category>tailwindcss</category>
    </item>
  </channel>
</rss>
