<?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>Forem: Brayan Narváez</title>
    <description>The latest articles on Forem by Brayan Narváez (@prinick).</description>
    <link>https://forem.com/prinick</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%2F871996%2F3e5217fe-4d4a-4521-8a41-044cbcc1a76c.jpeg</url>
      <title>Forem: Brayan Narváez</title>
      <link>https://forem.com/prinick</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/prinick"/>
    <language>en</language>
    <item>
      <title>Personal multilang page written in Vue3, Sass, packaged with Vite, CI workflow</title>
      <dc:creator>Brayan Narváez</dc:creator>
      <pubDate>Mon, 13 Jun 2022 13:46:41 +0000</pubDate>
      <link>https://forem.com/prinick/personal-multilang-page-written-in-vue3-sass-packaged-with-vite-ci-workflow-3jlg</link>
      <guid>https://forem.com/prinick/personal-multilang-page-written-in-vue3-sass-packaged-with-vite-ci-workflow-3jlg</guid>
      <description>&lt;h1&gt;
  
  
  bnarvaez-dev
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Personal webpage written in Vue 3, Sass and packaged with Vite.&lt;/li&gt;
&lt;li&gt;Unit tests in Vite 3&lt;/li&gt;
&lt;li&gt;CI Workflow&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can use for your own page!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/prinick96/bnarvaez.dev"&gt;Github Repo&lt;/a&gt;&lt;br&gt;
&lt;a href="https://bnarvaez.dev"&gt;Demo - My web&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://app.netlify.com/sites/prinick/deploys"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6zwkh2BR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://api.netlify.com/api/v1/badges/67937758-ab18-44f8-9d8a-968afed67f0b/deploy-status" alt="Netlify Status" width="135" height="20"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  ✅ Install and Run
&lt;/h2&gt;

&lt;p&gt;First clone the repo&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/prinick96/bnarvaez.dev.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Install dependencies&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Just run in local&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;Or with Docker 🐳&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;make docker-up
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  ✅ Tests
&lt;/h2&gt;

&lt;p&gt;All test are located in &lt;code&gt;/src/test&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Run&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;test&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  ✅ Notes
&lt;/h2&gt;

&lt;p&gt;I am using Netlify for deploy, i recommend optimize all images and minify the html if you don't use Netlify with plugins&lt;/p&gt;

</description>
      <category>vue</category>
      <category>sass</category>
      <category>opensource</category>
      <category>vite</category>
    </item>
    <item>
      <title>Hexagonal Architecture in Go</title>
      <dc:creator>Brayan Narváez</dc:creator>
      <pubDate>Fri, 03 Jun 2022 14:09:38 +0000</pubDate>
      <link>https://forem.com/prinick/hexagonal-architecture-in-go-3i7n</link>
      <guid>https://forem.com/prinick/hexagonal-architecture-in-go-3i7n</guid>
      <description>&lt;p&gt;Hello everyone i recenlty written a TODO System with Hexagonal Architecture written in Go, with test and uses cases examples, docker ready, heroku ready, basic CI integration and you can use it how template for your projects.&lt;/p&gt;

&lt;p&gt;I appreciate feedback!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/prinick96/hex-arch-go" rel="noopener noreferrer"&gt;Github Repo&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%2Fuser-images.githubusercontent.com%2F11221009%2F171791133-e7da86a4-038e-4629-8c41-49ab50d6f25a.gif" 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%2Fuser-images.githubusercontent.com%2F11221009%2F171791133-e7da86a4-038e-4629-8c41-49ab50d6f25a.gif"&gt;&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;✔️ A TODO System with hexagonal architecture / clean architecture what you can use how template for your projects&lt;/p&gt;

&lt;p&gt;✔️ Includes a simple CI.yml that you can use to get started with continuous integration in Github Actions&lt;/p&gt;

&lt;p&gt;✔️ DB and Tests Implemented with CockRoachDB but you can run with another, for example MySQL&lt;/p&gt;

&lt;p&gt;✔️ It have use cases and test examples for that use cases&lt;/p&gt;

&lt;p&gt;✔️ Unit tests models and integration test models&lt;/p&gt;

&lt;p&gt;✔️ API REST with Echo MicroFramework&lt;/p&gt;

&lt;p&gt;✔️ Simple error logs system&lt;/p&gt;

