87
u/T4pZ Jun 22 '20
You should remove the .env from your backend repo and put it in the .gitignore
14
Jun 22 '20
thanks man
0
12
47
u/trent1024 Jun 22 '20
Even if you do that you can still find the file in your Git history. He needs to remove the file from Git completely.
0
Jun 22 '20
[deleted]
16
u/gunnnnii Jun 22 '20
I usually push a .env_example, rather than just .env, in that case, since I don't want to put anyone else at risk of pushing their file.
1
1
Jun 23 '20
[removed] β view removed comment
4
u/T4pZ Jun 23 '20
You have configurations for local dev and production. Not everyone needs to know the production secrets.
The secrets of your app, like production DB password or connection, should be in environment variables on the machine that runs your app.
He is hosting on Heroku so you can use Heroku config vars
Docker compose has env File support.
If you have lots of secrets that you share between apps look at https://www.vaultproject.io/ or Spring config server.
7
Jun 22 '20
on fronted side there are a lot of repeated DRY code in api.js, i suggest, use axios interceptors to handle token, and to use react-query,
I liked it is simple but nice
4
Jun 22 '20
I also felt it could be improved when writing those, will definitely look into interceptors for handling tokens, thanks.
4
u/Irantwomiles Jun 22 '20
What was your experience using the Context Hook as apposed to Redux?
7
Jun 22 '20
I don't have much experience using redux apart from reading the docs and building a toy project. But I love using context api as it is simple and easy to reason about.
2
u/Irantwomiles Jun 22 '20
I've been using context api recently and its very straight forward, but its giving me this feeling that maybe its too easy to use and its giving me this weird (good weird) feeling. Are there any issues that you came across while using it?
3
2
u/mips-404-andi Jun 22 '20
How did you get the assets so perfect?
Like the send icon and igtv icon.
7
Jun 22 '20
instagram -> developer tools -> copy element svg
1
u/mips-404-andi Jun 22 '20
Ah, but is there any way to do it legally? I thought insta didn't like you just copy pasting? I mean not like anyone is gonna know what you did here.
We were doing a project at work where we wanted to use the official insta play and video logos but since we are making money we can't exactly copy paste it.
1
Jun 22 '20
good to know about this. For some of my other projects, I used this site for svgs https://iconmonstr.com/
β’
u/swyx Jun 22 '20
nice work! similar project posted 3 days ago https://www.reddit.com/r/reactjs/comments/hbryhy/i_made_an_instagram_clone/
would be cool if someone wanted to go thru and compare and contrast approaches! differential analysis is where we really level up.
6
5
1
u/Daebak404 Jun 22 '20
Woah! Looks great! How long did it take for you to complete the entire project?
4
Jun 22 '20
It took me about a week. I already built a similar clone using prisma and graphql, so that experience accelerated building the backend part.
3
u/JudoboyWalex Jun 22 '20
Built this in a week? Part time? That's impressive! How long you been coding?
7
Jun 22 '20
As I mentioned in the comment, I built another clone (twitter) with the same functionality which helped me to build the backend a lot quicker. I have been learning coding for 12-14 months I would say.
2
u/hungtro96 Jun 22 '20
Looks neat, I suggest you can create one wrapper function for API call as it was lots of duplicate logic in there. You can check this blog post for more information: https://kentcdodds.com/blog/replace-axios-with-a-simple-custom-fetch-wrapper
Anyways, nice work, keep it up!
1
1
Jun 24 '20
Hey, I just want to thank you for recommeding that article, now I completely replaced axios with fetch and the api calls now looks much better. Thanks, once again.
1
u/digitalbiz Jun 22 '20
Mind sharing a GitHub repo?
3
Jun 22 '20
Github Repos:
Frontend π https://github.com/manikandanraji/instaclone-frontend
Backend π https://github.com/manikandanraji/instaclone-backend
1
u/dohaboha Jun 22 '20
woah!!! How long how did it take for you to reach at this level!!?
2
Jun 22 '20
I have been learning web dev and programming for 12-14 months. I took courses, watched youtube vids and built toy projects along the way
2
u/dohaboha Jun 22 '20
Part time or full time???! Just curious. I have been studying everyday in and off after work for about 2 years and still dream of reaching your level man!! Did you try any luck with jobs??'
1
u/Fire_Lord_Zukko Jun 23 '20
I saw someone else asked, but I'm very curious, any luck yet with getting a job?
1
Jun 23 '20
I am doing my bachelors right now (final sem examinations are postponed). after that, I will start applying for jobs.
1
1
u/kex_ari Jun 23 '20
Iβm curious about your image hosting. What happens if someone uploads illegal content? Are you liable?
1
Jun 23 '20
not sure what will happen, already lots of disturbing images people have been posted, I am manually deleting it
1
u/KremBanan Aug 01 '20
Hey man cool stuff, what tutorials did you use? Especially for the folder structure on client and backend? I've seen many people do it like this, any good tutorials or repos you watched?
1
Aug 01 '20 edited Aug 01 '20
frontend: I think in redux documentation they uses this style, I picked it when I was watching a youtube video about redux
backend: for the backend I used brad traversy udemy course where he builds an api using this structure
3
u/sadsloth97 Jun 23 '20
Looks awesome! Not sure if NoSQL would be my top choice for a social network - itβs all relational data!
2
u/abhishekkhaiwale Jun 23 '20
nice work , even i have just started with the learning process and this clone is motivating me even more to dive deep into react.
1
u/ShovonX Jun 22 '20
The post modal has issues. If you upload an image that is a bit long the caption input gets hidden below, and it's not scrollable either.
Happens to portrait, don't give the height to 100%.
2
1
1
1
1
1
1
1
0
u/delta_charlie_2511 Jun 23 '20
https://react12.io/instagram-clone
For anyone interested in following this tutorial
0
Jun 22 '20
[deleted]
4
Jun 22 '20
It took me about a week. I already built a similar clone using prisma and graphql, so that experience accelerated building the backend part.
2
0
7
Jun 22 '20
[removed] β view removed comment
5
1
u/justSomeGuy5965 Jun 23 '20
Ok now you've got me curious. What is whiplash?
4
Jun 23 '20
It's an amazing movie, here's the summary 'A promising young drummer enrolls at a cut-throat music conservatory where his dreams of greatness are mentored by an instructor who will stop at nothing to realize a student's potential.'
You should watch it https://www.imdb.com/title/tt2582802/
2
48
u/[deleted] Jun 22 '20 edited Jun 23 '20
Hi guys, I made this instagram clone using MERN stack.
The frontend is built with React and React router and the backend is built using Express and Mongoose.
For styling I am using styled components and the toast notification is handled by react-toastify.
I am using react Context API for global state.
check it out π https://instaclone2.netlify.app
Github Repos:
Frontend π https://github.com/manikandanraji/instaclone-frontend
Backend π https://github.com/manikandanraji/instaclone-backend