If you are building an open-source tool and importing `express` or `next/server` into your core logic, you are building a trap. When you tightly couple your logic to an HTTP framework, you alienate 80% of the ecosystem. A Next.js dev can't use your Express tool. A Hono dev can't use your Fastify plugin. You need to build compilers, not switchboards. I use the 𝗘𝗻𝗴𝗶𝗻𝗲-𝗔𝗱𝗮𝗽𝘁𝗲𝗿 𝗣𝗮𝘁𝘁𝗲𝗿𝗻: 1. 𝗧𝗵𝗲 𝗘𝗻𝗴𝗶𝗻𝗲: Pure TypeScript. Zero HTTP context. It takes raw inputs and returns standard outputs. 2. 𝗧𝗵𝗲 𝗔𝗱𝗮𝗽𝘁𝗲𝗿𝘀: Tiny 20-line wrappers that translate a framework's request into your engine's context. This is exactly how I built TableCraft to seamlessly support Hono, Express, Next.js, and Elysia from a single codebase. Stop writing one-off endpoints. Start building generic compilers. I wrote a technical deep dive on how to structure this in a monorepo. Link below 👇 https://lnkd.in/gr9hBJnd #SoftwareArchitecture #TypeScript #OpenSource #WebDev #BackendEngineering
Decouple Logic from HTTP Frameworks with TypeScript
More Relevant Posts
-
📌 Pyramid of Doom (Callback Hell) A situation where multiple asynchronous callbacks are nested inside each other, creating a pyramid-like structure. ❌ Hard to read and understand ❌ Difficult to debug ❌ Poor error handling ❌ Not scalable as the project grows ✅ Use **Promises** to flatten the structure ✅ Prefer **Async/Await** for cleaner, readable code ✅ Handle errors properly with try/catch Clean code isn’t optional — it’s what makes your backend scalable. 🚀 🔖 Save this for later #javascript #developer #architect #nodejs #mern #mmdanish
To view or add a comment, sign in
-
Stop the console.log madness. 🛑 We’ve all been there: chasing a bug for hours, littering the code with console.log('here'), and accidentally pushing those logs to production. 🤦♂️ After 2 years of Full Stack development, I finally found a better way. The Fix: VS Code JavaScript Debug Terminal 🛠️ Instead of a standard terminal: Open the Terminal dropdown. Select "JavaScript Debug Terminal." Run your service normally (npm start). Why it’s a game changer: Breakpoints: Pause code execution instantly. Live Inspection: Hover over variables to see real-time data. Cleaner Code: Zero logs to delete before you push. Simple, clean, and much faster. Your production logs will thank you. #Javascript #NodeJS #VSCode #WebDev #CodingTips #FullStack
To view or add a comment, sign in
-
-
I fixed a like button bug today that looked simple… but wasn’t. Clicks were working… But likes were not updating correctly. The issue? State was not syncing with the backend response. Once I fixed the state update logic, everything worked perfectly. Lesson: • Always sync frontend state with backend data • Don’t rely only on UI changes Small feature. Real learning. What bug did you fix recently? #FullStackDeveloper #WebDevelopment #JavaScript #Debugging #ProblemSolving
To view or add a comment, sign in
-
2 posts ago: a 9,200-line React codebase from 2019. Today: migration done. The numbers: 📊 Codebase - 77 files → 142 focused modules - 0% → 100% TypeScript strict - 11 runtime deps → 3 🛡️ Removed entirely - jQuery - moment.js - axios 0.19 (known CVEs) - Redux + react-redux + redux-thunk - create-react-app 3.4 (abandoned) - Console.log interceptors leaking tokens ⚡ Tooling - HMR: ~8s → <1s (CRA → Vite 8) - react-router v5 → v7 - tsc --strict: 0 errors - ESLint flat config: 0 warnings 🕐 Time - Manual rewrite: weeks, team - My pipeline: days, solo Note: LOC actually *went up* (9.2k → 12.4k). That's what a real migration looks like — types, split files, typed API layer. The win isn't shrinkage. It's 8 dependencies gone, zero CVEs, every file type-checked. Full case study: https://lnkd.in/gsw29EEd --- Here's the thing nobody talks about: Most companies don't rewrite legacy code because it's too expensive and too risky. So they keep patching. Adding duct tape on top of duct tape. Until one day the entire thing breaks and they're stuck. What if the rewrite took days instead of months? What if it cost a fraction of what agencies charge? What if the risk was near zero because the business logic is preserved automatically? That's what I built. If your startup or agency is sitting on a codebase that slows down every sprint — DM me. I'll show you what the modernized version looks like before you commit to anything. --- #react #typescript #vite #javascript #ai #webdevelopment #legacycode #codemodernization #softwaredevelopment
To view or add a comment, sign in
-
-
Ever wondered how Node.js handles multiple tasks while being single-threaded? 🚀 It all comes down to the powerful synergy between the V8 Engine and Libuv. Here’s a simple breakdown of what’s happening under the hood: ⚙️ V8 JavaScript Engine This is where your synchronous code runs. It manages the Call Stack and Memory Heap. For example, when you call a function like multiplyFn(a, b), V8 executes it instantly. 🌐 Libuv & System APIs When Node.js encounters an asynchronous task—like a network request, timer, or file operation—it doesn’t block execution. Instead, it delegates the work to Libuv, which communicates with the OS. ⏳ Non-Blocking I/O in Action While the system is handling tasks like reading a file or fetching API data, the main thread remains free to continue executing other code. 🚀 The Result? Highly efficient, scalable applications that never “freeze” while waiting for operations to complete. That’s the real beauty of Node.js — not just JavaScript, but smart task delegation at scale. 🙏 Credit: Akshay Saini 🚀 #NodeJS #BackendDevelopment #WebDevelopment #JavaScript #SystemDesign #V8Engine #Libuv #NamasteDev
To view or add a comment, sign in
-
-
Day 4 of 30 Days of TypeScript 🚀 Today’s topic: any vs unknown A lot of developers use any thinking it gives flexibility… But in reality, it removes the biggest advantage of TypeScript — type safety. Here’s the truth: 🔴 any Disables type checking Allows anything (even wrong code) Can lead to runtime bugs 🟢 unknown Forces you to validate data Keeps your code safe Encourages better patterns Example 👇 let data: unknown = "hello"; if (typeof data === "string") { console.log(data.toUpperCase()); // ✅ safe } 👉 Rule of thumb: If you don’t know the type yet, use unknown — not any. Because good developers don’t just make code work… They make it reliable. #TypeScript #WebDevelopment #JavaScript #Frontend #CleanCode #100DaysOfCode
To view or add a comment, sign in
-
-
🚀 Back in the Flow: Mastering Performance in React After a brief break, I’m back to what I love—building and solving logic. Today, I focused on optimizing search functionality using Debouncing in React. When building a search bar, hitting an API on every single keystroke is expensive and inefficient. To solve this, I implemented a custom debouncing logic inside a useEffect hook. 💡 Key Highlights of this Implementation: Controlled Input: Using useState to manage the search query. Debounce Logic: I used setTimeout to delay the API call by 700ms. This ensures the request only fires after the user has stopped typing. Memory Management: A crucial cleanup function (clearTimeout) to prevent memory leaks and race conditions if the user continues typing. Async/Await: Handling API fetching cleanly within the hook. Building these kinds of "logic-heavy" small components is what sharpens the mind for large-scale applications. It's not just about making it work; it's about making it efficient. GitHub repo : https://lnkd.in/dBw2y6m4 Consistency is the only currency in tech. Onwards and upwards! 📈 #ReactJS #WebDevelopment #MERNStack #FrontendEngineering #CodingJourney #JavaScript #Debouncing #CleanCode
To view or add a comment, sign in
-
-
Spent hours debugging a “simple” login issue today… turned out it wasn’t simple at all.. Everything looked fine: ✔ Backend deployed ✔ Frontend deployed ✔ Auth working But admin dashboard? Completely broken. The bug? Frontend was calling: /api/users Backend only had: /api/admin/users That’s it. One mismatch → whole feature dead. But wait… it got worse 👇 • Wrong env variable (VITE_API_URL instead of VITE_BACKEND_URL) • Old API domain still cached in production bundle • Missing route mount (/api/auth not connected in Express) So even after fixing one issue… another one popped up. Final fix: ✔ Correct API base URL ✔ Align frontend + backend routes ✔ Mount missing routes ✔ Rebuild + hard refresh Lesson learned: 👉 Bugs in production are rarely “big”..they’re tiny mismatches stacked together. This is what real full-stack debugging looks like. Live: https://www.anikdesign.in/ #webdevelopment #debugging #fullstack #nodejs #react #javascript #backend
To view or add a comment, sign in
-
-
Our team analyzed 70 full-stack applications using TypeScript and tRPC, and the results were eye-opening. We found an average 25% reduction in bugs related to API mismatches. End-to-end type safety is not just a buzzword—it's a real game changer. Have you ever considered the impact of strong typing on your full-stack development process? At first, I was skeptical about the learning curve that adding tRPC would introduce. But integrating these robust types into both the backend and frontend created a synchronized development flow I hadn't experienced before. Imagine defining your API in one single place, and knowing that any changes are instantly reflected wherever it's used—no more chasing down those pesky runtime errors. This became our team's standard with TypeScript and tRPC. When changes happen, the confidence in our code remains unshaken. Here's a quick TypeScript snippet showcasing how effortlessly you can define a tRPC procedure: ```typescript import { initTRPC } from '@trpc/server'; const t = initTRPC.create(); const appRouter = t.router({ getUser: t.procedure .input(z.string()) .query(async ({ input }) => { return await getUserFromDatabase(input); // Assume this fetches a user by ID }), }); ``` This snippet highlights how simple it is to create a type-safe procedure, ensuring the input and output are consistent across the board. So, have you tried tRPC or similar libraries? How do you ensure end-to-end type safety in your projects? #WebDevelopment #TypeScript #Frontend #JavaScript
To view or add a comment, sign in
More from this author
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