<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Marvenics | Blog]]></title><description><![CDATA[Angular, Ionic Framework, NodeJS &amp; UIUX]]></description><link>https://blog.marvenics.com</link><image><url>https://cdn.hashnode.com/res/hashnode/image/upload/v1677586206884/dbIQv1lFp.png</url><title>Marvenics | Blog</title><link>https://blog.marvenics.com</link></image><generator>RSS for Node</generator><lastBuildDate>Sun, 12 Apr 2026 13:35:00 GMT</lastBuildDate><atom:link href="https://blog.marvenics.com/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Node.js for Beginners: A Step-by-Step Roadmap🧑🏻‍💻🗺️]]></title><description><![CDATA[Welcome to our blog on Node.js! Node.js is a powerful and popular runtime environment for building web applications and APIs. It is known for its ability to handle a high number of concurrent connections and its support for asynchronous, non-blocking...]]></description><link>https://blog.marvenics.com/nodejs-for-beginners-a-step-by-step-roadmap</link><guid isPermaLink="true">https://blog.marvenics.com/nodejs-for-beginners-a-step-by-step-roadmap</guid><category><![CDATA[Node.js]]></category><category><![CDATA[JavaScript]]></category><category><![CDATA[server]]></category><dc:creator><![CDATA[VaishnaV]]></dc:creator><pubDate>Wed, 21 Dec 2022 12:49:03 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1671626765652/t6qYTtf-T.jpg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Welcome to our blog on Node.js! Node.js is a powerful and popular runtime environment for building web applications and APIs. It is known for its ability to handle a high number of concurrent connections and its support for asynchronous, non-blocking I/O.</p>
<p>In this blog, we will cover the essential concepts and skills you need to get started with Node.js. We will cover topics such as the event loop, modules and dependencies, testing and debugging, and deploying Node.js applications.</p>
<p>Whether you are a beginner looking to learn Node.js from scratch, or an experienced developer looking to deepen your knowledge of the platform, this blog will provide you with a comprehensive and practical guide to building applications with Node.js.</p>
<p>So let's get started🎉</p>
<h2 id="heading-chapter-1-introduction-to-nodejs">Chapter 1: Introduction to Node.js</h2>
<p>Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine. It allows developers to run JavaScript on the server side, enabling the creation of server-side applications with JavaScript.</p>
<p>To get started with Node.js, you will need to set up a development environment on your computer. This typically involves installing Node.js itself, as well as a text editor or integrated development environment (IDE) for writing code.</p>
<p>Here is an example of how to check if Node.js is installed on your system and display the version number:</p>
<pre><code class="lang-javascript">$ node -v
v14<span class="hljs-number">.16</span><span class="hljs-number">.0</span>
</code></pre>
<h2 id="heading-chapter-2-basic-javascript-concepts">Chapter 2: Basic JavaScript concepts</h2>
<p>Before diving into Node.js, it is important to have a solid understanding of basic JavaScript concepts. These include:</p>
<ul>
<li>Variables and data types: Variables are used to store data in JavaScript. There are several data types, including strings, numbers, and booleans.</li>
</ul>
<pre><code class="lang-javascript">name = <span class="hljs-string">"John"</span>; <span class="hljs-comment">// string</span>
<span class="hljs-keyword">let</span> age = <span class="hljs-number">30</span>; <span class="hljs-comment">// number</span>
<span class="hljs-keyword">let</span> isEmployed = <span class="hljs-literal">true</span>; <span class="hljs-comment">// boolean</span>
</code></pre>
<ul>
<li>Control structures: Control structures, such as if/else statements and for loops, allow you to control the flow of your program.</li>
</ul>
<pre><code class="lang-javascript"><span class="hljs-keyword">if</span> (age &gt; <span class="hljs-number">18</span>) {
  <span class="hljs-built_in">console</span>.log(<span class="hljs-string">"You are an adult."</span>);
} <span class="hljs-keyword">else</span> {
  <span class="hljs-built_in">console</span>.log(<span class="hljs-string">"You are a minor."</span>);
}

<span class="hljs-keyword">for</span> (<span class="hljs-keyword">let</span> i = <span class="hljs-number">0</span>; i &lt; <span class="hljs-number">5</span>; i++) {
  <span class="hljs-built_in">console</span>.log(i);
}
</code></pre>
<ul>
<li>Functions: Functions are blocks of code that can be reused. They can accept arguments and return a value.</li>
</ul>
<pre><code class="lang-javascript"><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">greet</span>(<span class="hljs-params">name</span>) </span>{
  <span class="hljs-built_in">console</span>.log(<span class="hljs-string">"Hello, "</span> + name + <span class="hljs-string">"!"</span>);
}

