<?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: Nerdy Gedoni</title>
    <description>The latest articles on Forem by Nerdy Gedoni (@gedons).</description>
    <link>https://forem.com/gedons</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%2F1005337%2F41f1cfa5-e49b-4505-a2bb-cb906c89d20b.jpeg</url>
      <title>Forem: Nerdy Gedoni</title>
      <link>https://forem.com/gedons</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/gedons"/>
    <language>en</language>
    <item>
      <title>[Boost]</title>
      <dc:creator>Nerdy Gedoni</dc:creator>
      <pubDate>Fri, 16 May 2025 05:51:30 +0000</pubDate>
      <link>https://forem.com/gedons/-41d1</link>
      <guid>https://forem.com/gedons/-41d1</guid>
      <description>&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://dev.to/coding-with-patrik/how-to-build-a-cli-todo-app-in-go-5eca" class="crayons-story__hidden-navigation-link"&gt;How to Build A CLI Todo App in Go&lt;/a&gt;


  &lt;div class="crayons-story__body crayons-story__body-full_post"&gt;
    &lt;div class="crayons-story__top"&gt;
      &lt;div class="crayons-story__meta"&gt;
        &lt;div class="crayons-story__author-pic"&gt;

          &lt;a href="/coding-with-patrik" class="crayons-avatar  crayons-avatar--l  "&gt;
            &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3159747%2Ff0af3104-614f-41b6-ae21-e763c3baa8fc.png" alt="coding-with-patrik profile" class="crayons-avatar__image"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/coding-with-patrik" class="crayons-story__secondary fw-medium m:hidden"&gt;
              Coding With Patrik
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                Coding With Patrik
                
              
              &lt;div id="story-author-preview-content-2485673" class="profile-preview-card__content crayons-dropdown branded-7 p-4 pt-0"&gt;
                &lt;div class="gap-4 grid"&gt;
                  &lt;div class="-mt-4"&gt;
                    &lt;a href="/coding-with-patrik" class="flex"&gt;
                      &lt;span class="crayons-avatar crayons-avatar--xl mr-2 shrink-0"&gt;
                        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3159747%2Ff0af3104-614f-41b6-ae21-e763c3baa8fc.png" class="crayons-avatar__image" alt=""&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;Coding With Patrik&lt;/span&gt;
                    &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="print-hidden"&gt;
                    
                      Follow
                    
                  &lt;/div&gt;
                  &lt;div class="author-preview-metadata-container"&gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

          &lt;/div&gt;
          &lt;a href="https://dev.to/coding-with-patrik/how-to-build-a-cli-todo-app-in-go-5eca" class="crayons-story__tertiary fs-xs"&gt;&lt;time&gt;May 13 '25&lt;/time&gt;&lt;span class="time-ago-indicator-initial-placeholder"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="crayons-story__indention"&gt;
      &lt;h2 class="crayons-story__title crayons-story__title-full_post"&gt;
        &lt;a href="https://dev.to/coding-with-patrik/how-to-build-a-cli-todo-app-in-go-5eca" id="article-link-2485673"&gt;
          How to Build A CLI Todo App in Go
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/cli"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;cli&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/go"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;go&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/programming"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;programming&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/tutorial"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;tutorial&lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
          &lt;a href="https://dev.to/coding-with-patrik/how-to-build-a-cli-todo-app-in-go-5eca" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left"&gt;
            &lt;div class="multiple_reactions_aggregate"&gt;
              &lt;span class="multiple_reactions_icons_container"&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/exploding-head-daceb38d627e6ae9b730f36a1e390fca556a4289d5a41abb2c35068ad3e2c4b5.svg" width="18" height="18"&gt;
                  &lt;/span&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/multi-unicorn-b44d6f8c23cdd00964192bedc38af3e82463978aa611b4365bd33a0f1f4f3e97.svg" width="18" height="18"&gt;
                  &lt;/span&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/sparkle-heart-5f9bee3767e18deb1bb725290cb151c25234768a0e9a2bd39370c382d02920cf.svg" width="18" height="18"&gt;
                  &lt;/span&gt;
              &lt;/span&gt;
              &lt;span class="aggregate_reactions_counter"&gt;8&lt;span class="hidden s:inline"&gt; reactions&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/a&gt;
            &lt;a href="https://dev.to/coding-with-patrik/how-to-build-a-cli-todo-app-in-go-5eca#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center"&gt;
              Comments


              &lt;span class="hidden s:inline"&gt;Add Comment&lt;/span&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="crayons-story__save"&gt;
          &lt;small class="crayons-story__tertiary fs-xs mr-2"&gt;
            8 min read
          &lt;/small&gt;
            
              &lt;span class="bm-initial"&gt;
                

              &lt;/span&gt;
              &lt;span class="bm-success"&gt;
                

              &lt;/span&gt;
            
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;


