Since I kept forgetting the steps to set up an Express.js project with TypeScript, I built a script to automate the entire process. Here are some of the things you can automate with Bash script: - Syncing your local branch to remote branch on Git. - Building and running automation. - Deployment scripts. - File management such as finding logs, renaming files, and backup folders. - Database Tasks such as running migration, backing up databases, and seeding data. - API and cron jobs. Small tools like this can save time, reduce mistakes, and can help you focus to bigger things. You can check the script here: https://lnkd.in/g2neMj6q #BashScript #ExpressJS #NodeJS #TypeScript #JavaScript #Automation #DevTools #BackendDevelopment
Automate Express.js with TypeScript Setup Script
More Relevant Posts
-
🚀 Day 8 of Backend | Exploring APIs with Postman Today’s learning was more practical and gave me clarity on how APIs actually work 💻🌐 🔹 What I learned: • Postman 👉 Used to test APIs without needing a frontend 👉 Helps in sending requests and analyzing responses • JSON vs JavaScript 🧠 👉 JSON is a data format (string format) 👉 JavaScript objects are actual in-memory objects • Parser (Middleware) 👉 Used to convert incoming JSON data into JavaScript objects 👉 Example: "express.json()" 🔹 Important Insight ⚡ • We can technically use any HTTP method for any purpose 👉 But we should follow standard conventions (GET, POST, PUT, PATCH, DELETE) 👉 This improves clarity, security, and API design • Learned about "app.use()" 👉 It is used to apply middleware globally (not a replacement for HTTP methods, but works for handling requests in a generic way) 💡 Today’s learning made me realize how important clean API design and proper conventions are in backend development 🙌 Special thanks to Rohit Negi bhaiya for such practical and easy explanations Day 8 done ✅ Understanding is getting deeper day by day 🔥 👉 Do you follow HTTP conventions strictly while building APIs? 😄 #BackendDevelopment #NodeJS #ExpressJS #APIs #Postman #JavaScript #LearningInPublic #30DaysOfCode #TechJourney
To view or add a comment, sign in
-
#Day24 JavaScript is starting to feel less like writing code… and more like preparing code for the real world. Today I learned about environment variables and why not everything belongs inside your code. Three things for today: => Security Sensitive data (API keys, database URLs) stays out of your codebase. => Flexibility The same code can run in different environments without changes. => Clean structure Your code focuses on logic, not configuration. I stopped asking, where do I store this value? and started asking, should this value even be inside my code? Because writing code is one thing, but preparing it for real-world use is another. Same language. More responsibility. #JavaScript #NodeJS #BackendDevelopment #WebDevelopment #LearningToCode #M4ACELearningChallenge
To view or add a comment, sign in
-
-
Ever forget to close database connections or release file handles? 🤔 TypeScript 5.2's `using` declarations solve this with automatic resource cleanup at scope exit. The problem: Manual cleanup with try/finally blocks is error-prone and verbose. The solution: `using` declarations automatically call `Symbol.dispose()` when variables go out of scope. Key benefits: → Eliminates try/finally boilerplate → Guaranteed cleanup even with exceptions → Works with both sync and async resources → Type-safe with `Disposable` interface Perfect for database connections, file handles, network sockets, or any resource needing cleanup. What's the most resource-intensive operation in your codebase that could benefit from automatic cleanup? #TypeScript #JavaScript #CleanCode #ResourceManagement #WebDevelopment
To view or add a comment, sign in
-
-
I used to think validation in 3 places is overkill… 🤔 TypeScript + Zod + Database? Why so many layers? Then reality hit 👇 User sent: "notanemail" TypeScript: “string 👍” Zod: “invalid email ❌” DB: “duplicate not allowed ❌” 💡 Lesson learned: Each layer has a different job 🔹 TypeScript → helps developer 🔹 Zod → validates input 🔹 Database → protects data 👉 It’s not redundancy 👉 It’s defense in depth 🛡️ One fails, others catch it. #typescript #javascript #backend #webdevelopment #developers
To view or add a comment, sign in
-
As a Developer you should know these: • 🔐 .env → Secret keys & env variables. NEVER push to GitHub • 🙈 .gitignore → Files Git should ignore • 🔒 package-lock.json → Locks dependency versions across all machines • 🟢 .nvmrc → Pins the Node.js version for your whole team • 📐 .editorconfig → Consistent formatting across all editors • 🔴 .eslintrc → Linting rules to keep JS/TS clean • ✨ .prettierrc → Auto code formatting • 🎨 tailwind.config.js → Custom colors, spacing & themes • 🔵 tsconfig.json → Controls TypeScript compilation • 🔄 .babelrc → Babel config for backward JS compatibility • 🐶 .huskyrc → Git hooks to catch bugs before pushing • 🐳 .dockerignore → Keeps Docker builds clean & lean • ⚡ vite.config.js → Vite dev server & build config • ▲ next.config.js → SSR, redirects & Next.js behavior • 🚫 .prettierignore → Files Prettier should skip
To view or add a comment, sign in
-
We almost shipped a bug that would have taken down a critical data pipeline. The function accepted a string. The caller was passing a number. JavaScript did not care. TypeScript with strict mode did. That single catch saved us hours of debugging and a bad deploy. Here is what TypeScript strict mode actually enables. strictNullChecks forces you to handle the cases where a value might be null or undefined. Most runtime errors come from these exact cases. The compiler makes them impossible to ignore. noImplicitAny means no more hiding behind untyped function parameters. Every variable has to declare what it is. strictFunctionTypes catches the places where your callback signatures do not actually match what you think they match. These are subtle bugs. exactOptionalPropertyTypes means optional and potentially undefined are treated differently. That distinction matters more than you think. I have watched teams turn this on in a mature codebase and find 30 to 40 real bugs in a day. Not theoretical issues. Actual problems that would have caused production failures. If you are not running TypeScript strict mode, you are shipping bugs you have not found yet. What is the best bug TypeScript has ever caught for you? #TypeScript #FrontendDevelopment #WebDevelopment #SoftwareEngineering
To view or add a comment, sign in
-
-
We almost shipped a bug that would have taken down a critical data pipeline. The function accepted a string. The caller was passing a number. JavaScript did not care. TypeScript with strict mode did. That single catch saved us hours of debugging and a bad deploy. Here is what TypeScript strict mode actually enables. strictNullChecks forces you to handle the cases where a value might be null or undefined. Most runtime errors come from these exact cases. The compiler makes them impossible to ignore. noImplicitAny means no more hiding behind untyped function parameters. Every variable has to declare what it is. strictFunctionTypes catches the places where your callback signatures do not actually match what you think they match. These are subtle bugs. exactOptionalPropertyTypes means optional and potentially undefined are treated differently. That distinction matters more than you think. I have watched teams turn this on in a mature codebase and find 30 to 40 real bugs in a day. Not theoretical issues. Actual problems that would have caused production failures. If you are not running TypeScript strict mode, you are shipping bugs you have not found yet. What is the best bug TypeScript has ever caught for you? #TypeScript #FrontendDevelopment #WebDevelopment #SoftwareEngineering
To view or add a comment, sign in
-
-
Node.js Event Loop — One Concept Every Developer Should Know 🧠 Many developers get confused about this: Why does Promise run before setTimeout? Example 👇 console.log("Start"); setTimeout(() => console.log("Timeout"), 0); Promise.resolve().then(() => console.log("Promise")); console.log("End"); Output: Start → End → Promise → Timeout Why? Because JavaScript has 2 queues: ✔ Microtask Queue (Promises, async/await) ✔ Macrotask Queue (setTimeout, setInterval) Rule: 👉 Microtasks run before Macrotasks This is why Promise executes before setTimeout, even if timeout is 0ms. Understanding this helps in: ✔ Debugging async issues ✔ Writing better Node.js code ✔ Handling real-time applications 👇 Did this confuse you before learning event loop? #nodejs #javascript #eventloop #backenddeveloper #webdevelopment
To view or add a comment, sign in
-
Why can't config files have comments? If you've ever pasted a JSON config and immediately wished you could explain what a block of settings actually does — JSON5 is worth knowing about. JSON5 is a superset of JSON that adds a few things that make configuration files much more pleasant to work with: 💬 Comments — both inline and block ✅ Trailing commas — no more hunting down which line is missing one 🔓 Unquoted property names — copy directly from TypeScript/JavaScript without reformatting 📝 Multi-line strings Valid JSON is always valid JSON5, so there's no migration pain. It works across the stack too — npm package for JS/TS, json5k library for Kotlin, and IntelliJ supports it out of the box. I wrote up a quick intro with examples — including a real-world Renovate config — here 👇 https://lnkd.in/grFnkvRd #JSON5 #WebDev #JavaScript #TypeScript #Kotlin #DevTools #SoftwareDevelopment
To view or add a comment, sign in
-
Here’s a clean breakdown of how a request travels through a NestJS application: 👉 1. Middleware Handles logging, request parsing, and pre-processing before anything else. 👉 2. Guards Acts as a gatekeeper 🔐 — checks authentication & authorization (e.g., JWT validation). 👉 3. Pipes Validates and transforms incoming data (e.g., DTO validation, type conversion). 👉 4. Controller Receives the request and decides which logic to execute. 👉 5. Service (Business Logic) This is where the real work happens — database queries, API calls, etc. 👉 6. Interceptors Wrap around the response — useful for logging, formatting responses, or caching. 👉 7. Exception Filters Catch and handle errors globally to ensure clean and consistent API responses. ✅ Flow Summary: Middleware → Guards → Pipes → Controller → Service → Interceptors → Exception Filters → Response 💡 Why this matters? This layered architecture makes applications: ✔ Scalable ✔ Maintainable ✔ Testable #NestJS #NodeJS #BackendDevelopment #SoftwareEngineering #WebDevelopment #API #FullStackDeveloper #TechInterview #Coding #JavaScript #TypeScript #SystemDesign #Developers #Programming
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