greet(<span class="hljs-string">"John"</span>); <span class="hljs-comment">// prints "Hello, John!"</span>
</code></pre>
<ul>
<li>Objects and arrays: Objects and arrays are used to store and organize data in JavaScript. Objects are key-value pairs, while arrays are lists of items.</li>
</ul>
<pre><code class="lang-javascript"><span class="hljs-keyword">let</span> person = {
  <span class="hljs-attr">name</span>: <span class="hljs-string">"John"</span>,
  <span class="hljs-attr">age</span>: <span class="hljs-number">30</span>,
  <span class="hljs-attr">isEmployed</span>: <span class="hljs-literal">true</span>
};

<span class="hljs-keyword">let</span> names = [<span class="hljs-string">"John"</span>, <span class="hljs-string">"Jane"</span>, <span class="hljs-string">"Bob"</span>];
</code></pre>
<h2 id="heading-chapter-3-asynchronous-programming-in-nodejs">Chapter 3: Asynchronous programming in Node.js</h2>
<p>One of the key features of Node.js is its ability to perform asynchronous operations. This means that it can handle multiple requests and tasks concurrently, rather than waiting for one to complete them before starting the next.</p>
<p>There are several ways to perform asynchronous operations in Node.js, including:</p>
<ul>
<li>Callback functions: A callback function is a function that is passed as an argument to another function, which is then called when the asynchronous operation is complete.</li>
</ul>
<pre><code class="lang-javascript"><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">getData</span>(<span class="hljs-params">callback</span>) </span>{
  <span class="hljs-built_in">setTimeout</span>(<span class="hljs-function">() =&gt;</span> {
    callback(<span class="hljs-string">"Data received."</span>);
  }, <span class="hljs-number">1000</span>);
}

getData(<span class="hljs-function">(<span class="hljs-params">message</span>) =&gt;</span> {
  <span class="hljs-built_in">console</span>.log(message);
});
</code></pre>
<ul>
<li>Promises: Promises are objects that represent the eventual result of an asynchronous operation. They can be in one of three states: pending, fulfilled, or rejected.</li>
</ul>
<pre><code class="lang-javascript"><span class="hljs-keyword">let</span> promise = <span class="hljs-keyword">new</span> <span class="hljs-built_in">Promise</span>(<span class="hljs-function">(<span class="hljs-params">resolve, reject</span>) =&gt;</span> {
  <span class="hljs-built_in">setTimeout</span>(<span class="hljs-function">() =&gt;</span> {
    resolve(<span class="hljs-string">"Promise resolved."</span>);
  }, <span class="hljs-number">1000</span>);
});

promise.then(<span class="hljs-function">(<span class="hljs-params">message</span>)=&gt;</span>{
    <span class="hljs-built_in">console</span>.log(message) <span class="hljs-comment">// Promise resolved.</span>
});
</code></pre>
<h2 id="heading-chapter-4-working-with-the-nodejs-runtime">Chapter 4: Working with the Node.js runtime</h2>
<p>Node.js provides several built-in modules that allow you to access various features of the runtime environment. Some of the modules you may find useful include:</p>
<ul>
<li>Process management: The <code>process</code> module allows you to access information about the current Node.js process, such as its arguments and environment variables.</li>
</ul>
<pre><code class="lang-javascript"><span class="hljs-built_in">console</span>.log(process.argv);
<span class="hljs-built_in">console</span>.log(process.env);
</code></pre>
<ul>
<li>File system: The <code>fs</code> (file system) the module allows you to read and write files, as well as perform other file system operations.</li>
</ul>
<pre><code class="lang-javascript"><span class="hljs-keyword">const</span> fs = <span class="hljs-built_in">require</span>(<span class="hljs-string">"fs"</span>);

fs.readFile(<span class="hljs-string">"file.txt"</span>, <span class="hljs-string">"utf8"</span>, <span class="hljs-function">(<span class="hljs-params">err, data</span>) =&gt;</span> {
  <span class="hljs-keyword">if</span> (err) <span class="hljs-keyword">throw</span> err;
  <span class="hljs-built_in">console</span>.log(data);
});
</code></pre>
<ul>
<li>Streams: Streams are a way to handle large amounts of data efficiently in Node.js. They allow you to read or write data in small chunks, rather than reading or writing the entire dataset at once.</li>
</ul>
<pre><code class="lang-javascript"><span class="hljs-keyword">const</span> fs = <span class="hljs-built_in">require</span>(<span class="hljs-string">"fs"</span>);
<span class="hljs-keyword">const</span> file = fs.createReadStream(<span class="hljs-string">"file.txt"</span>);

file.on(<span class="hljs-string">"data"</span>, <span class="hljs-function">(<span class="hljs-params">chunk</span>) =&gt;</span> {
  <span class="hljs-built_in">console</span>.log(chunk);
});
</code></pre>
<h2 id="heading-chapter-5-building-a-web-server-with-nodejs">Chapter 5: Building a web server with Node.js</h2>
<p>Node.js is often used to build web servers and APIs. To do this, you can use the built-in <code>http</code> module.</p>
<p>Here is an example of how to create a simple web server that listens for incoming HTTP requests and responds with "Hello, World!":</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">const</span> http = <span class="hljs-built_in">require</span>(<span class="hljs-string">"http"</span>);

