Documenting my backend journey
Added image upload to a signup flow today using Multer + Cloudinary. Files get validated (type + size) in memory, converted to a data URI, uploaded, then only the secure URL gets saved to MongoDB ... never the raw file.
#buildinpublic
Documenting my backend journey
Added image upload to a signup flow today using Multer + Cloudinary. Files get validated (type + size) in memory, converted to a data URI, uploaded, then only the secure URL gets saved to MongoDB ... never the raw file.
#buildinpublic
Documenting my backend journey
Learned Nodemailer today. Set up SMTP with Gmail app passwords, wrapped in an async sendMail function, and wired it into a signup route with error handling so failed emails don't crash the app.
Small win, but it clicks now
#devlife
Documenting my backend journey
Implemented OTP expiration today. Each OTP gets an expiry timestamp with Date and setMinutes, and verifyOTP checks it before accepting a code. Also clear otp fields once verification succeeds, so a used code can't be replayed.
#buildinpublic
@hormorshorlar Really good catch, thank you! You're right, I was hashing passwords but left the OTP in plain text, which is inconsistent. Going to apply the same bcrypt.hash() / https://t.co/xJbZZeI8zd() pattern I used for passwords to the OTP too. Appreciate you actually reviewing the logic.
Day 5 of documenting my backend journey 👨🏾💻
Added OTP verification today: random 6 digit code on register, verified before confirming the account.
Also caught a real bug. Missing return meant wrong OTPs still verified users. Fixed it.
#buildinpublic#BlackTechTwitter#coding
Day 4 of documenting my backend journey 👨🏾💻
Today was all about JWT authentication:
1. Understanding how tokens are issued and validated
2. Building middleware to verify them
3. Attaching req.user for seamless access to authenticated user data
#buildinpublic
Day 3 of documenting my backend journey
Built my own Register/Login system using bcrypt ... hashing passwords before they touch the database, comparing them safely on login.
Also debugged a MongoDB connection issue ... turned out to be my network, not my code.
#buildinpublic
Day 2 of documenting my backend journey 👨🏾💻
Full revision today .... backend fundamentals through middleware, tutor quizzing everyone along the way. Then intro to bcrypt and encryption: how passwords get hashed before hitting the database.
Code drops tomorrow.
#buildinpublic
Day 1 of documenting my backend journey 👨🏾💻
Building a Task API with Express + MongoDB. Today: proper error handling in every route with try/catch, so bad requests return clean responses instead of crashing.
Middleware deep-dive coming Monday 👀
#buildinpublic#CodeNewbie