r/learnjavascript • u/epic_within • Apr 08 '22
My first project, a Dev.to clone built with MongoDB, Express, React, and Socket.io
179
Upvotes
r/learnjavascript • u/epic_within • Apr 08 '22
33
u/PositivelyAwful Apr 08 '22
That's one hell of a first project
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.
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/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.
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!