<span class="hljs-keyword">const</span> server = http.createServer(<span class="hljs-function">(<span class="hljs-params">req, res</span>) =&gt;</span> {
  res.end(<span class="hljs-string">"Hello, World!"</span>);
});

server.listen(<span class="hljs-number">3000</span>, <span class="hljs-function">() =&gt;</span> {
  <span class="hljs-built_in">console</span>.log(<span class="hljs-string">"Server listening on port 3000."</span>);
});
</code></pre>
<p>To handle different routes and requests, you can use the <code>url</code> module to parse the request URL and use logic to determine the appropriate response.</p>
<pre><code class="lang-javascript">Copy codeconst http = <span class="hljs-built_in">require</span>(<span class="hljs-string">"http"</span>);
<span class="hljs-keyword">const</span> url = <span class="hljs-built_in">require</span>(<span class="hljs-string">"url"</span>);

<span class="hljs-keyword">const</span> server = http.createServer(<span class="hljs-function">(<span class="hljs-params">req, res</span>) =&gt;</span> {
  <span class="hljs-keyword">const</span> parsedUrl = url.parse(req.url, <span class="hljs-literal">true</span>);

  <span class="hljs-keyword">if</span> (parsedUrl.pathname === <span class="hljs-string">"/"</span>) {
    res.end(<span class="hljs-string">"Welcome to the homepage!"</span>);
  } <span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> (parsedUrl.pathname === <span class="hljs-string">"/about"</span>) {
    res.end(<span class="hljs-string">"About us."</span>);
  } <span class="hljs-keyword">else</span> {
    res.statusCode = <span class="hljs-number">404</span>;
    res.end(<span class="hljs-string">"404: Not Found"</span>);
  }
});

server.listen(<span class="hljs-number">3000</span>, <span class="hljs-function">() =&gt;</span> {
  <span class="hljs-built_in">console</span>.log(<span class="hljs-string">"Server listening on port 3000."</span>);
});
</code></pre>
<p>You can also serve static files, such as HTML, CSS, and JavaScript, by reading the file from the file system and sending the contents as the response.</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">const</span> http = <span class="hljs-built_in">require</span>(<span class="hljs-string">"http"</span>);
<span class="hljs-keyword">const</span> fs = <span class="hljs-built_in">require</span>(<span class="hljs-string">"fs"</span>);

<span class="hljs-keyword">const</span> server = http.createServer(<span class="hljs-function">(<span class="hljs-params">req, res</span>) =&gt;</span> {
  fs.readFile(<span class="hljs-string">"index.html"</span>, <span class="hljs-function">(<span class="hljs-params">err, data</span>) =&gt;</span> {
    <span class="hljs-keyword">if</span> (err) <span class="hljs-keyword">throw</span> err;
    res.end(data);
  });
});
</code></pre>
<h2 id="heading-chapter-6-working-with-databases">Chapter 6: Working with databases</h2>
<p>In order to store and retrieve data for your Node.js applications, you will need to use a database. There are many different database options available, including relational databases (such as MySQL and PostgreSQL) and NoSQL databases (such as MongoDB and Cassandra).</p>
<p>To connect to a database from Node.js, you will need to use a database driver or ORM (Object-Relational Mapping) library. These libraries provide a layer of abstraction between your code and the database, allowing you to interact with the database using JavaScript objects rather than SQL queries.</p>
<p>Here is an example of how to connect to a MongoDB database using the <code>mongodb</code> driver:</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">const</span> MongoClient = <span class="hljs-built_in">require</span>(<span class="hljs-string">"mongodb"</span>).MongoClient;
<span class="hljs-keyword">const</span> uri =
  <span class="hljs-string">"mongodb+srv://&lt;username&gt;:&lt;password&gt;@cluster0.mongodb.net/test?retryWrites=true&amp;w=majority"</span>;
