DEV Community

Cover image for Built a social media website with Next JS, TailwindCss and Firebase in 8 days
Naman vyas
Naman vyas

Posted on • Edited on

Built a social media website with Next JS, TailwindCss and Firebase in 8 days

Hello Everyone,

So around one month ago i created a simple social media site because i was bored and after publishing i got a good response by many peoples and 100+ users registered on website.

So i thought why don't update and make a proper website. Also it's a good project for my resume so 8 days ago i started creating this project called Noob and today I'm gonna make that project public so check it out and write your review :)

Website is still in development, Working on
+Comment System
+Follow System
+Notification's

Website Link : noob.study
Github Link : Github.com/NV404/noob

GitHub logo NV404 / noob

Simple Social-Media website build with Next Js, Tailwind css and Firebase

noob

How to get started?

You can refer to the following articles on basics of Git and Github and also contact the Project Mentors, in case you are stuck:

Running locally in development mode

To get started, just clone the repository and run npm install && npm run dev:

git clone https://github.com/NV404/noob.git
npm install
npm run dev

Note: If you are running on Windows run install --noptional flag (i.e. npm install --no-optional) which will skip installing fsevents.




Share Your Thoughts.
Feel free to contribute.
Star the Repo If you like

Top comments (7)

Collapse
 
eltel profile image
Terry Mitchell

HI! I'm working on something similar too - unfortunately, after signup we get an "Application error: a client-side exception has occurred (developer guidance)." error. Interested in contributing maybe. Let me know when you've fixed the problem/if you're interested.

Tks

Terry

Collapse
 
namanvyas profile image
Naman vyas

I'm solving this problem maybe it's a memory leak by react-hooks. Thank you for this information :)

Collapse
 
the_riz profile image
Rich Winter

Got the same error after signup

Collapse
 
gilbishkosma profile image
Gilbish

In the title of your post, use Built instead of Build.

Collapse
 
namanvyas profile image
Naman vyas

Fixed thank you :)

Collapse
 
rishab1207 profile image
Rishab Sharma

Can you tell me how have you implemented like feature? I know the firestore data modelling part but don't know an efficient way to update the UI.

Collapse
 
namanvyas profile image
Naman vyas • Edited

That's how I created like functionality :

  1. While creating post document create a subcollection for like.

  2. In like subcollection create a document called count or total anything you want with initial value of 0 we will use this document to store total likes count ( there are other ways but they will cost more read request when you call, not good for large collections)

  3. Now when we load post on frontend we read total or count document from like subcollection to get total like count.

  4. Now the thing is we have to check if current user is already liked the post or not so for that when someone like a post we create a document in like subcollection of post with there uid or username because both are unique.

  5. Now when a post load, we will check if there is any document available with current user username or uid if yes then I use react-hook(usestate) to change a variable(AlreadyLiked) value to true and with this true or false i use ternary operator to update UI and onclick function
    for example :
    // if alreadyliked is true change like button color to purple.
    {AlreadyLiked == true ? Color.purple : Color.white }
    // if alreadyliked is true call dislike function.
    {AlreadyLiked == true ? Dislike() : AddLIke() }

  6. and if variable value is false, when user click it will call a function that increment total count value with one create a document with users uid or username and change AlreadyLiked value to true.

Hope this information will help you :-)