</description>
      <category>cli</category>
      <category>go</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>[Boost]</title>
      <dc:creator>Nerdy Gedoni</dc:creator>
      <pubDate>Tue, 29 Apr 2025 16:01:29 +0000</pubDate>
      <link>https://forem.com/gedons/-4hk1</link>
      <guid>https://forem.com/gedons/-4hk1</guid>
      <description>&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://dev.to/gedons/building-a-go-playground-repl-from-scratch-with-docker-aws-vuejs-2e7b" class="crayons-story__hidden-navigation-link"&gt;Building a Go Playground REPL from Scratch with Docker, AWS &amp;amp; Vue.js&lt;/a&gt;


  &lt;div class="crayons-story__body crayons-story__body-full_post"&gt;
    &lt;div class="crayons-story__top"&gt;
      &lt;div class="crayons-story__meta"&gt;
        &lt;div class="crayons-story__author-pic"&gt;

          &lt;a href="/gedons" class="crayons-avatar  crayons-avatar--l  "&gt;
            &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1005337%2F41f1cfa5-e49b-4505-a2bb-cb906c89d20b.jpeg" alt="gedons profile" class="crayons-avatar__image"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/gedons" class="crayons-story__secondary fw-medium m:hidden"&gt;
              Nerdy Gedoni
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                Nerdy Gedoni
                
              
              &lt;div id="story-author-preview-content-2445909" class="profile-preview-card__content crayons-dropdown branded-7 p-4 pt-0"&gt;
                &lt;div class="gap-4 grid"&gt;
                  &lt;div class="-mt-4"&gt;
                    &lt;a href="/gedons" class="flex"&gt;
                      &lt;span class="crayons-avatar crayons-avatar--xl mr-2 shrink-0"&gt;
                        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1005337%2F41f1cfa5-e49b-4505-a2bb-cb906c89d20b.jpeg" class="crayons-avatar__image" alt=""&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;Nerdy Gedoni&lt;/span&gt;
                    &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="print-hidden"&gt;
                    
                      Follow
                    
                  &lt;/div&gt;
                  &lt;div class="author-preview-metadata-container"&gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

          &lt;/div&gt;
          &lt;a href="https://dev.to/gedons/building-a-go-playground-repl-from-scratch-with-docker-aws-vuejs-2e7b" class="crayons-story__tertiary fs-xs"&gt;&lt;time&gt;Apr 29 '25&lt;/time&gt;&lt;span class="time-ago-indicator-initial-placeholder"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="crayons-story__indention"&gt;
      &lt;h2 class="crayons-story__title crayons-story__title-full_post"&gt;
        &lt;a href="https://dev.to/gedons/building-a-go-playground-repl-from-scratch-with-docker-aws-vuejs-2e7b" id="article-link-2445909"&gt;
          Building a Go Playground REPL from Scratch with Docker, AWS &amp;amp; Vue.js
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/docker"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;docker&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/go"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;go&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/aws"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;aws&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/vue"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;vue&lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
          &lt;a href="https://dev.to/gedons/building-a-go-playground-repl-from-scratch-with-docker-aws-vuejs-2e7b" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left"&gt;
            &lt;div class="multiple_reactions_aggregate"&gt;
              &lt;span class="multiple_reactions_icons_container"&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/exploding-head-daceb38d627e6ae9b730f36a1e390fca556a4289d5a41abb2c35068ad3e2c4b5.svg" width="18" height="18"&gt;
                  &lt;/span&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/multi-unicorn-b44d6f8c23cdd00964192bedc38af3e82463978aa611b4365bd33a0f1f4f3e97.svg" width="18" height="18"&gt;
                  &lt;/span&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/sparkle-heart-5f9bee3767e18deb1bb725290cb151c25234768a0e9a2bd39370c382d02920cf.svg" width="18" height="18"&gt;
                  &lt;/span&gt;
              &lt;/span&gt;
              &lt;span class="aggregate_reactions_counter"&gt;11&lt;span class="hidden s:inline"&gt; reactions&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/a&gt;
            &lt;a href="https://dev.to/gedons/building-a-go-playground-repl-from-scratch-with-docker-aws-vuejs-2e7b#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center"&gt;
              Comments


              &lt;span class="hidden s:inline"&gt;Add Comment&lt;/span&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="crayons-story__save"&gt;
          &lt;small class="crayons-story__tertiary fs-xs mr-2"&gt;
            3 min read
          &lt;/small&gt;
            
              &lt;span class="bm-initial"&gt;
                

              &lt;/span&gt;
              &lt;span class="bm-success"&gt;
                

              &lt;/span&gt;
            
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;


</description>
      <category>docker</category>
      <category>go</category>
      <category>aws</category>
      <category>vue</category>
    </item>
    <item>
      <title>Building a Go Playground REPL from Scratch with Docker, AWS &amp; Vue.js</title>
      <dc:creator>Nerdy Gedoni</dc:creator>
      <pubDate>Tue, 29 Apr 2025 15:51:20 +0000</pubDate>
      <link>https://forem.com/gedons/building-a-go-playground-repl-from-scratch-with-docker-aws-vuejs-2e7b</link>
      <guid>https://forem.com/gedons/building-a-go-playground-repl-from-scratch-with-docker-aws-vuejs-2e7b</guid>
      <description>&lt;p&gt;In this post, I’ll walk you through how I built a Go Playground REPL clone from scratch powered by a Go backend that compiles user-submitted code securely in Docker, deployed with GitHub Actions to AWS Elastic Beanstalk, and paired with a beautiful frontend using Vue.js, Pinia, Tailwind CSS, and Monaco Editor.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tech Stack
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Backend: Go (Golang), Docker, Gin, os/exec&lt;/li&gt;
&lt;li&gt;Frontend: Vue 3, Pinia, Tailwind CSS, Monaco Editor&lt;/li&gt;
&lt;li&gt;DevOps: GitHub Actions, DockerHub, AWS Elastic Beanstalk&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;An interactive code editor for writing and executing Go programs.&lt;/li&gt;
&lt;li&gt;A secure backend that:&lt;/li&gt;
&lt;li&gt;Runs code inside a Docker container&lt;/li&gt;
&lt;li&gt;Enforces timeouts to prevent infinite loops&lt;/li&gt;
&lt;li&gt;Handles malicious input gracefully&lt;/li&gt;
&lt;li&gt;A responsive frontend with live theme switching, program examples, and output panels.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Backend Setup
&lt;/h2&gt;