<span class="hljs-keyword">const</span> client = <span class="hljs-keyword">new</span> MongoClient(uri, { <span class="hljs-attr">useNewUrlParser</span>: <span class="hljs-literal">true</span> });
client.connect(<span class="hljs-function">(<span class="hljs-params">err</span>) =&gt;</span> {
  <span class="hljs-keyword">const</span> collection = client.db(<span class="hljs-string">"test"</span>).collection(<span class="hljs-string">"devices"</span>);
  <span class="hljs-comment">// perform actions on the collection object</span>
  client.close();
});
</code></pre>
<p>Once you are connected to the database, you can perform CRUD (create, read, update, delete) operations on the data.</p>
<p>Here is an example of inserting a document into a MongoDB collection:</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">const</span> collection = client.db(<span class="hljs-string">"test"</span>).collection(<span class="hljs-string">"devices"</span>);
collection.insertOne({ <span class="hljs-attr">name</span>: <span class="hljs-string">"Device 1"</span> }, <span class="hljs-function">(<span class="hljs-params">err, result</span>) =&gt;</span> {
  <span class="hljs-built_in">console</span>.log(result);
});
</code></pre>
<p>You can also query and filter the data using various operators.</p>
<p>Here is an example of finding all documents in a MongoDB collection where the name field contains the string "Device":</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">const</span> collection = client.db(<span class="hljs-string">"test"</span>).collection(<span class="hljs-string">"devices"</span>);
collection.find({ <span class="hljs-attr">name</span>: <span class="hljs-regexp">/Device/</span> }).toArray(<span class="hljs-function">(<span class="hljs-params">err, docs</span>) =&gt;</span> {
  <span class="hljs-built_in">console</span>.log(docs);
});
</code></pre>
<h2 id="heading-chapter-7-advanced-nodejs-concepts">Chapter 7: Advanced Node.js concepts</h2>
<p>As you become more comfortable with Node.js, there are several advanced concepts you may want to explore. These include:</p>
<ul>
<li>Modules and dependencies: Node.js uses a module system, which allows you to organize your code into reusable pieces called modules. You can use the <code>require</code> function to import a module into your code, and the <code>module.exports</code> object to export the contents of a module.</li>
</ul>
<pre><code class="lang-javascript"><span class="hljs-comment">// math.js</span>
<span class="hljs-built_in">module</span>.exports = {
  <span class="hljs-attr">add</span>: <span class="hljs-function">(<span class="hljs-params">a, b</span>) =&gt;</span> a + b,
  <span class="hljs-attr">subtract</span>: <span class="hljs-function">(<span class="hljs-params">a, b</span>) =&gt;</span> a - b,
};

<span class="hljs-comment">// main.js</span>
<span class="hljs-keyword">const</span> math = <span class="hljs-built_in">require</span>(<span class="hljs-string">"./math"</span>);
<span class="hljs-built_in">console</span>.log(math.add(<span class="hljs-number">1</span>, <span class="hljs-number">2</span>)); <span class="hljs-comment">// 3</span>
<span class="hljs-built_in">console</span>.log(math.subtract(<span class="hljs-number">5</span>, <span class="hljs-number">3</span>)); <span class="hljs-comment">// 2</span>
</code></pre>
<ul>
<li>Testing and debugging: As you build larger and more complex applications, it is important to have a testing and debugging strategy in place. There are many tools and libraries available for testing and debugging Node.js code, including Mocha, Chai, and Jest.</li>
</ul>
<pre><code class="lang-javascript"><span class="hljs-keyword">const</span> assert = <span class="hljs-built_in">require</span>(<span class="hljs-string">"assert"</span>);

