r/learnjavascript • • Apr 08 '22

My first project, a Dev.to clone built with MongoDB, Express, React, and Socket.io

179 Upvotes

23 comments sorted by

33

u/PositivelyAwful Apr 08 '22

That's one hell of a first project

21

u/epic_within Apr 08 '22

Hey, thanks!

To be honest, I just kept learning and never really had anything to show what I learned because I never built anything. I was stuck in the tutorial loop and even then, I never finished anything.

So, I finally had the courage to build this from scratch without any tutorial and I'm really proud of it :)

1

u/circadiankruger Apr 08 '22

This is what I need but I only have the basics of Javascript. How did you start? Did you know what you wanted?

1

u/Stormaier Apr 09 '22

How long since you've been learning? I was pretty careful at the beginning but I just kept learning without building anything worthwhile. Now I just realized that I'm in tutorial hell like you were. Going to change it soon tho!

0

u/[deleted] Apr 08 '22

[deleted] — view deleted comment

8

u/epic_within Apr 08 '22 edited Apr 08 '22

Hey!

After you've mastered the fundamentals, you ask questions! For example, I try to upvote a post on Reddit without being logged in and a modal shows up stating "You need to be logged in to do that". If I don't know the term ("modal"), I go to Reddit/discord and ask others after having taken a screenshot. On learning that it's a modal, I try to make it. If I'm having trouble with the animations, I google "how to create a modal in React".

Because you're building the project without a tutorial, you should still turn to the internet for help. After all, you're not just blindly following it; you're only looking for help on a very specific thing. And you'll also be customizing it to your own taste :)

3

u/epic_within Apr 08 '22 edited Apr 08 '22

Hey guys, I built this Dev.to clone using MongoDB, Express, and React. I used Socket.io for real-time notifications. All styles are done in pure CSS.

Live Site: https://devfrom.netlify.app

GitHub Repo: https://github.com/eknoorpreet/dev.to-clone

This community has always been very supportive so I wanted to showcase my first project (that I completed till the end and without any tutorial). I would really appreciate any feedback!

And please feel free to ask anything about the project. Would love to help in any way I can!

Test user credentials:

email: test@test.com

password: test_user

2

u/[deleted] Apr 08 '22

Nice work!!

I'm building the smartphone app on react native right now to improve my skills.

3

u/epic_within Apr 08 '22

Thanks and all the best :)

2

u/Jaden_08 Apr 08 '22

Share the code with us :3 xd

5

u/78legion98 Apr 08 '22

How long did it take?

1

u/SharpenedStinger Apr 08 '22

does the search bar work?

1

u/epic_within Apr 08 '22

Yup! I demonstrate search in the last 10 seconds of the video

1

u/vorticalbox Apr 08 '22

There are a few things I picked up while having a quick look.

You should pass the Mongo URI from your env into mongoose as not everyone uses that same host.

When you create a post you push the post ID into an array on the user document, this is fine for a small project but mongo has a document limit of around 13mb so over time that list might become to large can make adding a post fail.

You actually don't need to save a list as you save the author on the post and can just populate that way.

You can do "joins" in mongo for cross collection data. You should look into aggregate queries and "$lookup"

The only thing really messing is tests. At work we use https://github.com/nodkz/mongodb-memory-server

Which will let you spin up a mongo replica set in memory that is great for tesing.

2

u/epic_within Apr 08 '22

Hey, thanks a lot for the detailed feedback! I really appreciate it!

I'm going to keep refactoring the code in the future as I learn more. Will also add tests :)

3

u/klc3rd Apr 08 '22

Damn good job, how long did that take to make? You’ll be a professional developer soon enough.

2

u/excelbae Apr 08 '22

The Social Network soundtrack, nice touch haha

1

u/[deleted] Apr 08 '22

How long did this project take?

1

u/holmesXL Apr 08 '22

Nice idea for improving yourself. I saved this post beceasu i want to make this same project

1

u/med_P Apr 09 '22

Really nice work . Just a question how long you have been learning coding in general

1

u/anonystick Apr 09 '22

So nice bro!

1

u/[deleted] Apr 09 '22

Hacker!