&lt;p&gt;I used the os/exec package in Go to compile and run user code inside a Docker container, isolated from the host.&lt;/p&gt;

&lt;p&gt;Sample Go run handler:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;func RunCode(c *gin.Context) {
    var payload struct {
        Code string `json:"code"`
    }

    if err := c.ShouldBindJSON(&amp;amp;payload); err != nil {
        c.JSON(http.StatusBadRequest, gin.H{"error": "Invalid request format"})
        return
    }

    output, err := runInDocker(payload.Code)
    if err != nil {
        c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
        return
    }

    c.JSON(http.StatusOK, gin.H{"output": output, "error": ""})
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Sample Dockerfile:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;FROM golang:1.24-alpine
WORKDIR /app
COPY . .
RUN go build -o repl-server ./cmd
CMD [ "./repl-server" ]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  GitHub Actions Deployment
&lt;/h2&gt;

&lt;p&gt;I set up GitHub Actions to automatically build our Docker image, push to ECR, and deploy to AWS Elastic Beanstalk.&lt;/p&gt;

&lt;p&gt;Key CI/CD steps:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- name: Build Docker Image
  run: docker build -t repl-api .

- name: Push to ECR
  run: |
    aws ecr get-login-password --region us-west-2 | docker login --username AWS --password-stdin ${{ secrets.ECR_URL }}
    docker tag repl-api:latest ${{ secrets.ECR_URL }}/repl-api:latest
    docker push ${{ secrets.ECR_URL }}/repl-api:latest

- name: Deploy to EBS
  run: |
    eb init -p docker go-repl --region us-west-2
    eb deploy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Frontend Setup
&lt;/h2&gt;

&lt;p&gt;Used Vue 3 with Pinia to manage state and Monaco Editor for code editing.&lt;/p&gt;

&lt;p&gt;Vue + Monaco Editor integration (sample):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;template&amp;gt;
  &amp;lt;MonacoEditor v-model="code" :theme="isDark ? 'vs-dark' : 'vs-light'" language="go" /&amp;gt;
&amp;lt;/template&amp;gt;

&amp;lt;script setup&amp;gt;
import MonacoEditor from '@monaco-editor/vue'
const code = ref(`package main\n\nimport "fmt"\n\nfunc main() {\n fmt.Println("Hello, world!")\n}`)
&amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Sample UI with Tailwind CSS:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;div class="max-w-4xl mx-auto px-4 py-10"&amp;gt;
  &amp;lt;h1 class="text-3xl font-bold"&amp;gt;Go Playground REPL&amp;lt;/h1&amp;gt;
  &amp;lt;div class="h-96 mt-4 border rounded bg-white"&amp;gt;
    &amp;lt;CodeEditor v-model="code" /&amp;gt;
  &amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Program Examples Dropdown
&lt;/h2&gt;

&lt;p&gt;Added dropdown support with built-in Go examples like&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fibonacci&lt;/li&gt;
&lt;li&gt;Peano Integers&lt;/li&gt;
&lt;li&gt;Prime Checker&lt;/li&gt;
&lt;li&gt;Bubble Sort&lt;/li&gt;
&lt;li&gt;Pi Calculation&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Securing Execution
&lt;/h2&gt;

&lt;p&gt;Used these techniques to sandbox the code:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Timeout using context.WithTimeout&lt;/li&gt;
&lt;li&gt;Docker resource constraints (--memory, --cpus)&lt;/li&gt;
&lt;li&gt;Output/error size limits&lt;/li&gt;
&lt;li&gt;Validated JSON input structure&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Future Improvements
&lt;/h2&gt;

&lt;p&gt;This setup is built with extensibility in mind. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Add support for JavaScript, Java, Python, etc.&lt;/li&gt;
&lt;li&gt;Enable stdin support in Docker for user input&lt;/li&gt;
&lt;li&gt;Add user accounts and save session history&lt;/li&gt;
&lt;li&gt;Use WebSocket for real-time compile streams&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  🌐 Live Demo
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://bit.ly/4iFifWT" rel="noopener noreferrer"&gt;Go Playground&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  📝 Final Thoughts
&lt;/h2&gt;

&lt;p&gt;This project was a fun blend of backend performance, frontend UX, and DevOps automation. It’s a perfect playground for experimenting with Go and building a polished, full-stack developer tool.&lt;/p&gt;

&lt;p&gt;Feel free to fork and extend it further. Hope this helps you in your learning journey!&lt;/p&gt;

&lt;p&gt;Repo &lt;br&gt;
&lt;a href="https://github.com/gedons/go_Repl" rel="noopener noreferrer"&gt;Github Repo&lt;/a&gt;&lt;/p&gt;

</description>
      <category>docker</category>
      <category>go</category>
      <category>aws</category>
      <category>vue</category>
    </item>
    <item>
      <title>Hosting a Static HTML and Tailwind CSS Website Using Surge: A Step-by-Step Guide</title>
      <dc:creator>Nerdy Gedoni</dc:creator>
      <pubDate>Mon, 22 May 2023 10:52:29 +0000</pubDate>
      <link>https://forem.com/gedons/hosting-a-static-html-and-tailwind-css-website-using-surge-a-step-by-step-guide-3g4l</link>
      <guid>https://forem.com/gedons/hosting-a-static-html-and-tailwind-css-website-using-surge-a-step-by-step-guide-3g4l</guid>
      <description>&lt;p&gt;&lt;strong&gt;Introduction:&lt;/strong&gt;&lt;br&gt;
Welcome to this informative blog post where we will take you through the step-by-step process of hosting a static HTML and Tailwind CSS website. By carefully following these instructions, you will learn how to efficiently compile your HTML and CSS files, optimize your CSS using Tailwind CSS, and ultimately publish your website on a static site hosting service. Let's delve into the details!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Project Setup&lt;/strong&gt;&lt;br&gt;
To begin, ensure that you have Node.js installed on your computer. Create a dedicated project folder and initiate a new Node.js project by executing the &lt;code&gt;npm init&lt;/code&gt; command. This action will generate a &lt;code&gt;package.json&lt;/code&gt; file to handle your project's dependencies.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2: Tailwind CSS Installation&lt;/strong&gt;&lt;br&gt;
Next, install Tailwind CSS as a project dependency by executing the command &lt;code&gt;npm install tailwindcss&lt;/code&gt;. This installation will provide you with the essential files and tools required to work effectively with Tailwind CSS.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3: Tailwind CSS Configuration&lt;/strong&gt;&lt;br&gt;
Generate a configuration file for Tailwind CSS by executing &lt;code&gt;npx tailwindcss init&lt;/code&gt;. This action will create a &lt;code&gt;tailwind.config.js&lt;/code&gt; file within your project folder. You can later customize this file to adjust the default Tailwind CSS settings according to your preferences.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4: Creation of HTML and CSS Files&lt;/strong&gt;&lt;br&gt;
Create your HTML file (e.g., &lt;code&gt;index.html&lt;/code&gt;) and CSS file (e.g., &lt;code&gt;styles.css&lt;/code&gt;) within your project folder. In your HTML file, make sure to link your CSS file using the appropriate &lt;code&gt;&amp;lt;link&amp;gt;&lt;/code&gt; tag.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 5: Harnessing the Power of Tailwind CSS&lt;/strong&gt;&lt;br&gt;
Open your CSS file (e.g., &lt;code&gt;styles.css&lt;/code&gt;) and import Tailwind CSS by adding the following lines at the top:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="k"&gt;@import&lt;/span&gt; &lt;span class="s2"&gt;'tailwindcss/base'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;@import&lt;/span&gt; &lt;span class="s2"&gt;'tailwindcss/components'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;@import&lt;/span&gt; &lt;span class="s2"&gt;'tailwindcss/utilities'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will grant you access to the extensive range of utility classes offered by Tailwind CSS for use in your project.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 6: Compiling Your CSS&lt;/strong&gt;&lt;br&gt;
Using the terminal, navigate to your project folder and execute the following command to compile your CSS:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx tailwindcss build styles.css &lt;span class="nt"&gt;-o&lt;/span&gt; output.css
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command will generate an optimized CSS file named &lt;code&gt;output.css&lt;/code&gt;, which integrates your Tailwind CSS styles seamlessly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 7: Linking the Compiled CSS&lt;/strong&gt;&lt;br&gt;
In your HTML file (e.g., &lt;code&gt;index.html&lt;/code&gt;), update the &lt;code&gt;&amp;lt;link&amp;gt;&lt;/code&gt; tag to point to the compiled CSS file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;link&lt;/span&gt; &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"stylesheet"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"output.css"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;By doing so, you ensure that your HTML file effectively utilizes the compiled and optimized Tailwind CSS.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 8: Publishing Your Website&lt;/strong&gt;&lt;br&gt;
After successfully compiling your HTML and CSS files, you can select a static site hosting service to publish your website. Some popular options include Surge, GitHub Pages, Netlify, and Vercel. Refer to the documentation provided by your chosen hosting service for detailed instructions on how to publish your static files.&lt;/p&gt;


&lt;h2&gt;
  
  
  Deploying Our Site Using Surge
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Install Surge&lt;/strong&gt;&lt;br&gt;
First, make sure you have Node.js installed on your computer. Open your terminal or command prompt and run the following command to install Surge globally:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install -g surge
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 2: Navigate to Project Folder&lt;/strong&gt;&lt;br&gt;
Using the terminal or command prompt, navigate to the root folder of your project where your compiled HTML and CSS files are located.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3: Log in or Sign up for Surge&lt;/strong&gt;&lt;br&gt;
If you haven't used Surge before, you'll need to create an account. Run the following command and follow the instructions to log in or sign up:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;surge login
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 4: Deploy Your Website&lt;/strong&gt;&lt;br&gt;
To deploy your website, run the following command:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;Surge will automatically detect the static files in your project folder and prompt you to confirm the deployment settings.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 5: Customize Domain (Optional)&lt;/strong&gt;&lt;br&gt;
If you want to use a custom domain for your website, Surge provides an option to do so. Follow the instructions provided by Surge to configure your custom domain.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 6: Access Your Hosted Website&lt;/strong&gt;&lt;br&gt;
Once the deployment process is complete, Surge will provide you with a URL where your website is hosted. You can access your website by opening that URL in a web browser.&lt;/p&gt;

&lt;p&gt;Congratulations! You have successfully hosted your website on Surge. Enjoy sharing your website with others!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion:&lt;/strong&gt;&lt;br&gt;
By following the step-by-step instructions outlined in this comprehensive guide, you have acquired the necessary knowledge to set up your project, install and configure Tailwind CSS, create HTML and CSS files, compile and optimize your CSS, and finally publish your website using a static site hosting service. Enjoy the process of crafting visually appealing and high-performing websites using HTML and Tailwind CSS!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.buymeacoffee.com/gedoni" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.buymeacoffee.com%2Fbuttons%2Fv2%2Fdefault-green.png" alt="Buy Me A Coffee" width="545" height="153"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>css</category>
      <category>tailwindcss</category>
      <category>html</category>
      <category>webhosting</category>
    </item>
    <item>
      <title>Customizing Authentication in Laravel: Building a Custom Guard</title>
      <dc:creator>Nerdy Gedoni</dc:creator>
      <pubDate>Thu, 12 Jan 2023 11:52:56 +0000</pubDate>
      <link>https://forem.com/gedons/customizing-authentication-in-laravel-building-a-custom-guard-5954</link>
      <guid>https://forem.com/gedons/customizing-authentication-in-laravel-building-a-custom-guard-5954</guid>
      <description>&lt;p&gt;Laravel Guards are used to authenticate users and control access to different parts of the application. Guards are classes that implement the guard interface and are responsible for checking the user's credentials and determining if they should be granted access to the application.&lt;br&gt;
Laravel ships with several guards out of the box, such as the session guard and the token guard, but you can also create custom guards to meet your specific needs.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;In this tutorial, I will show you how to implement a custom guard in laravel whereby creating an Admin guard that authenticates users to the admin Dashboard.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;
  
  
  1. Environment Setup
&lt;/h2&gt;

&lt;p&gt;First, You'll need to install laravel on your local machine or a development environment. here are a few resources you can use for the installations&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://laravel.com/docs/9.x/installation" rel="noopener noreferrer"&gt;Install laravel on your local machine&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.digitalocean.com/community/tutorials/how-to-install-and-set-up-laravel-with-docker-compose-on-ubuntu-22-04" rel="noopener noreferrer"&gt;Set up laravel with docker compose&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you already have laravel and composer running on your local machine then you can go ahead to create a new project.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;composer create-project laravel/laravel example-app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here is an image of how a running laravel project will look on your browser after all the installations have been done&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2F310pdmsnozb7xf24p3hs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F310pdmsnozb7xf24p3hs.png" alt=" " width="800" height="346"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Creating the Admin Model, Migration and Controller
&lt;/h2&gt;

&lt;p&gt;With an up an running laravel project, the next step is to create the admin model, migration and controller. &lt;/p&gt;

&lt;p&gt;Admin Model and  Migration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;php artisan make:model Admin -m
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;the code above creates two files, the Admin model and the Admin migration&lt;/p&gt;

&lt;p&gt;Admin Controller:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;php artisan make:controller AdminController
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  3. Structure the Admin Table for Migration
&lt;/h2&gt;

&lt;p&gt;After creating the admin migration class, the next step is to add the columns needed for the admin table. Your admin migration class should look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('admins', function (Blueprint $table) {
            $table-&amp;gt;id();
            $table-&amp;gt;string('name')-&amp;gt;nullable();
            $table-&amp;gt;string('email')-&amp;gt;unique();
            $table-&amp;gt;string('password');
            $table-&amp;gt;rememberToken();
            $table-&amp;gt;timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('admins');
    }
};

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

&lt;/div&gt;



&lt;p&gt;Now you'll need to run the migrations:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;php artisan migrate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  4. Seed Data to the Admin Table
&lt;/h2&gt;

&lt;p&gt;After your migrations have been executed successfully,  A table called &lt;code&gt;admins&lt;/code&gt; will be created in your database and we will have to seed data into the table.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Laravel includes the ability to seed your database with data using seed classes. All seed classes are stored in the database/seeders directory. By default, a DatabaseSeeder class is defined for you. From this class, you may use the call method to run other seed classes, allowing you to control the seeding order.&lt;br&gt;
Read more about laravel seeding on Laravel's official Documentation:&lt;br&gt;
&lt;a href="https://laravel.com/docs/9.x/seeding" rel="noopener noreferrer"&gt;Laravel Database Seeding&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Admin Seeder:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;php artisan make:seed AdminSeeder
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The code above creates an &lt;code&gt;Admin Seeder&lt;/code&gt; class which will be updated to look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?php

namespace Database\Seeders;

use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
use DB;

class AdminSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
         DB::table('admins')-&amp;gt;delete();
        $adminRecords = [
            [
                'id'=&amp;gt;1,'name'=&amp;gt;'Nerdy Gedoni','email'=&amp;gt;'superadmin@admin.online','password'=&amp;gt;'$2y$10$IK0Vz4QUjPIRszOIjfRvJO9PlbHB7kY6fRhJGFUIKNdxf.I3iW/ry'
            ]
          ];

          DB::table('admins')-&amp;gt;insert($adminRecords);
    }
}

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

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Note: The admin password was hashed with laravel tinker : &lt;a href="https://imwz.io/laravel-tinker-new-bcrypt-password/" rel="noopener noreferrer"&gt;hash password with laravel tinker&lt;/a&gt; &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;For our seeding to work we have to call our &lt;code&gt;AdminSeeder&lt;/code&gt; in the &lt;code&gt;DatabaseSeeder.php&lt;/code&gt; file.&lt;/p&gt;

