Open hughsoong opened 2 years ago
One more point, on the server side, i should have named api better. instead of localhost:3000/api/sharklLists, I can name the api localhost:3000/getSharkLists. The whole point here is to make more code more readable to other developers.
This one is very important, I should have use status-code for everything, like 200 for successful data fetch and different status code for error handling too.
This one might and might not relate to this project, but system should have nesting routes so others can understand it, fo example:- posts/comments or posts/likes instead of just like /comments or /likes that will create confusion for developers that this route is for what purpose which can be either post or user or anything.
Other thing we can do to scale is we can use versioning for api like facebook or spotify. https://api.spotify.com/v1/artist/songs
Then you should set up an auto-scaling because in large project, when someone makes an api call, the API won't make the request from the first machine available — you don't know which server will get the request, because requests are bounced to different servers.
Also finally, we can go through different level of testing such as load balancing, production testing and scale testing.
then also I would have refactor the routes code and write that function into different file.
in Frontend side, I would have add more css and make it look beautiful and as well as in code, there is a component called SingleImage, for that I should write different component for if i have imageSrc and if I dont have imgSrc then what would it be default. and store it into different component and then write the logic in singleImage component file to render it on conditional basis.
Hi Sahil,
Thank your for submitting your assignment! We had a few quick questions for you. Unfortunately you did not open a PR for us to comment on so I'll comment here instead.
Thanks Hugh