&lt;p&gt;✔️ Docker and Heroku ready&lt;/p&gt;



&lt;h2&gt;
  
  
  ✅ Install
&lt;/h2&gt;

&lt;p&gt;First clone the repo&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/prinick96/hex-arch-go.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;⚠️ Now, the system need connect to a database, by default you can use Postgres or CockroachDB&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Just create a database&lt;/li&gt;
&lt;li&gt;Upload the schema on your DB
&lt;/li&gt;
&lt;/ul&gt;

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

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Change the enverioment variables located in .env.development
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;DB_ENGINE &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"postgres or mysql"&lt;/span&gt;
DB_HOST &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"host"&lt;/span&gt;
DB_PORT &lt;span class="o"&gt;=&lt;/span&gt; 1234
DB_DATABASE &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"db name"&lt;/span&gt;
DB_USERNAME &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"user name"&lt;/span&gt;
DB_PASSWORD &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"your secret password"&lt;/span&gt;

&lt;span class="c"&gt;# For cockroach&lt;/span&gt;
DB_OPTIONS &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"--cluster=cockroach-cluser-id"&lt;/span&gt;

&lt;span class="c"&gt;# For postgres&lt;/span&gt;
DB_OPTIONS &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"sslmode=disable timezone=UTC connect_timeout=5"&lt;/span&gt;

&lt;span class="c"&gt;# For mysql&lt;/span&gt;
DB_OPTIONS &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;h2&gt;
  
  
  ✅ Run
&lt;/h2&gt;

&lt;p&gt;If you want run in local, simply&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;go get
go run main.go
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you want run with Docker, simply&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;make docker-up 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you want run with Heroku local, simply&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# For Linux/MacOS&lt;/span&gt;
make heroku-run

&lt;span class="c"&gt;# For Windows&lt;/span&gt;
heroku-run-win
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;⚠️ If you use Windows, you need change &lt;strong&gt;Procfile&lt;/strong&gt; in the root of project for&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# For windows use &lt;/span&gt;
web: bin&lt;span class="se"&gt;\h&lt;/span&gt;ex-arch-go.exe
&lt;span class="c"&gt;# web: bin/hex-arch-go&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And now you can run Heroku local for Windows&lt;br&gt;
&lt;br&gt;&lt;br&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  ✅ Test
&lt;/h2&gt;

&lt;p&gt;For unit tests, simply&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;make unit-test
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;⚠️For integration tests, first need configure the &lt;strong&gt;.env.test&lt;/strong&gt; vars adding the database test connection, after, simply&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;make integration-test
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or both of them&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;make &lt;span class="nb"&gt;test&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;h2&gt;
  
  
  🌳 Understanding the folder structure
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;.&lt;/span&gt;
├── /.github/workflows       &lt;span class="c"&gt;# Github Actions!&lt;/span&gt;
├── /cmd                     &lt;span class="c"&gt;# Start the application with server and database&lt;/span&gt;
├── /core                    &lt;span class="c"&gt;# The CORE of hexagonal architecture: infrastructure, application and domain&lt;/span&gt;
│   ├── /application         &lt;span class="c"&gt;# Handlers and the entry point of data&lt;/span&gt;
│   ├── /entities            &lt;span class="c"&gt;# The entities what conform the domain&lt;/span&gt;
│   └── /infrastructure      &lt;span class="c"&gt;# Gateways for the domain logic and Storage/Repository for the implementation of database&lt;/span&gt;
├── /db                      &lt;span class="c"&gt;# Simply the schema of DB for you first run&lt;/span&gt;
├── /env                     &lt;span class="c"&gt;# .env loader&lt;/span&gt;
├── /internal                &lt;span class="c"&gt;# Elemental logic common for all the system&lt;/span&gt;
│   ├── /database            &lt;span class="c"&gt;# Connection with database implemented&lt;/span&gt;
│   └── /helpers             &lt;span class="c"&gt;# Reusable functions around the app, like a UUID generation&lt;/span&gt;
│       └── tests            &lt;span class="c"&gt;# Unit tests for helpers &lt;/span&gt;
└── /server                  &lt;span class="c"&gt;# The server listener and endpoints of API REST&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>go</category>
      <category>opensource</category>
      <category>github</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