describe(<span class="hljs-string">"Math"</span>, <span class="hljs-function">() =&gt;</span> {
  it(<span class="hljs-string">"should add two numbers"</span>, <span class="hljs-function">() =&gt;</span> {
    assert.equal(math.add(<span class="hljs-number">1</span>, <span class="hljs-number">2</span>), <span class="hljs-number">3</span>);
  });

  it(<span class="hljs-string">"should subtract two numbers"</span>, <span class="hljs-function">() =&gt;</span> {
    assert.equal(math.subtract(<span class="hljs-number">5</span>, <span class="hljs-number">3</span>), <span class="hljs-number">2</span>);
  });
});
</code></pre>
<ul>
<li>Deploying Node.js applications: Once you have built a Node.js application, you will need to deploy it in order to make it available to users. There are many options for deploying Node.js applications, including hosting it on a cloud platform such as Amazon Web Services or Microsoft Azure, or on a traditional web server.</li>
</ul>
<p>To deploy a Node.js application on a cloud platform, you will typically need to create an account, set up a virtual machine or container, and deploy your code to the machine or container. You will also need to set up any necessary infrastructure, such as a database or load balancer.</p>
<p>To deploy a Node.js application on a traditional web server, you will need to install Node.js on the server and configure the webserver to serve your application.</p>
<p>I hope this blog post on the roadmap for learning Node.js was helpful! Let me know if you have any specific questions about any of the topics covered.</p>
]]></content:encoded></item><item><title><![CDATA[ChatGPT vs. Google: Can a chatbot take on the world’s top search engine?]]></title><description><![CDATA[ChatGPT is a chatbot that uses natural language processing to understand and respond to user input. It was developed by OpenAI, a research institute that focuses on artificial intelligence. While ChatGPT is certainly a powerful tool, it is not likely...]]></description><link>https://blog.marvenics.com/chatgpt-vs-google-can-a-chatbot-take-on-the-worlds-top-search-engine-593d0e33c2b8</link><guid isPermaLink="true">https://blog.marvenics.com/chatgpt-vs-google-can-a-chatbot-take-on-the-worlds-top-search-engine-593d0e33c2b8</guid><dc:creator><![CDATA[VaishnaV]]></dc:creator><pubDate>Tue, 13 Dec 2022 08:02:20 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1671270477933/Z4ZBXAxrb.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>ChatGPT is a chatbot that uses natural language processing to understand and respond to user input. It was developed by OpenAI, a research institute that focuses on artificial intelligence. While ChatGPT is certainly a powerful tool, it is not likely to replace Google anytime soon.</p>
<p>First and foremost, ChatGPT is designed to assist with specific tasks, such as answering questions or providing information. It is not a general-purpose search engine like Google, which can be used to find almost any type of information on the internet. ChatGPT is focused on providing answers to specific questions, and it is not capable of conducting broad searches like Google can.</p>
<p>Additionally, ChatGPT is still a relatively new technology, and it is not as advanced as Google’s search algorithms. Google has been around for over two decades and has spent billions of dollars on research and development to improve its search capabilities. As a result, it is able to provide more accurate and relevant results than ChatGPT.</p>
<p>Furthermore, ChatGPT is not as widely used as Google. While Google is the most popular search engine in the world, with millions of users every day, ChatGPT is still relatively unknown. It is not yet available to the general public, and it is unclear how many people are actually using it.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1671270476004/xkTI7DCE6.jpeg" alt /></p>
<p><a target="_blank" href="https://www.freepik.com/free-photo/ai-technology-microchip-background-futuristic-innovation-technology-remix_17123302.htm#query=artificial%20intelligence&amp;position=26&amp;from_view=search&amp;track=sph">https://www.freepik.com/free-photo/ai-technology-microchip-background-futuristic-innovation-technology-remix_17123302.htm#query=artificial%20intelligence&amp;position=26&amp;from_view=search&amp;track=sph</a></p>
<p>In conclusion, while ChatGPT is a powerful tool for answering specific questions, it is not likely to replace Google as a general-purpose search engine. Google has a significant head start in terms of technology and user base, and it is unlikely that ChatGPT will be able to catch up anytime soon.</p>
]]></content:encoded></item><item><title><![CDATA[Ionic Framework⚡️Flutter - Which One to Choose for Your App Development?]]></title><description><![CDATA[Ionic framework vs Flutter
Ionic and Flutter are both popular frameworks for building mobile applications. Ionic is a hybrid framework, meaning it uses a combination of web technologies such as HTML, CSS, and JavaScript to build cross-platform apps. ...]]></description><link>https://blog.marvenics.com/ionic-framework-vs-flutter-5e31d5393252</link><guid isPermaLink="true">https://blog.marvenics.com/ionic-framework-vs-flutter-5e31d5393252</guid><dc:creator><![CDATA[VaishnaV]]></dc:creator><pubDate>Thu, 08 Dec 2022 05:37:30 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1671270488470/jK_XTHLIm.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1671270488470/jK_XTHLIm.png" alt /></p>
<p>Ionic framework vs Flutter</p>
<p>Ionic and Flutter are both popular frameworks for building mobile applications. Ionic is a hybrid framework, meaning it uses a combination of web technologies such as HTML, CSS, and JavaScript to build cross-platform apps. Flutter, on the other hand, is a native framework that uses the Dart programming language to build apps for both Android and iOS.</p>
<p>One of the main advantages of Ionic is its ability to create applications that work on multiple platforms with a single codebase. This means that developers can write the code once and deploy it to both Android and iOS devices, saving time and effort. Ionic also has a large community of developers and a robust ecosystem of plugins and tools, making it easy to find support and resources when needed.</p>
<p>Flutter, on the other hand, offers a number of advantages over Ionic. First, Flutter apps are built using the Dart programming language, which is known for its ability to support both object-oriented and functional programming paradigms. This makes it a powerful and flexible language for building complex applications. Additionally, Flutter uses the Skia graphics engine, which allows for smooth and performant animations and transitions. This is particularly useful for creating attractive and engaging user interfaces.</p>
<p>Another advantage of Flutter is its hot reload feature, which allows developers to see the changes they make to their code in real-time. This means that developers can make changes to their code and immediately see the results, without having to wait for a lengthy build process. This makes it much easier to iterate on designs and experiment with different ideas.</p>
<p>Overall, both Ionic and Flutter have their own unique strengths and weaknesses. Ionic is a good choice for developers who want to create cross-platform apps quickly and easily, while Flutter is better suited for those who want to create high-performance and visually-striking applications. Ultimately, the decision of which framework to use will depend on the specific needs and goals of the project.</p>
]]></content:encoded></item><item><title><![CDATA[Using Tailwind CSS in Angular 11.2+ Project🔥]]></title><description><![CDATA[Setting up Tailwind CSS in an Angular Project
Tailwind CSS is a utility first CSS framework for building custom interfaces easily. From Angular 11.2, it includes native support for Tailwind CSS.Ensure Angular version is 12.2+ and Node.js version 12.1...]]></description><link>https://blog.marvenics.com/setup-tailwind-css-in-angular-4570fe353f75</link><guid isPermaLink="true">https://blog.marvenics.com/setup-tailwind-css-in-angular-4570fe353f75</guid><dc:creator><![CDATA[VaishnaV]]></dc:creator><pubDate>Sun, 28 Nov 2021 20:01:39 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1671270499529/7AXvggB1t.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1671270499529/7AXvggB1t.png" alt /></p>
<h4 id="heading-setting-up-tailwind-css-in-an-angular-project">Setting up Tailwind CSS in an Angular Project</h4>
<p>Tailwind CSS is a utility first CSS framework for building custom interfaces easily. From Angular 11.2, it includes native support for T<a target="_blank" href="https://tailwindcss.com">ailwind CSS.</a><br />Ensure Angular version is 12.2+ and Node.js version 12.13.0+</p>
<h3 id="heading-creating-your-project">Creating your project</h3>
<p>Start by creating a new angular project using npm</p>
<p><strong>ng new angulartailwind-demo</strong></p>
<h3 id="heading-set-up-tailwind-css">Set up Tailwind CSS</h3>
<p>Run following npm command to install Tailwind CSS package.</p>
<p><strong>npm install -D tailwindcss</strong></p>
<p>Install postcss and autoprefixer dependencies</p>
<p><strong>npm install postcss@latest autoprefixer@latest</strong></p>
<h3 id="heading-create-tailwind-css-configuration-file">Create Tailwind CSS Configuration File</h3>
<p>Generate tailwind CSS configuration file(tailwind.config.js) using following command</p>
<pre><code>**npx tailwindcss init**
</code></pre><p>This command will create a config file in your project root directory.</p>
<p>Learn more about Tailwind Configuration <a target="_blank" href="https://tailwindcss.com/docs/configuration">read more</a></p>
<h3 id="heading-include-tailwind-in-your-scss">Include Tailwind in your SCSS</h3>
<blockquote>
<p>If you are using <strong>css</strong><br />Import Tailwind CSS into styles.css using following code.</p>
<p>If you are using <strong>scss</strong><br />Import Tailwind CSS into styles.scss using following code.</p>
</blockquote>
<h3 id="heading-test-the-tailwind-css-integration">Test the Tailwind CSS Integration</h3>
<p>Add the folowing code to app.component.html</p>
Buy now

