Revising MERN for blockchain.

ASHDEEP SINGH - Sep 8 - - Dev Community

Hello World.

This week in my adventure of learning blockchain was spent on revising my MERN concepts. For this I prepared two mini projects, here are there descriptions.

*1) Bookfinder *
Github
Stack used : MERN

  • In this project, the main challange was integrating APIs. We take input from user using input bar and when user hits search we call API and get its response shown on frontend.
    my 2 cents :

  • Test an endpoint thoroughly before using it. Think of different cases and play around a little bit.

  • Make sure you maintain a log for input - output - expected output, and work where output - expected output differs.

  • check if response from API falls short of length. Always keep in mind never make assumptions about data API will return take necessary precautions beforehand.

2) ChatGPT clone
Github
stack used : MERN
In this project we did as the name suggested, made a clone of chatGPT. This clone is end to end encrypted and passwords are stored using hashing (now you can store your password as "I love Neha" and no one will know.).

my 2 cents :

  • hashing password is ok as most of the libraries out there (I used bcrypt) do provide compare method to check if hash and a text are equal or not, but remember we can not decrypt them anyway, thus make sure to hash passwords we use some different library (I used crypto here). This is because you mihgt feel need to decrypt messages at front end before showing them to user.
  • Store some important info in .env and dont forget to add .gitignore (also mention .env in it incase you missed the point of having .gitignore). This is because many bots online who scrap important info from .env and exploit it.
  • Choose schema wisely beforehand, by thinking of end product in mind and not do it one the fly (i.e, we'll see once we reach there, dont do this).
  • Use chatGPT judiciously but if you're in it for learning, I recommend not using it instead use google and stackoverflow at first.
  • If using chatGPT, go slow, make one thing at a time, test it, integrate it then move on. Dont confuse it (and yourself as well) by doing everything all at once.
  • Make a document of libraries you installed for making entire project (may divide them into frontend and backend).
  • Keep pushing code on github time to time.
  • If you encounter a problem, (like I did while updating state, it wont update no matter what) look online where such an occurance might have happened and dive deeper to know how they solved it.

Lastly, try asking online for help, take a break, and if you dont understand anything feel free to read and even ask chatGPT to make you go thru an iteration of code.

Incase you wanna connect with me here is my linkedIn profile

So that's all for this week folks.

Stay tuned for more........

. . . . . . . . . . . . .
Terabox Video Player