Day 51 of My #100DaysFullstackCodeChallenge Today I built a dynamic product rendering system using pure Node.js — without any framework. Here’s what I worked on: • Creating an HTTP server • Parsing URLs and query parameters • Building a reusable HTML template replacement function • Rendering product listings dynamically from JSON data • Creating individual product detail pages using ?id= • Handling routing manually • Debugging the “write after end” response error • Improving data lookup logic for safer product retrieval One key lesson: You can only call response.end() once. Understanding the response lifecycle changed how I structure my routes. Building without Express is helping me truly understand what frameworks abstract away. Backend logic is becoming clearer every day. #100DaysOfCode #NodeJS #WebDevelopment #BackendDeveloper #LearningInPublic
Node.js Dynamic Rendering Challenge: Day 51
More Relevant Posts
-
One mistake I see in many React codebases: God components. One component that: • fetches data • manages state • handles business logic • renders UI And suddenly the file becomes 500+ lines. This is how technical debt starts. Better approach: Split responsibilities. Example: • Data layer → hooks or server actions • Business logic → services • UI → small reusable components Another common mistake is abusing useEffect() for logic that should live elsewhere. React becomes much simpler when you think in data flow + small components. Clean architecture beats clever code. What’s the biggest React mistake you’ve seen in production code? #ReactJS #FrontendDevelopment #SoftwareEngineering
To view or add a comment, sign in
-
-
Casting `response.json()` as your hand-written TypeScript interface feels safe—until the backend changes and runtime errors prove it was a lie. There's a better way: generate your types directly from your OpenAPI spec so the compiler catches breaking changes before your users do. This guide walks through two practical approaches, from lightweight fetch wrappers to fully generated query hooks.
To view or add a comment, sign in
-
𝐂𝐋𝐈 𝐓𝐚𝐬𝐤 𝐌𝐚𝐧𝐚𝐠𝐞𝐫 𝐏𝐫𝐨𝐣𝐞𝐜𝐭 𝑻𝒉𝒆 "𝑵𝒐 𝑭𝒓𝒂𝒎𝒆𝒘𝒐𝒓𝒌𝒔, 𝑵𝒐 𝑬𝒙𝒄𝒖𝒔𝒆𝒔" I just built a project with: No Express No React No database No external libraries at all Just pure Node.js. A file. And a terminal. It's a CLI task manager — you run commands like this: 𝘯𝘰𝘥𝘦 𝘵𝘢𝘴𝘬.𝘫𝘴 𝘢𝘥𝘥 "𝘉𝘶𝘺 𝘨𝘳𝘰𝘤𝘦𝘳𝘪𝘦𝘴" 𝘯𝘰𝘥𝘦 𝘵𝘢𝘴𝘬.𝘫𝘴 𝘮𝘢𝘳𝘬-𝘥𝘰𝘯𝘦 1 𝘯𝘰𝘥𝘦 𝘵𝘢𝘴𝘬.𝘫𝘴 𝘭𝘪𝘴𝘵 𝘪𝘯-𝘱𝘳𝘰𝘨𝘳𝘦𝘴𝘴 And it tracks your tasks in a JSON file on your machine. Sounds simple. But building it taught me things that four days of Express and React didn't: How Node.js reads and writes files directly How CLI tools actually work under the hood How to handle user input from the terminal How to persist data without any database at all Frameworks are great. But knowing what they're abstracting away from you is better. Build without them once. You'll never take them for granted again. #learningtocode #frontenddeveloper #backenddeveloper
To view or add a comment, sign in
-
-
A small mistake that broke the entire flow today we run into something interesting while building a product management system with image uploads. everything looked fine. frontend was ready. backend routes were working. cloudinary config was correct. but every time we tried to create a product — 500 Internal Server Error. at first, it felt like one of those random bugs that waste hours. after digging deeper, we found the real issue. we had accidentally used Multer logic inside the React frontend. and that’s where things went wrong. multer is backend middleware. it belongs in the Node.js server. not in the browser. because of that small architectural mistake, the upload request was malformed, cloudinary failed, and the server crashed. the fix was not complicated - it was about putting responsibility in the right place. Frontend → Send files using FormData Backend → Process files with middleware Cloudinary → Handle storage Once we cleaned that boundary, everything worked perfectly. Sometimes debugging reminds you that good systems aren’t about writing more code. They’re about respecting structure. #FullStackDevelopment #StartupBuilding #Debugging #ReactJS #NodeJS #ProductEngineering #helpinfinite
To view or add a comment, sign in
-
⚠️ This “clean” React code is a silent production bug. {data.length > 0 && data.map(...)} Looks fine in dev. Breaks in production. 💥 Here’s what actually goes wrong: ❌ data = undefined → crash ❌ data.length = 0 → renders “0” on UI 😳 ❌ No safety checks → unpredictable bugs 👉 What you should update: ✅ Replace short-circuit (&&) with ternary ✅ Add optional chaining → data?.map(...) ✅ Validate data → Array.isArray(data) ✅ Always add fallback UI ✅ Use proper keys (not index) 💡 Real example: Your API is slow → data is undefined → user sees a broken screen. 👉 Lesson: Clean code is not enough. Production-safe code is what matters. 💻 Check Image to understand much better and follow for more tips and learning 👨💻✍️ #ReactJS #Frontend #SoftwareEngineering #JavaScript #DevTips #Learning
To view or add a comment, sign in
-
-
#MERNStackLearning – #Day60 at Skill Shikshya Today I focused on practicing Express routing and understanding how to work with user data stored in a JSON file. I worked on creating routes to display all users and also implemented dynamic routing to fetch a specific user using their ID. I learned how route parameters work (req.params) . I also understood how middleware flow affects route execution and fixed an issue where my routes were not working because of incorrect middleware usage. Today’s practice included: ✔ Creating Express Router ✔ Reading JSON data using fs module ✔ Implementing dynamic routes (/users/:id) ✔ Finding specific user data using array methods ✔ Handling cases when user is not found Small improvements like these are helping me understand how backend APIs actually work step by step. Continuing to build consistency and strengthen my backend fundamentals. #MERNStack #NodeJS #ExpressJS #BackendDevelopment #LearningJourney #JavaScript #WebDevelopment #DeveloperJourney
To view or add a comment, sign in
-
🚀 I scaled a client-side React app to handle 150k+ lines of JSON Most JSON tools start lagging somewhere around 20k-50k lines. But while building Dev Suite, I wanted it to handle even large JSONs And that came with some interesting challenges: 👉 Rendering 5000+ search results without freezing the UI 👉 Preventing React re-renders from killing performance 👉 Comparing deeply nested JSONs semantically (not just text diff) 👉 Navigating differences efficiently in 100k+ lines I wrote a detailed breakdown of: ✔ How I optimized search & diff algorithms ✔ Why virtualization was critical ✔ How I decoupled the editor from React ✔ And where DSA (yes, binary search 😄) actually helped Full deep dive here: https://lnkd.in/gGYmSWU3 #FrontendDevelopment #WebPerformance #ReactJS #SoftwareEngineering #DevTools #FrontendPerformance
To view or add a comment, sign in
-
⚠️ A Common React Mistake That Slowly Breaks Applications One thing I keep noticing in many React codebases: Everything becomes global state. At first it feels convenient. Need the data somewhere? Just put it in global state. But over time this starts causing problems: • Components re-render more than necessary • Debugging becomes harder • State dependencies become unclear • Performance slowly degrades Not every piece of data needs to live globally. Sometimes the best architecture is simply: ✅ Local state where possible ✅ Lift state only when necessary ✅ Global state only for truly shared data Frontend architecture isn’t about adding tools. It’s about using the right level of complexity for the problem. Sometimes the best optimization is simply keeping state closer to where it belongs. Curious how others approach this — How do you decide what belongs in global state vs local state? #ReactJS #FrontendDevelopment #JavaScript #SoftwareEngineering #WebDevelopment
To view or add a comment, sign in
-
I got tired of debugging API issues with console.log(). After one too many late nights staring at: POST /api/orders 500 8ms ...with zero context about what was in the request body, what the response said, or which user triggered it — I built something better. Introducing reqlog — a live HTTP request dashboard for NestJS, Express and Fastify. Drop it in as middleware and a dashboard opens at localhost:9000 showing every request in real time: → Full request + response body → Payload diff between requests → One-click request replay → Slow request highlighting → Zero config, zero persistence NestJS setup is literally 3 lines: import { ReqlogModule } from 'reqlog-nestjs' @Module({ imports: [ReqlogModule.forRoot()] }) // dashboard opens automatically I use this daily at Softylines across 45+ microservices. It replaced a debugging workflow that was costing my team hours every week. MIT licensed. Open source. Free forever. GitHub → https://lnkd.in/dzXM6BrK If you've ever added a console.log at 11pm in frustration — this one's for you. ⭐ #nodejs #nestjs #opensource #javascript #devtools #webdev
To view or add a comment, sign in
-
-
🚀 STOP! Are Your 'Await' Calls Slowing Down Your API? 🐢 ❌ The Past (2020 Pattern): - Sequentially Waiting: You await db.getPosts (2s), then you await db.getProfile (1s). - Total Time: 2s + 1s = 3 seconds. Your user is waiting! 🚫 ✅ The Future (2026 Update, Node v20+): - Parallel Power: Use Promise.all to fetch both posts and profile simultaneously. - Total Time: Only 2 seconds (the time of the slowest call). Your user gets data instantly! ⚡ 🧠 Why this works? (The Psychology of Clean Code): - The F.O.M.O. Hook: Realizing you might be using outdated patterns instantly grabs attention. - Visual Clarity: The clear contrast between slow (3s) and fast (2s) makes the solution undeniable. - Expert Validation: Linking to Node v20+ builds trust and encourages following industry standards. - Reciprocity: Providing immediate, actionable value makes people want to save and share. 👍 Like if you're upgrading your patterns! 💾 Save for later to optimize your next API endpoint. 👇 #NodeJS #JavaScript #API #Performance #CleanCode #ProgrammingTips #PsychologyOfCode #WebDevelopment
To view or add a comment, sign in
-
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development