<h3 id="heading-purge-the-unused-css-in-production">Purge the unused CSS in production</h3>
<p>Tailwind CSS gives a fearture to remove unused css classes to reduce the bundle size.We can add purge option on the tailwind.config.js file as folows.</p>
<p>It will check the ts and html files in the entire src directory and purge unused style classes from the project.</p>
<blockquote>
<p>For more information please refer <a target="_blank" href="https://tailwindcss.com/docs">Tailwind CSS Documentation</a></p>
</blockquote>
<p>Follow me on <a target="_blank" href="https://yshnv.medium.com">Medium</a> to get regular updates on blogs.</p>
]]></content:encoded></item><item><title><![CDATA[What is the difference between Promises and Observables in Angular?]]></title><description><![CDATA[Introduction
First of all, Promise and Observable are used for handling Asynchronous Data in applications. In this article, we are gonna learn about the difference between Promise and Observable.
What is Promise?
A Promise is Future Value of an Event...]]></description><link>https://blog.marvenics.com/what-is-the-difference-between-promises-and-observables-in-angular-6aa13d3a6409</link><guid isPermaLink="true">https://blog.marvenics.com/what-is-the-difference-between-promises-and-observables-in-angular-6aa13d3a6409</guid><dc:creator><![CDATA[VaishnaV]]></dc:creator><pubDate>Fri, 02 Aug 2019 19:55:40 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1671270538961/L0WN8MQnP.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><strong>Introduction</strong></p>
<p>First of all, <code>Promise</code> and <code>Observable</code> are used for handling Asynchronous Data in applications. In this article, we are gonna learn about the difference between <em>Promise</em> and <em>Observable.</em></p>
<p><strong>What is <em>Promise</em>?</strong></p>
<p>A <code>Promise</code> is Future Value of an Event. In Angular when we are using API, Sockets, Timers like Time Delaying functionalities in a function X, we need to send back assurance for caller function of function X.</p>
<p>In other words, it is a relation between Callee and Caller Function, In which caller function believes that caller must return some value as resolution or reject.</p>
<p>For example :</p>
<pre><code><span class="hljs-string">`getData() {  
`</span>  <span class="hljs-keyword">return</span> <span class="hljs-built_in">this</span>.http.get(<span class="hljs-built_in">this</span>.apiUrl)  
            .toPromise()  
            .then(<span class="hljs-function"><span class="hljs-params">res</span> =&gt;</span> {  
              resolve(res);  
             })  
            .catch(<span class="hljs-function"><span class="hljs-params">err</span> =&gt;</span> {  
                <span class="hljs-built_in">console</span>.log(err);  
                reject(err);  
             });  
}
</code></pre><p>In this program, the function <code>getData()</code> returns a <em>Promise</em> which will be a success or failure. According to its request status, it will resolve or reject data. While the caller function waits until the data arrives from this function.</p>
<p><strong>What is <em>Observable</em>?</strong></p>
<p>An <code>Observable</code> is like a Steam (in many languages) and allows to pass zero or more events where the callback is called for each event. More than multiple events handling it helps us in asynchronous programming.</p>
<p>A third-party library called Reactive Extensions (RxJS) is used by Angular to use <code>Observable</code>.</p>
<p>For Example:</p>
<pre><code>getData (): Observable&lt;any[]&gt; {  
        <span class="hljs-keyword">return</span> <span class="hljs-built_in">this</span>.http.get(<span class="hljs-built_in">this</span>.apiUrl)   
                         .map(<span class="hljs-function">(<span class="hljs-params">res:Response</span>) =&gt;</span> res.json())  
                         .catch(<span class="hljs-function">(<span class="hljs-params">error:any</span>) =&gt;</span>                Observable.throw(error.json().error || <span class="hljs-string">'Server error'</span>));  
    }
