Next.js starter your AI actually understands. Ship internal tools in days not weeks. Pre-order $199 $499 → [Get it now]

How to build a weather API in Node.js

Building a weather API proxy in Node.js serves two purposes: it hides your API keys from the client and adds caching to avoid hitting rate limits on the third-party weather service. As the creator of CoreUI with 25 years of backend development experience, I always proxy third-party API calls through a Node.js layer in production to maintain control over rate limiting, caching, and error handling. The key pattern is fetching from OpenWeatherMap on the server, caching responses in memory with a TTL, and returning clean, typed responses to your frontend. This also lets you normalize the response format independently of what the weather API returns.

Read More…

How to build a notes API in Node.js

A notes API extends the basic CRUD pattern with user ownership — each note belongs to a specific user and only that user can read, update, or delete it. As the creator of CoreUI with 25 years of backend development experience, I use this pattern as the template for any user-scoped resource API in Node.js. The key difference from a public API is that every query includes a userId filter from the JWT payload, ensuring users can never access each other’s data. This requires authentication middleware and a data model that links notes to users.

Read More…

How to build a todo API in Node.js

Building a todo API is the ideal first Node.js project because it covers every fundamental backend concept: creating, reading, updating, and deleting resources with a clean REST interface. As the creator of CoreUI with 25 years of backend development experience, I use this exact project structure as the starting point for more complex Node.js APIs. The key is using Prisma as the ORM for type-safe database access and adding input validation with Zod before any data touches the database. This combination gives you reliable data integrity and TypeScript-compatible queries from day one.

Read More…

How to build a dashboard backend in Node.js

A dashboard backend needs to serve aggregated data efficiently, handle authentication, and expose clean REST endpoints that your frontend can consume without over-fetching. As the creator of CoreUI with 25 years of backend development experience, I’ve built the API layers that power CoreUI’s admin templates and know what structure scales well from prototype to production. The key is organizing the project by feature, not by layer — routes, controllers, and services grouped together for each domain area. This makes the codebase navigable as it grows and keeps related logic colocated.

Read More…

How to hide sensitive logs in Node.js

Accidentally logging passwords, tokens, or personal data is a serious security risk that can expose sensitive information in log aggregators, monitoring tools, and stdout captures. As the creator of CoreUI with 25 years of backend development experience, I’ve seen production incidents caused by tokens appearing in plain-text logs. The safest approach is to use a structured logger like Pino or Winston with built-in redaction support that strips sensitive fields before they’re ever written. This ensures credentials never appear in logs regardless of which developer added the log statement.

Read More…

How to colorize console output in Node.js

Colorized terminal output makes CLI tools more readable by visually distinguishing success, errors, and warnings. As the creator of CoreUI with over 10 years of Node.js experience since 2014, I’ve added color output to build scripts, test runners, and deployment tools to make status immediately clear. The standard approach uses the chalk library which handles ANSI escape codes across platforms including Windows. This produces professional-looking terminal output.

Read More…

How to parse command line args in Node.js

Parsing command line arguments correctly is the foundation of any useful Node.js CLI tool or script. As the creator of CoreUI with over 10 years of Node.js experience since 2014, I’ve built dozens of CLI tools that accept flags, options, and positional arguments. The standard approach uses the built-in process.argv for simple cases or minimist for automatic flag parsing without heavier frameworks. This makes scripts flexible and configurable without code changes.

Read More…

How to create CLI tools in Node.js

Building CLI tools with Node.js lets you automate workflows and provide developer utilities as npm packages. As the creator of CoreUI with over 25 years of software development experience since 2000, I’ve built CLI tools for code generation, project scaffolding, and automated deployments. The standard approach uses commander for argument parsing, inquirer for interactive prompts, and chalk for colored output. This produces professional CLI tools that feel native to the terminal.

Read More…

How to use Agenda scheduler in Node.js

Agenda is a lightweight job scheduling library for Node.js that stores jobs in MongoDB, providing persistence across restarts. As the creator of CoreUI with over 10 years of Node.js experience since 2014, I’ve used Agenda for email campaigns, report generation, and recurring maintenance tasks in production applications. The standard approach defines job processors, schedules jobs with cron expressions or intervals, and monitors execution with event listeners. This provides durable scheduled task execution with minimal overhead.

Read More…

How to use Bull queues in Node.js

Bull is a powerful Node.js library for handling distributed job queues with Redis, enabling reliable background task processing. As the creator of CoreUI with over 10 years of Node.js experience since 2014, I’ve used Bull for email sending, image processing, report generation, and scheduled tasks in production systems. The standard approach creates queue instances, adds jobs with data, and processes them with worker functions that run asynchronously. This provides robust job handling with retries, priorities, and delayed execution.

Read More…
Subscribe to our newsletter
Get early information about new products, product updates and blog posts.
How to Use JavaScript setTimeout()
How to Use JavaScript setTimeout()

How to Use Bootstrap Dropdown in Vue 3 – CoreUI Integration Guide
How to Use Bootstrap Dropdown in Vue 3 – CoreUI Integration Guide

How to Hide Scrollbar with CSS
How to Hide Scrollbar with CSS

How to Open All Links in New Tab Using JavaScript
How to Open All Links in New Tab Using JavaScript

Answers by CoreUI Core Team