<?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: gilbert-kiana</title>
    <description>The latest articles on DEV Community by gilbert-kiana (@gilbertintabo).</description>
    <link>https://dev.to/gilbertintabo</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%2F545875%2Fda99d766-614d-486d-89cb-03d718c5f8e5.png</url>
      <title>DEV Community: gilbert-kiana</title>
      <link>https://dev.to/gilbertintabo</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/gilbertintabo"/>
    <language>en</language>
    <item>
      <title>Building my dev portfolio from scratch with MERN Stack.</title>
      <dc:creator>gilbert-kiana</dc:creator>
      <pubDate>Thu, 11 Jan 2024 13:31:32 +0000</pubDate>
      <link>https://dev.to/gilbertintabo/building-my-dev-portfolio-from-scratch-with-mern-stack-43oe</link>
      <guid>https://dev.to/gilbertintabo/building-my-dev-portfolio-from-scratch-with-mern-stack-43oe</guid>
      <description>&lt;p&gt;&lt;strong&gt;Intro&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In November of 2023, I decided to revamp my portfolio, realizing the importance of showcasing my work as a developer. I had previously used a generic GitHub template, which lacked the personal touch I sought. However introverted you are it is essential to put yourself out there as a developer, I decided to change my approach and started sharing my insights on Twitter while simultaneously working on a new and improved portfolio. I hope this inspires you to start showcasing your work.&lt;/p&gt;

&lt;p&gt;This blog provides an overview of the design process, the technology stack employed, and the future of the site.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Design Principles and Tech Stack&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I opted for a minimalistic design that prioritized visual appeal and functionality. React served as the frontend framework for the full-stack application, and Tailwind CSS provided seamless styling. The backend was powered by Node.js’s API with MongoDB as the database&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Choosing React and Tailwind&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Given the requirement of React in many front-end jobs, I choose it as my framework of choice. I also love Tailwind CSS for its ease of use and comprehensive documentation. While some components utilize normal CSS, Tailwind is easier when creating responsive designs, especially for mobile.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Workflow&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The development process began with the front end, focusing on three core pages: Home, Blog, and Contact. The Home page featured a slider showcasing my projects using Swiper Js, with data sourced from a JSON file. &lt;/p&gt;

&lt;p&gt;The Blog page, more complex, required the creation of an API for fetching blogs, So I used the JSON Server tool to serve as a placeholder API for designing the blog page. &lt;/p&gt;

&lt;p&gt;The Contact page seamlessly integrated functions redirecting to phone and WhatsApp apps. Initially, email functionality is handled by Typeform, with a potential shift to Email.js due to limitations. Typeform only offers 10 emails per month in the free tier.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;State Management and Backend Setup&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Context API facilitated state management, storing user information in local storage. On the backend, Node.js established routes and postman for testing. The database was Mongo.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Deployment&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Frontend hosting is on Truehost, while for the backend I leveraged Render's free tier, which essentially means the blogs will load slower.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;In summary&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Frontend Tools: React, Vite, React-Quill for rich text editing, Swiper, Slick-carousel, and Tailwind CSS.&lt;br&gt;
Backend: Mongo Db and Node Js.&lt;br&gt;
Site Pages: Home, Blog, Contact, and Single Post&lt;br&gt;
Admin: Add Blog, edit blog, delete blog, and login.&lt;br&gt;
Components: Editor, Footer, Header, Hero Section, Hero Swiper, Navlist, Post, and Single Post.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Functionalities to add:&lt;/strong&gt;&lt;br&gt;
Shop for selling Designs.&lt;br&gt;
Payment integration through cards and M-Pesa.&lt;br&gt;
Chatbot for inquiries or live chat.&lt;br&gt;
Blog categories, resume/CV section.&lt;br&gt;
Blog comment section.&lt;br&gt;
Analytics.&lt;br&gt;
Switch to redux for state management.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;While this is a brief overview, the journey involved overcoming numerous challenges, which I'll delve into in Part 2 of this blog. Stay tuned for a deeper insight into problem-solving and the evolution of my developer portfolio. &lt;/p&gt;

</description>
    </item>
    <item>
      <title>Handling Image Uploads in Node with Multer and Cloudinary</title>
      <dc:creator>gilbert-kiana</dc:creator>
      <pubDate>Thu, 04 Jan 2024 10:45:35 +0000</pubDate>
      <link>https://dev.to/gilbertintabo/handling-image-uploads-in-node-with-multer-and-cloudinary-1e70</link>
      <guid>https://dev.to/gilbertintabo/handling-image-uploads-in-node-with-multer-and-cloudinary-1e70</guid>
      <description>&lt;p&gt;Hey there! 👋 I recently ran into a bit of a challenge while creating my &lt;a href="https://gilbertintabo.com/"&gt;portfolio&lt;/a&gt;. I had a blog page with cover images, and initially, I used Multer to upload images to a local folder on my server. Everything worked like a charm until I decided to host my site on Render directly from GitHub. The images weren't uploading to GitHub, which wasn't surprising.&lt;/p&gt;

&lt;p&gt;I decided to use cloud-based storage and opted for Cloudinary. In this guide, I'll walk you through how I set up Cloudinary on my server integrated it with Multer, and saved the image links to MongoDB.Solving my problem.&lt;/p&gt;

&lt;p&gt;I started by installing the dependencies.&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 multer cloudinary dotenv
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Before diving into code, I had to set up &lt;a href="https://cloudinary.com/users/register_free"&gt;Cloudinary account&lt;/a&gt; and grab my API key, API secret, and cloud name from the dashboard. I added a .env file in my server's root folder and populated it 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;CLOUDINARY_API_KEY=your_api_key
CLOUDINARY_API_SECRET=your_api_secret
CLOUDINARY_CLOUD_NAME=your_cloud_name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, I created a utils folder and within it, a file named cloudinary.js to configure my Cloudinary setup:&lt;br&gt;
&lt;/p&gt;

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

const cloudinary = require('cloudinary').v2;
require('dotenv').config();

cloudinary.config({
  cloud_name: process.env.CLOUDINARY_CLOUD_NAME,
  api_key: process.env.CLOUDINARY_API_KEY,
  api_secret: process.env.CLOUDINARY_API_SECRET,
});

module.exports = cloudinary;

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

&lt;/div&gt;



&lt;p&gt;Now, in my root folder, I set up a middleware folder, and within it I Created a file named multer.js to configure Multer:&lt;br&gt;
&lt;/p&gt;

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

const multer = require('multer');

const storage = multer.memoryStorage();
const upload = multer({ storage: storage });

module.exports = upload;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;imported these two files into my post controllers like this:&lt;/p&gt;

&lt;p&gt;// Your post controllers file&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
const cloudinary = require('./utils/cloudinary');
const upload = require('./multer');
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, in my post route, I can upload a file and wait until it's uploaded using a promise before adding the rest of the form data from the body. Here's how my post route looks:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--bOlU9Ku2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z6aq4u6nkhmacwcx9tba.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bOlU9Ku2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z6aq4u6nkhmacwcx9tba.png" alt="my post route" width="669" height="304"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3anHT4S8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cfp1zarwkwattoxrh3qa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3anHT4S8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cfp1zarwkwattoxrh3qa.png" alt="my post route body" width="662" height="277"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>node</category>
      <category>multe</category>
      <category>cloudinary</category>
      <category>images</category>
    </item>
  </channel>
</rss>