</code></pre>]]></content:encoded></item><item><title><![CDATA[5 Must-Have VS Code Extensions for Angular / Ionic Developers]]></title><description><![CDATA[VS Code is the best IDE for Angular / Ionic Developers because of many reasons. They provide Pre-installed Git, having bundles for code intelligence, code format etc.. and VSCode has a vast number of extensions for various functionalities.
Those fact...]]></description><link>https://blog.marvenics.com/5-must-have-vs-code-extensions-for-angular-ionic-developers-c85f72536468</link><guid isPermaLink="true">https://blog.marvenics.com/5-must-have-vs-code-extensions-for-angular-ionic-developers-c85f72536468</guid><dc:creator><![CDATA[VaishnaV]]></dc:creator><pubDate>Fri, 02 Aug 2019 17:51:21 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1671270528811/xKLE6UxEe.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>VS Code is the best IDE for Angular / Ionic Developers because of many reasons. They provide Pre-installed Git, having bundles for code intelligence, code format etc.. and VSCode has a vast number of extensions for various functionalities.</p>
<p>Those factors make VSCode more preferable IDE for Angular / Ionic Developers.</p>
<p>The 5 VSCode extensions that I feel as must-have for Angular/Ionic Development are :</p>
<ul>
<li><a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=Angular.ng-template"><strong>Angular Language Service</strong></a></li>
</ul>
<p>Angular Language Service is the most productive extension for Angular / Ionic Developers. It provides rich editing experience by using completion list, Quick info and got a definition like features.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1671270521553/Hms4wMDV-.gif" alt /></p>
<p>Source: Github (<a target="_blank" href="https://raw.githubusercontent.com/angular/vscode-ng-language-service/master/client/R67RcGftRS.gif">https://raw.githubusercontent.com/angular/vscode-ng-language-service/master/client/R67RcGftRS.gif</a>)</p>
<ul>
<li><a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=ms-vscode.vscode-typescript-tslint-plugin"><strong>TSLint</strong></a></li>
</ul>
<p>TSLint extension is used to checks <a target="_blank" href="https://github.com/Microsoft/TypeScript">TypeScript</a> code for readability, maintainability, and functionality errors. It will check code according to the lint rules, configurations and formatters.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1671270523300/i4wdlFbEk.jpeg" alt /></p>
<ul>
<li><a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=fivethree.vscode-ionic-snippets"><strong>Ionic 4 Snippets</strong></a></li>
</ul>
<p>Ionic 4 Snippets extension provide Ionic snippets for your template. It will help Ionic Developers to design template faster using suggestion and shortcuts that this extension provides.“ <em>i-”</em> is used to getting recommendations of Ionic 4 snippets.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1671270524624/d1y-OvRZl.jpeg" alt /></p>
<ul>
<li><a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=Mikael.Angular-BeastCode"><strong>Angular 8 Snippets — TypeScript, Html, Angular Material, ngRx, RxJS &amp; Flex Layout</strong></a></li>
</ul>
<p>Angular 8 Snippets Extension provides Html &amp; Typescript Snippets for Visual Studio Code. It gave Angular 2,4,5,6, 7 &amp; 8 Snippets.Along with angular recommendations, the extension gives shortcuts for <a target="_blank" href="http://material.angular.io">Angular Material</a>, <a target="_blank" href="https://github.com/angular/flex-layout">Flex Layout</a>, <a target="_blank" href="http://ngrx.io">NGRX</a> and <a target="_blank" href="http://jestjs.io">Jest Js</a>.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1671270525914/io-VqruQM.jpeg" alt /></p>
<ul>
<li><a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode"><strong>Prettier — Code Formatter</strong></a></li>
</ul>
<p>Prettier is one of the extensions that make VS Code more user-friendly. It will automatically format the code according to the syntax of our program. JavaScript, TypeScript, CSS files can be format by using this extension.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1671270527236/4DzR2lMYN.jpeg" alt /></p>
<p>Thanks :)</p>
<p>Don't Forget to Follow Us</p>
]]></content:encoded></item><item><title><![CDATA[How to implement swipe in ionic using HammerJs ?]]></title><description><![CDATA[Hello,
Hammer Js is used to add touch gestures to your web app. In Ionic Framework, we can add swipeable gestures bu using Hammer Js
Setup
First, install Hammer Js

npm install –save hammerjs

After Installation generates a class file using CMD

ioni...]]></description><link>https://blog.marvenics.com/how-to-implement-swipe-in-ionic-using-hammerjs-364278b343bd</link><guid isPermaLink="true">https://blog.marvenics.com/how-to-implement-swipe-in-ionic-using-hammerjs-364278b343bd</guid><dc:creator><![CDATA[VaishnaV]]></dc:creator><pubDate>Fri, 02 Aug 2019 07:31:01 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1671270510732/zmx3UyAMF.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Hello,</p>
<p><a target="_blank" href="https://hammerjs.github.io/">Hammer Js</a> is used to add touch gestures to your web app. In Ionic Framework, we can add swipeable gestures bu using Hammer Js</p>
<p><strong>Setup</strong></p>
<p>First, install Hammer Js</p>
<blockquote>
<p>npm install –save hammerjs</p>
</blockquote>
<p>After Installation generates a class file using CMD</p>
<blockquote>
<p>ionic g class HammerConfig</p>
</blockquote>
<p>It will generate a class file called <em>HammerConfig.ts</em></p>
<p>In <em>HammerConfig.ts Class should have the following definition</em></p>
<p>And register MyHammerConfig Class in a<em>pp.module.ts</em></p>
<blockquote>
<p>{ provide: HAMMER_GESTURE_CONFIG, useClass: MyHammerConfig }</p>
</blockquote>
<p>Add this line to the Providers section in <em>app.module.ts.</em></p>
<blockquote>
<p>import {MyHammerConfig} from ‘../HammerConfig’;</p>
</blockquote>
<p>And import MyHammerConfig in the import section.</p>
<p>You can find the gestures which Hammer Js provide from <a target="_blank" href="https://github.com/angular/angular/blob/5298b2bda34a8766b28c8425e447f94598b23901/packages/platform-browser/src/dom/events/hammer_gestures.ts#L15">Here</a>.</p>
<p><strong>For Example</strong></p>
<blockquote>


