<?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: Coding Noob</title>
    <description>The latest articles on Forem by Coding Noob (@codingnoob).</description>
    <link>https://forem.com/codingnoob</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%2F1235735%2Fdfaec02a-c400-4d15-b27e-f150534d71ae.jpeg</url>
      <title>Forem: Coding Noob</title>
      <link>https://forem.com/codingnoob</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/codingnoob"/>
    <language>en</language>
    <item>
      <title>Breaking free from tutorial hell Part-2</title>
      <dc:creator>Coding Noob</dc:creator>
      <pubDate>Wed, 20 Dec 2023 16:20:02 +0000</pubDate>
      <link>https://forem.com/codingnoob/breaking-free-from-tutorial-hell-part-2-5efk</link>
      <guid>https://forem.com/codingnoob/breaking-free-from-tutorial-hell-part-2-5efk</guid>
      <description>&lt;p&gt;Alright Part 2 of me trying to get out of tutorial hell.&lt;/p&gt;

&lt;h2&gt;
  
  
  What did I manage to accomplish till now?
&lt;/h2&gt;

&lt;p&gt;Yesterday was an authentication adventure! I plunged into the world of NextAuth and user management, determined to conquer all challenges without the crutch of tutorials(mostly). It wasn't a walk in the park, though.&lt;/p&gt;

&lt;p&gt;First, setting up NextAuth with NextJS 14 proved trickier than anticipated. Turns out, only the beta version works with the latest NextJs 14 framework – who knew? After wrestling with beta code and cryptic error messages, I finally managed to make it work somehow, And now I had a basic OAuth with Google and Git Hub, only to face another hurdle: the database adapter.&lt;/p&gt;

&lt;p&gt;I envisioned Prisma waltzing with my PostgreSQL database, simplifying interactions with SQL's cryptic tongue. Alas, NextJS middleware and Vercel Edge runtime had a different plan. Prisma Client wasn't welcome there, forcing me to abandon middleware and guard routes with individual page checks.&lt;/p&gt;

&lt;p&gt;But hey, progress! Authentication flowed smoothly, user data was comfortably posted to the database. Now came the real dance: building functions for adding, updating, and deleting to-dos.&lt;/p&gt;

&lt;p&gt;Here's where things got spicy. Every to-do had to be a one-man show, visible and editable only by its creator. To pull this off, I needed the user ID – a missing piece in the session data. After watching tons of tutorials and reading a lot of docs I managed to figure out how to attach the userid to the session by using a callback function. Finally, the user ID joined the party, allowing me to attach it to to-dos and track each user's creations.&lt;/p&gt;

&lt;p&gt;Server-side magic took over once the user ID puzzle was solved. Through carefully orchestrated actions, to-dos were born, each inextricably linked to their creator's ID. This seamless dance of data ensured that every to-do remained visible and editable only to its destined user.&lt;/p&gt;

&lt;p&gt;Voila! A small project, built (mostly) solo, free from the clutches of tutorials. It wasn't always graceful and if someone who knows what they are doing read my code they might die of cringe, but the journey was just as rewarding as the destination.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>beginners</category>
      <category>codenewbie</category>
      <category>tutorialhell</category>
    </item>
    <item>
      <title>Trying to get out of the tutorial hell.</title>
      <dc:creator>Coding Noob</dc:creator>
      <pubDate>Mon, 18 Dec 2023 16:15:32 +0000</pubDate>
      <link>https://forem.com/codingnoob/trying-to-get-out-of-the-tutorial-hell-m97</link>
      <guid>https://forem.com/codingnoob/trying-to-get-out-of-the-tutorial-hell-m97</guid>
      <description>&lt;p&gt;&lt;strong&gt;Warning: I have no idea what I am doing and I have never done this before.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Hello, I'm a relatively new coder trying to become a full-stack web developer. I have been learning coding for about half a year now but I am deep inside tutorial hell and cannot code any projects on my own.&lt;/p&gt;

&lt;p&gt;I have built multiple projects by just mindlessly following tutorials on YouTube. Even after all these tutorials, I cannot build even a simple project on my own. So I decided to build some projects on my own and become a better coder.&lt;/p&gt;

&lt;p&gt;A very short term goal I have is to build a basic admin dashboard by the end of this year.&lt;/p&gt;

&lt;p&gt;This blog is for me to keep myself accountable and motivated to code daily.&lt;/p&gt;

&lt;h2&gt;
  
  
  How much do I know?
&lt;/h2&gt;

&lt;p&gt;I feel like I know all of these but I just can't apply them to actual projects.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt; &lt;strong&gt;The basics&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;HTML, CSS, and JS.&lt;/li&gt;
&lt;li&gt;A little bit of React for the front-end.&lt;/li&gt;
&lt;li&gt;Express for backend&lt;/li&gt;
&lt;li&gt; MongoDB.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;A bit more advanced stuff that I think I know.&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Typescript&lt;/li&gt;
&lt;li&gt;Next.Js (I think this is kind of easy if you know React)&lt;/li&gt;
&lt;li&gt;ZOD&lt;/li&gt;
&lt;li&gt;SQL (PostgreSQL)&lt;/li&gt;
&lt;li&gt;Prisma
## Building a Todo List&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Yeah, that is the best thing I was even remotely confident in being able to build on my own.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How did I build it?&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; I first set up a basic Next.Js project (Yeah I decided to build it in Next.Js because I like the App Router and the server actions)&lt;/li&gt;
&lt;li&gt;Set up Shadcn-ui 

&lt;ul&gt;
&lt;li&gt;Shadcn because I like the default theme it has.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Created a basic modal with shadcn-ui that is used to Add a new Todo.&lt;/li&gt;
&lt;li&gt;The modal has an Input form with simple validation using ZOD.&lt;/li&gt;
&lt;li&gt;On submission of the form a server action is triggered to create a new todo using Prisma.&lt;/li&gt;
&lt;li&gt;All the stored todos are displayed on the front end on a Table.&lt;/li&gt;
&lt;li&gt;You can also delete or edit the to-do.&lt;/li&gt;
&lt;li&gt;The Edit todo also opens a modal with an Input form with the current data already pre-filled.&lt;/li&gt;
&lt;li&gt;You cannot mark the todo as Done because I completely forgot about that.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  What Next?
&lt;/h3&gt;

&lt;p&gt;There are a lot of things missing from this like no loading, and no proper error handling but it is a start.&lt;/p&gt;

&lt;p&gt;So now the task is to fix those and re-factor the code because the code that I have written is horrible.&lt;/p&gt;

&lt;p&gt;Authentication is very important too.&lt;br&gt;
I was messing around with NextAuth for authentication but it was hard to add it after the latest update.&lt;br&gt;
I did manage to add it but it was using drizzle adapter for some reason the Prisma adapter did not work for me. Maybe I am just too dumb for this.&lt;/p&gt;

&lt;p&gt;Screenshots of what I accomplished today.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--79uDjZbD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3dspkw12fkxxx7qzgsdj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--79uDjZbD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3dspkw12fkxxx7qzgsdj.png" alt="Image description" width="755" height="521"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;It ain't much but it's a start.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Thats all I did today Thank you&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>webdev</category>
      <category>tutorialhell</category>
    </item>
  </channel>
</rss>
