<?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: David Moishe</title>
    <description>The latest articles on DEV Community by David Moishe (@dovidmoishe).</description>
    <link>https://dev.to/dovidmoishe</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%2F970458%2Fecb8f0d4-1dbe-474b-905f-941cfbb13c14.png</url>
      <title>DEV Community: David Moishe</title>
      <link>https://dev.to/dovidmoishe</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dovidmoishe"/>
    <language>en</language>
    <item>
      <title>Challenge app - MongoDB Atlas Hackathon 2022 and my first Dev Post</title>
      <dc:creator>David Moishe</dc:creator>
      <pubDate>Thu, 08 Dec 2022 19:59:29 +0000</pubDate>
      <link>https://dev.to/dovidmoishe/mongodb-atlas-hackathon-2022-and-my-first-dev-post-2kbl</link>
      <guid>https://dev.to/dovidmoishe/mongodb-atlas-hackathon-2022-and-my-first-dev-post-2kbl</guid>
      <description>&lt;p&gt;Hello there, and welcome to my first DEV post!&lt;br&gt;
My name is David and I have built a project for my first ever Hackathon.&lt;/p&gt;
&lt;h2&gt;
  
  
  What I built
&lt;/h2&gt;

&lt;p&gt;Have you ever heard of #100daysofcode or #30daysoftechnicalwriting? There are chances that you have participated in a challenge before even though it's not any of the challenges I mentioned. What is the main purpose of a challenge? to help improve one's skills, and to help someone to build a good habit, usually on every day of a challenge people write down their progress either on a notebook or share it on twitter for people to see. You understand the Idea? Now I'll share what I've built, I've built a social media API to help users keep track of their progress on any challenge they are on, so that you can share your progress with friends and read it later to see how far you have gone.&lt;br&gt;
My tech stack: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Database: MongoDB Atlas&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Server: NodeJS, ExpressJS and JavaScript&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Authentication: JWTs, bcrypt and &lt;a class="mentioned-user" href="https://dev.to/hapi"&gt;@hapi&lt;/a&gt;/joi library&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  Category Submission:
&lt;/h3&gt;

&lt;p&gt;The category is "Choose Your Own Adventure".&lt;/p&gt;
&lt;h3&gt;
  
  
  How does it work?
&lt;/h3&gt;

&lt;p&gt;For this API, I wrote a few schemas for different collections for the database, such as&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The user collection: To store users&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The challenge collection: To store all challenges&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The progress collection: To store all progress&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The Image collection: To store all Images(with their encoded data)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--kDy1XaZy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4n34a10sukz90w43khy7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--kDy1XaZy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4n34a10sukz90w43khy7.png" alt="Database Dashboard" width="880" height="423"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Some Important API endpoints
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;/user/signup&lt;/strong&gt; : Creates a new User and stores the information in the user collection.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Sample document&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--FgVSRxQS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yjr8zx0ue2e0ux6xxg7u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--FgVSRxQS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yjr8zx0ue2e0ux6xxg7u.png" alt="Sample document" width="880" height="369"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;/user/login&lt;/strong&gt; : Loges in a user&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;/challenges/new&lt;/strong&gt; : Creates a new challenge&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Sample document&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Mpjggrdy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nczfoouzne6wspjslv7g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Mpjggrdy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nczfoouzne6wspjslv7g.png" alt="Sample document" width="880" height="525"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;/challenges/me&lt;/strong&gt; : Returns all the challenges of the user logged in&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;/challenges/public&lt;/strong&gt; : Returns all the challenges whose visibility is true, how other users described it and how many other users are on the challenge. Cool right?&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Sample response&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--DLV-t80B--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zpvf1m8msgd79dyhg89w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--DLV-t80B--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zpvf1m8msgd79dyhg89w.png" alt="Sample response" width="880" height="502"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;/challenge/:challengeId&lt;/strong&gt; : Returns a challenge and all its progress from the Progress collection&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1-Pe0ivl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8ln8opump7xue9217obk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1-Pe0ivl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8ln8opump7xue9217obk.png" alt="Sample response" width="880" height="495"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;/challenge/progress/:challengeId&lt;/strong&gt; : Adds an Image to the Image collection and adds a progress to the progress collection with reference to its challenge and the Id of the image for the progress&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Sample document&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1z7Zz4-G--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yu4rrgu4z9sgvbv8d0yu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1z7Zz4-G--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yu4rrgu4z9sgvbv8d0yu.png" alt="Sample document" width="880" height="578"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Description
&lt;/h3&gt;

&lt;p&gt;In this app you have the power to create public/private challenges, write your progress for challenges with attachements such as links and images, view public challenges, and share your progress with friends.&lt;/p&gt;
&lt;h3&gt;
  
  
  Link to Source Code
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://github.com/dovidmoishe/challenge-app-backend"&gt;https://github.com/dovidmoishe/challenge-app-backend&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Permissive License
&lt;/h3&gt;

&lt;p&gt;MIT license&lt;/p&gt;
&lt;h2&gt;
  
  
  Background
&lt;/h2&gt;

&lt;p&gt;The first ever challenge I took was #100 pushups a day for 30days and I thought to myself wouldn't it be awesome for me to be able to go back and look at how far I've come?. Thank you mongodb for giving me this amazing opportunity to learn while build an amazing project like this.&lt;/p&gt;
&lt;h2&gt;
  
  
  My future plans for this app
&lt;/h2&gt;

&lt;p&gt;This is not the end of this project yet, I will create a React + TailwindCSS frontend soon and create a full tutorial on how I created this app on DEV&lt;/p&gt;
&lt;h3&gt;
  
  
  Additional Resources/Info
&lt;/h3&gt;

&lt;p&gt;This video gave me some information that I didn't know about mongodb, for example, that MongoDB documents have a 16MB size limit, this was what encouraged me to create different collections for the progress and the images(because encoded images can take a bit of space)&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/QAqK-R9HUhc"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>atlashackathon22</category>
      <category>mongodb</category>
      <category>javascript</category>
      <category>node</category>
    </item>
  </channel>
</rss>