<p>onPan(event){</p>
<p>console.log(event);</p>
<p>}</p>
</blockquote>
<p>You can refer to is live <a target="_blank" href="https://stackblitz.com/edit/pan-gesture?embed=1">stackblitz</a> project</p>
<p>[<strong>pan-gesture - StackBlitz</strong><br /><em>Starter project for Angular apps that exports to the Angular CLI</em>stackblitz.com](https://stackblitz.com/edit/pan-gesture?embed=1&amp;file=app/app.component.ts "https://stackblitz.com/edit/pan-gesture?embed=1&amp;file=app/app.component.ts")<a target="_blank" href="https://stackblitz.com/edit/pan-gesture?embed=1&amp;file=app/app.component.ts"></a></p>
<p>Thanks :)</p>
]]></content:encoded></item><item><title><![CDATA[How do you load a custom component in ionic 4?]]></title><description><![CDATA[(source : Google)
First create a component
ionic start myProject blank --type=angular  
ionic g module components  
ionic g component components/myComponent --export
This adds both a declaration and export to the components module for “myComponent”.
...]]></description><link>https://blog.marvenics.com/how-do-you-load-a-custom-component-in-ionic-4-4a6b05535d9d</link><guid isPermaLink="true">https://blog.marvenics.com/how-do-you-load-a-custom-component-in-ionic-4-4a6b05535d9d</guid><dc:creator><![CDATA[VaishnaV]]></dc:creator><pubDate>Thu, 18 Apr 2019 02:34:07 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1671270549297/mMozedfAJ.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>(source : Google)</p>
<p>First create a component</p>
<pre><code>ionic start myProject blank --type=angular  
ionic g <span class="hljs-built_in">module</span> components  
ionic g component components/myComponent --<span class="hljs-keyword">export</span>
</code></pre><p>This adds both a declaration and export to the components module for “myComponent”.</p>
<p>To use the component just add <code>ComponentsModule</code> to your <code>imports</code> in your page module, e.g.</p>
<p>This way nothing is added to <code>app.module.ts</code> which is how it should be.</p>
<p>Also note if you want to use any components in your own custom components, you need to add <code>IonicModule</code> to the <code>imports</code> in <code>components.module.ts</code></p>
]]></content:encoded></item></channel></rss>