&lt;p&gt;Head over to &lt;code&gt;\database\seeder\DatabaseSeeder.php&lt;/code&gt; file and call our &lt;code&gt;AdminSeeder&lt;/code&gt; like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?php

namespace Database\Seeders;

// use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;

class DatabaseSeeder extends Seeder
{
    /**
     * Seed the application's database.
     *
     * @return void
     */
    public function run()
    {
        $this-&amp;gt;call(AdminSeeder::class);
    }
}

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

&lt;/div&gt;



&lt;p&gt;Seed Data:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;php artisan db:seed
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  5. Create Admin Middleware And Guard
&lt;/h2&gt;

&lt;p&gt;Laravel includes a middleware that verifies the user of your application is authenticated. If the user is not authenticated, the middleware will redirect the user to your application's login screen. However, if the user is authenticated, the middleware will allow the request to proceed further into the application.&lt;/p&gt;

&lt;p&gt;Create Admin Middleware:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;php artisan make:middleware Admin
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Our Admin middleware will verify if a user(Admin) is authenticated. If the users is not it will redirect the user to the admin login route. Update your middleware to look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?php

namespace App\Http\Middleware;

use Closure;
use Illuminate\Http\Request;
use Auth;

class Admin
{
    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure(\Illuminate\Http\Request): (\Illuminate\Http\Response|\Illuminate\Http\RedirectResponse)  $next
     * @return \Illuminate\Http\Response|\Illuminate\Http\RedirectResponse
     */
    public function handle(Request $request, Closure $next)
    {
        if (!Auth::guard('admin')-&amp;gt;check()) {
            return Redirect('/admin');
        }
        return $next($request);
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now head over to our kernel.php file &lt;code&gt;app\http\kernel.php&lt;/code&gt; and plug in the admin middleware class:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    protected $routeMiddleware = [
        'auth' =&amp;gt; \App\Http\Middleware\Authenticate::class,
        'auth.basic' =&amp;gt; \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
        'auth.session' =&amp;gt; \Illuminate\Session\Middleware\AuthenticateSession::class,
        'cache.headers' =&amp;gt; \Illuminate\Http\Middleware\SetCacheHeaders::class,
        'can' =&amp;gt; \Illuminate\Auth\Middleware\Authorize::class,
        'guest' =&amp;gt; \App\Http\Middleware\RedirectIfAuthenticated::class,
        'password.confirm' =&amp;gt; \Illuminate\Auth\Middleware\RequirePassword::class,
        'signed' =&amp;gt; \App\Http\Middleware\ValidateSignature::class,
        'throttle' =&amp;gt; \Illuminate\Routing\Middleware\ThrottleRequests::class,
        'verified' =&amp;gt; \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
        'admin' =&amp;gt; \App\Http\Middleware\Admin::class,
    ];
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next we have to create the Admin Guard in our &lt;code&gt;config\auth.php&lt;/code&gt; file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  'guards' =&amp;gt; [
        'web' =&amp;gt; [
            'driver' =&amp;gt; 'session',
            'provider' =&amp;gt; 'users',
        ],

        //guard for the admin login
           'admin' =&amp;gt; [
            'driver' =&amp;gt; 'session',
            'provider' =&amp;gt; 'admins', //admin table
        ],
    ],


    'providers' =&amp;gt; [
        'users' =&amp;gt; [
            'driver' =&amp;gt; 'eloquent',
            'model' =&amp;gt; App\Models\User::class,
        ],

            'admins' =&amp;gt; [
            'driver' =&amp;gt; 'eloquent',
            'model' =&amp;gt; App\Models\Admin::class,
        ],
    ],


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

&lt;/div&gt;



&lt;h2&gt;
  
  
  6. Customize Routes
&lt;/h2&gt;

&lt;p&gt;Our updated route &lt;code&gt;routes\web.php&lt;/code&gt; will look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?php

use Illuminate\Support\Facades\Route;
use App\Http\Controllers\AdminController;


Route::get('/', function () {
    return view('welcome');
});

Auth::routes();

Route::prefix('/admin')-&amp;gt;namespace('Admin')-&amp;gt;group(function (){

    Route::get('/', [AdminController::class, 'login']);
    Route::post('login', [AdminController::class, 'loginAdmin'])-&amp;gt;name('admin.login');

    Route::group(['middleware'=&amp;gt;['admin']],function ()
    {
        Route::get('dashboard', [AdminController::class, 'dashboard'])-&amp;gt;name('admin.dashboard');
        Route::post('logout', [AdminController::class, 'logout'])-&amp;gt;name('admin.logout');

    });
});

Route::get('/home', [App\Http\Controllers\HomeController::class, 'index'])-&amp;gt;name('home');

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  7. Update the Admin Model And Controller
&lt;/h2&gt;

&lt;p&gt;Now we have completed the routes in the &lt;code&gt;web.php&lt;/code&gt; file we head over to the admin model and update it to something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
//imported
use Illuminate\Foundation\Auth\User as Authenticatable;

class Admin extends Authenticatable
{
    use HasFactory;

    protected $guard = 'admin';

    protected $fillable = [
        'name',
        'email',
        'password',
        'created_at',
        'updated_at',

    ];

    protected $hidden = [
        'password',
        'remember_token',
    ];

}

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

&lt;/div&gt;



&lt;p&gt;Finally update your AdminController to this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Models\User;
use Auth;

class AdminController extends Controller
{
     public function login(){
        return view('admin.login');
    }

    public function loginAdmin(Request $request){

          if (Auth::guard('admin')-&amp;gt;attempt(['email'=&amp;gt;$request['email'], 'password'=&amp;gt;$request['password']])) {
            return Redirect('admin/dashboard')-&amp;gt;with('message', 'Logged In Successfully...');
        }
        else{
            return Redirect()-&amp;gt;back()-&amp;gt;with('message', 'Invalid Login Details');
        }
    }

    public function dashboard()
    {
        return view('admin.dashboard');
    }


    public function logout()
    {
        Auth::guard('admin')-&amp;gt;logout();
        return Redirect('/admin')-&amp;gt;with('message', 'Logged Out Successfully... ');
    }
}

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

&lt;/div&gt;



&lt;p&gt;The AdminController has four methods, &lt;code&gt;login&lt;/code&gt;, &lt;code&gt;loginAdmin&lt;/code&gt;, &lt;code&gt;dashboard&lt;/code&gt;, &lt;code&gt;logout&lt;/code&gt;.&lt;br&gt;
&lt;code&gt;login&lt;/code&gt;: returns the admin login view&lt;br&gt;
&lt;code&gt;loginAdmin&lt;/code&gt;: Authenticates and return the admin dashboard&lt;br&gt;
&lt;code&gt;dashboard&lt;/code&gt;: returns the admin dashboard&lt;br&gt;
&lt;code&gt;logout&lt;/code&gt;: log's out the admin&lt;/p&gt;
&lt;h2&gt;
  
  
  8. Creating the Login And Dashboard Views
&lt;/h2&gt;

&lt;p&gt;Finally we will create the admin login and admin dashboard in thee views folder &lt;code&gt;resources\views\admin\&lt;/code&gt;. Our structure should look like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2F7h85clnolylat797mkxp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F7h85clnolylat797mkxp.png" alt=" " width="211" height="285"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now update the respective views.&lt;/p&gt;

&lt;p&gt;Login:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!doctype html&amp;gt;
&amp;lt;html lang="{{ str_replace('_', '-', app()-&amp;gt;getLocale()) }}"&amp;gt;
    &amp;lt;head&amp;gt;
        &amp;lt;meta charset="utf-8"&amp;gt;
        &amp;lt;meta name="viewport" content="width=device-width, initial-scale=1"&amp;gt;
        &amp;lt;!-- CSRF Token --&amp;gt;
        &amp;lt;meta name="csrf-token" content="{{ csrf_token() }}"&amp;gt;
        &amp;lt;title&amp;gt;{{ config('app.name', 'Laravel') }}&amp;lt;/title&amp;gt;
        &amp;lt;!-- Fonts --&amp;gt;
        &amp;lt;link rel="dns-prefetch" href="//fonts.gstatic.com"&amp;gt;
        &amp;lt;link href="https://fonts.bunny.net/css?family=Nunito" rel="stylesheet"&amp;gt;
        &amp;lt;!-- Scripts --&amp;gt;
        @vite(['resources/sass/app.scss', 'resources/js/app.js'])
    &amp;lt;/head&amp;gt;
    &amp;lt;body&amp;gt;
        &amp;lt;div id="app"&amp;gt;
            &amp;lt;nav class="navbar navbar-expand-md navbar-light bg-white shadow-sm"&amp;gt;
                &amp;lt;div class="container"&amp;gt;
                    &amp;lt;a class="navbar-brand" href="{{ url('/') }}"&amp;gt;
                        {{ config('app.name', 'Laravel') }}
                    &amp;lt;/a&amp;gt;
                    &amp;lt;button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="{{ __('Toggle navigation') }}"&amp;gt;
                    &amp;lt;span class="navbar-toggler-icon"&amp;gt;&amp;lt;/span&amp;gt;
                    &amp;lt;/button&amp;gt;
                    &amp;lt;div class="collapse navbar-collapse" id="navbarSupportedContent"&amp;gt;
                        &amp;lt;!-- Left Side Of Navbar --&amp;gt;
                        &amp;lt;ul class="navbar-nav me-auto"&amp;gt;
                        &amp;lt;/ul&amp;gt;
                        &amp;lt;!-- Right Side Of Navbar --&amp;gt;
                        &amp;lt;ul class="navbar-nav ms-auto"&amp;gt;

                        &amp;lt;/ul&amp;gt;
                    &amp;lt;/div&amp;gt;
                &amp;lt;/div&amp;gt;
            &amp;lt;/nav&amp;gt;
            &amp;lt;main class="py-4"&amp;gt;
                &amp;lt;div class="container"&amp;gt;
                    &amp;lt;div class="row justify-content-center"&amp;gt;
                        &amp;lt;div class="col-md-8"&amp;gt;
                            &amp;lt;div class="card"&amp;gt;
                                &amp;lt;div class="card-header"&amp;gt;{{ __('Admin Login') }}&amp;lt;/div&amp;gt;
                                &amp;lt;div class="card-body"&amp;gt;
                                    &amp;lt;form method="POST" action="{{ route('admin.login') }}"&amp;gt;
                                        @csrf
                                        &amp;lt;div class="row mb-3"&amp;gt;
                                            &amp;lt;label for="email" class="col-md-4 col-form-label text-md-end"&amp;gt;{{ __('Email Address') }}&amp;lt;/label&amp;gt;
                                            &amp;lt;div class="col-md-6"&amp;gt;
                                                &amp;lt;input id="email" type="email" class="form-control" name="email" value="{{ old('email') }}" required autocomplete="email" autofocus&amp;gt;

                                            &amp;lt;/div&amp;gt;
                                        &amp;lt;/div&amp;gt;
                                        &amp;lt;div class="row mb-3"&amp;gt;
                                            &amp;lt;label for="password" class="col-md-4 col-form-label text-md-end"&amp;gt;{{ __('Password') }}&amp;lt;/label&amp;gt;
                                            &amp;lt;div class="col-md-6"&amp;gt;
                                                &amp;lt;input id="password" type="password" class="form-control" name="password" required autocomplete="current-password"&amp;gt;

                                            &amp;lt;/div&amp;gt;
                                        &amp;lt;/div&amp;gt;

                                        &amp;lt;div class="row mb-0"&amp;gt;
                                            &amp;lt;div class="col-md-8 offset-md-4"&amp;gt;
                                                &amp;lt;button type="submit" class="btn btn-primary"&amp;gt;
                                                {{ __('Login') }}
                                                &amp;lt;/button&amp;gt;

                                            &amp;lt;/div&amp;gt;
                                        &amp;lt;/div&amp;gt;
                                    &amp;lt;/form&amp;gt;
                                &amp;lt;/div&amp;gt;
                            &amp;lt;/div&amp;gt;
                        &amp;lt;/div&amp;gt;
                    &amp;lt;/div&amp;gt;
                &amp;lt;/div&amp;gt;
            &amp;lt;/main&amp;gt;
        &amp;lt;/div&amp;gt;
    &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Dashboard:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
    &amp;lt;head&amp;gt;
        &amp;lt;meta charset="utf-8"&amp;gt;
        &amp;lt;meta name="viewport" content="width=device-width, initial-scale=1"&amp;gt;
        &amp;lt;!-- CSRF Token --&amp;gt;
        &amp;lt;meta name="csrf-token" content="{{ csrf_token() }}"&amp;gt;
        &amp;lt;title&amp;gt;{{ config('app.name', 'Laravel') }}&amp;lt;/title&amp;gt;
        &amp;lt;!-- Fonts --&amp;gt;
        &amp;lt;link rel="dns-prefetch" href="//fonts.gstatic.com"&amp;gt;
        &amp;lt;link href="https://fonts.bunny.net/css?family=Nunito" rel="stylesheet"&amp;gt;
        &amp;lt;!-- Scripts --&amp;gt;
        @vite(['resources/sass/app.scss', 'resources/js/app.js'])
    &amp;lt;/head&amp;gt;
    &amp;lt;body&amp;gt;
        &amp;lt;nav class="navbar navbar-expand-md navbar-light bg-white shadow-sm"&amp;gt;
            &amp;lt;div class="container"&amp;gt;
                &amp;lt;a class="navbar-brand" href="{{ url('/') }}"&amp;gt;
                    {{ config('app.name', 'Laravel') }}
                &amp;lt;/a&amp;gt;
                &amp;lt;button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="{{ __('Toggle navigation') }}"&amp;gt;
                &amp;lt;span class="navbar-toggler-icon"&amp;gt;&amp;lt;/span&amp;gt;
                &amp;lt;/button&amp;gt;
                &amp;lt;div class="collapse navbar-collapse" id="navbarSupportedContent"&amp;gt;
                    &amp;lt;!-- Left Side Of Navbar --&amp;gt;
                    &amp;lt;ul class="navbar-nav me-auto"&amp;gt;

                    &amp;lt;/ul&amp;gt;
                    &amp;lt;!-- Right Side Of Navbar --&amp;gt;
                    &amp;lt;ul class="navbar-nav ms-auto"&amp;gt;
                        &amp;lt;li&amp;gt;
                            &amp;lt;a class="nav-link"href="{{ route('admin.logout') }}"
                                onclick="event.preventDefault();
                                document.getElementById('logout-form').submit();"&amp;gt;
                                {{ __('Logout') }}
                            &amp;lt;/a&amp;gt;
                            &amp;lt;form id="logout-form" action="{{ route('admin.logout') }}" method="POST" class="d-none"&amp;gt;
                                @csrf
                            &amp;lt;/form&amp;gt;
                        &amp;lt;/li&amp;gt;
                    &amp;lt;/ul&amp;gt;
                &amp;lt;/div&amp;gt;
            &amp;lt;/div&amp;gt;
        &amp;lt;/nav&amp;gt;
        &amp;lt;main class="py-4"&amp;gt;
            &amp;lt;div class="container"&amp;gt;
                &amp;lt;div class="row justify-content-center"&amp;gt;
                    &amp;lt;div class="col-md-8"&amp;gt;
                        &amp;lt;div class="card"&amp;gt;
                            &amp;lt;div class="card-header"&amp;gt;Welcome Admin!!!&amp;lt;/div&amp;gt;
                        &amp;lt;/div&amp;gt;
                    &amp;lt;/div&amp;gt;
                &amp;lt;/div&amp;gt;
            &amp;lt;/div&amp;gt;
        &amp;lt;/main&amp;gt;
    &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Finally, we are done. We've just created our custom guard that verifies if a user is authenticated and hereby navigates the authenticated user to the admin section of our application.&lt;/p&gt;

&lt;p&gt;Url: &lt;code&gt;localhost\admin&lt;/code&gt;: &lt;br&gt;
Returns the admin login page for authentication&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fmerho79z7wv21ssxni77.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fmerho79z7wv21ssxni77.png" alt=" " width="800" height="337"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Url: &lt;code&gt;localhost\admin\dashboard&lt;/code&gt;: &lt;br&gt;
After user authenticated, returns dashboard&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fnipvy916zry425m86j35.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fnipvy916zry425m86j35.png" alt=" " width="800" height="269"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Where Next!
&lt;/h2&gt;

&lt;p&gt;After this extensive tutorial, you might want to dive deeper into laravel authentications in order to secure your application in every possible way as well as implement more complex actions&lt;/p&gt;

&lt;p&gt;Quick Links:&lt;br&gt;
&lt;a href="https://laravel.com/docs/9.x" rel="noopener noreferrer"&gt;Laravel Documentaion&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.tutorialspoint.com/laravel/laravel_authentication.htm" rel="noopener noreferrer"&gt;Authentication&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.buymeacoffee.com/gedoni" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.buymeacoffee.com%2Fbuttons%2Fv2%2Fdefault-green.png" alt="Buy Me A Coffee" width="545" height="153"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>ai</category>
    </item>
  </channel>
</rss>
