<?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" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Razvan Predescu on Medium]]></title>
        <description><![CDATA[Stories by Razvan Predescu on Medium]]></description>
        <link>https://medium.com/@razvanpredescu?source=rss-4ae1125d86b5------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*J4nZCwE7pkY-c-Z5.</url>
            <title>Stories by Razvan Predescu on Medium</title>
            <link>https://medium.com/@razvanpredescu?source=rss-4ae1125d86b5------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 27 Nov 2026 14:41:55 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@razvanpredescu/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Your own servers, without the DevOps]]></title>
            <link>https://razvanpredescu.medium.com/your-own-servers-without-the-devops-285d261812cc?source=rss-4ae1125d86b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/285d261812cc</guid>
            <category><![CDATA[servers]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[system-administration]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[on-premise]]></category>
            <dc:creator><![CDATA[Razvan Predescu]]></dc:creator>
            <pubDate>Tue, 17 Nov 2026 10:09:26 GMT</pubDate>
            <atom:updated>2026-11-23T16:45:22.038Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://blog.automaton.monster/author/razvan/">Razvan Predescu</a> -</p><p>Your AI assistant installs the server, deploys your apps and keeps them running. You own the machine; Automaton handles the rest.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*5y-8UrxfkQvVSsx2mtPq4Q.png" /></figure><h3>Automaton is a home for every app your AI builds, on servers you own.</h3><p>Building an app with AI takes minutes these days, but putting it online can be a struggle. You either wrestle with the complexity of a cloud platform, or spend a weekend wiring up servers, certificates and deploy scripts.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FLP9L28xqB3I%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fshorts%2FLP9L28xqB3I&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FLP9L28xqB3I%2Fhq2.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/972c96b81fec043470030a4d49164e68/href">https://medium.com/media/972c96b81fec043470030a4d49164e68/href</a></iframe><p>Like everyone these days, I’m using frontier AI models to finish projects long overdue because of lack of time and resources. From the many unfinished ideas, I picked one which allows me to push the apps I build to servers I control, with little effort and few worries. It is currently in preview, but it works and is ready to use.</p><ul><li>Private by default: nothing is public until you share it.</li><li>HTTPS out of the box: Let’s Encrypt certificates are requested and renewed for you.</li><li>Administration tools for your server, or bring your own easily.</li><li>A catalog of ready apps (analytics, monitoring, logging, backups), installed with one click.</li><li>No lock-in: you chose the server (could be your computer), your data, and your domain.</li><li>Open source (Apache 2.0): you only pay for your server.</li></ul><p>Automaton is my personal solution on owning where your software runs with almost no DevOps skill needed. Rent a small server (I’m using Hetzner), point your domain at it, and ask your AI assistant to install Automaton. It sets everything up and hands you a one time link to choose your password. In my tests, an empty server was up and running in under 10 minutes.</p><p>Then ask your favorite AI to build and deploy your websites, APIs or nightly jobs, in any language. Automaton is built so an AI agent can act on your behalf safely, with your approval.</p><p><strong>No lock-in, either way.</strong> Automaton can run the apps you already use. And the apps made for Automaton, ours and yours, aren’t tied to it: in general, you can take them and run them on their own too. You choose the server (it could be your own computer), your data and your domain.</p><p>It does more than hosting: an app store where others install your apps with one click, private sharing with the people you choose, and every machine managed from one place, Automaton Studio (this blog runs on it too).</p><p>I am building it for individuals and small teams who want their own servers without hiring for DevOps. Next time I’ll show how to turn an existing open source project into a one-click app.</p><p>Website: <a href="https://automaton.monster/?ref=blog.automaton.monster">https://automaton.monster</a><br>GitHub: <a href="https://github.com/rzvdaniel/automaton?ref=blog.automaton.monster">https://github.com/rzvdaniel/automaton</a></p><p><em>Originally published at </em><a href="https://blog.automaton.monster/your-own-servers-without-the-devops/"><em>https://blog.automaton.monster</em></a><em> on November 17, 2026.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=285d261812cc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A quick look into Elsa Workflows]]></title>
            <link>https://razvanpredescu.medium.com/a-quick-look-into-elsa-workflows-d87da7f0df4a?source=rss-4ae1125d86b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/d87da7f0df4a</guid>
            <category><![CDATA[dotnet]]></category>
            <category><![CDATA[workflow]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[csharp]]></category>
            <category><![CDATA[elsa]]></category>
            <dc:creator><![CDATA[Razvan Predescu]]></dc:creator>
            <pubDate>Sun, 21 Feb 2021 00:55:18 GMT</pubDate>
            <atom:updated>2021-02-21T17:09:30.825Z</atom:updated>
            <content:encoded><![CDATA[<h3>Overview</h3><p><strong>Elsa</strong> is an open-source effort to bring <strong>workflows </strong>back into the latest .NET versions. The project is led by <a href="https://sipkeschoorstra.medium.com/"><strong>Sipke Schoorstra</strong></a> and it attracted the growing interest of .NET enthusiasts.</p><p>In the process of remaking with version 2 scheduled to blast off around the end of Q1 2021, <strong>Elsa</strong> is supposed to bring relief to developers looking to integrate workflows into their .NET Core or .NET 5 stack.</p><h3>Features</h3><p>Here are some of the features early adopters would be able to integrate with their work (make sure to check for more on <a href="https://github.com/elsa-workflows"><strong>Elsa Github page</strong></a><strong>)</strong>:</p><ul><li>Create <strong>Programmatic</strong> workflows with a neat and clean syntax or use <strong>Designer</strong> and <strong>Dashboard </strong>to manage declarative workflows visually.</li><li><strong>Persistence providers</strong> abstract workflows into <strong>memory</strong>, <strong>JSON files, SQL Light</strong>, <strong>SQL Server</strong>, <strong>MongoDB </strong>or <strong>YesSql </strong>database<strong>.</strong></li><li><strong>Workflow Host REST API</strong> to handle workflows from outside your application</li><li><strong>Long-running Workflows </strong>can span a predefined time while waiting for an event to resume.</li><li><strong>Predefined</strong> <strong>activities (</strong>control flow, timer, HTTP, email) help crafting complex workflows while <strong>custom activities</strong> implement your business logic.</li><li><strong>Javascript </strong>and <strong>Liquid expressions</strong> allows handling <strong>Input</strong> and <strong>Output </strong>variables in a human readable way.</li><li>Elsa’s <strong>modularity</strong> allows for easy integration of components like Designer, Dashboard, or API into your own projects.</li></ul><h3>Elsa 2.0 Designer look and feel</h3><p>The upcoming Elsa 2 Designer look is nicely showcased below by Sipke Schoorstra in a short demonstration. It may be a bit different when ready, but that’s the feeling.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*91eP1dFAkgsjRpJqYMKE4A.gif" /><figcaption>Elsa Workflows 2 Designer showcase by Sipke Schoorstra</figcaption></figure><h3>A code example</h3><p>Below you can see how clean and easy an Elsa declarative workflow is in code behind (the sample is taken from <a href="https://github.com/elsa-workflows/elsa-core/tree/feature/elsa-2.0">Elsa’s 2.0 Feature Github</a> branch). You can see the prerequisites and how the workflow is crafted before being run.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b1bd38f08731a86575d2f7240eea1425/href">https://medium.com/media/b1bd38f08731a86575d2f7240eea1425/href</a></iframe><h3>Resources</h3><ul><li>Spike’s introductory article <a href="https://sipkeschoorstra.medium.com/building-workflow-driven-net-core-applications-with-elsa-139523aa4c50"><strong>Building Workflow Driven .NET Core Applications with Elsa</strong></a>.</li><li><a href="https://elsa-workflows.github.io/"><strong>Elsa official website</strong></a> is the best place to learn about installing the framework and its core concepts.</li><li><a href="https://github.com/elsa-workflows"><strong>Elsa Github page</strong></a> is the second most interesting place to check. It contains the main development branches (including version 2) and useful guides to start playing with.</li><li><a href="https://gitter.im/elsa-workflows/community"><strong>Elsa Gitter</strong></a> forum is another useful resource where you can get your Elsa related questions answered.</li></ul><h3>Summary</h3><p>This short article is supposed to bring Elsa Workflows to the attention of .NET enthusiasts as an alternative to the now old Microsoft Workflows framework. Have fun!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d87da7f0df4a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to host Moleculer in Firebase]]></title>
            <link>https://razvanpredescu.medium.com/how-to-host-moleculer-in-firebase-fd36fa4e91f7?source=rss-4ae1125d86b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/fd36fa4e91f7</guid>
            <category><![CDATA[firebase]]></category>
            <category><![CDATA[moleculer]]></category>
            <dc:creator><![CDATA[Razvan Predescu]]></dc:creator>
            <pubDate>Wed, 27 May 2020 22:35:05 GMT</pubDate>
            <atom:updated>2020-05-28T10:29:13.402Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/980/1*jtYQQWdjyi40ZQ2-Y95wAQ.png" /><figcaption>Moleculer Header courtesy of <a href="https://github.com/moleculerjs/moleculer">MoleculerJs</a></figcaption></figure><p>A tutorial about hosting Moleculer micro-service framework in Firebase</p><h3>Introduction</h3><p>Some time ago I was playing with Moleculer, an interesting progressive micro-services framework for Node.js. For a quick introduction, you can check <a href="https://medium.com/moleculer/moleculer-a-modern-microservices-framework-for-nodejs-bc4065e6b7ba">this tutorial</a> written by <a href="https://medium.com/u/3c856e8b78a4">Icebob</a>, its creator, or discover more visiting the official <a href="https://github.com/moleculerjs/moleculer">Github page</a>.</p><p>At some point, I had a request to host Moleculer in Firebase and although it looked difficult, it proved not to be so hard. The configuration is pretty basic, but it gives you an idea of how to do the job.</p><p><strong>Note:</strong></p><p>During my research of how to make it work, I came upon a video tutorial explaining most of the things in this article, but unfortunately I lost its track. If anyone can point me to the right direction, I would be happy to provide the author with the well deserved credentials.</p><h3>Firebase Initialization</h3><p>You need a Firebase account (<a href="https://firebase.google.com/">sign up for one here</a>) and you must install Firebase CLI on your development machine.</p><pre>npm install -g firebase-tools</pre><p>Create a folder for your project, navigate to it and login to Firebase with:</p><pre>firebase login</pre><p>Then trigger Firebase initialization by running:</p><pre>firebase init</pre><p>Please select both Functions and Hosting during initialization.</p><p>After scaffolding is ready, please navigate to the newly created <strong>functions</strong> folder because it is time to initialize Moleculer.</p><h3>Moleculer Initialization</h3><p>Now it is time to setup Moleculer.</p><p><strong>Note:</strong></p><p>Before doing anything, please rename packages.json from “functions” folder because it will be replaced by Moleculer version and we still need to merge the two.</p><p>You can read <a href="https://medium.com/@rzvdaniel_71068/moleculer-first-project-50d60fd5bc70">Moleculer First Project</a> article to complete this part quickly, with the difference that you need to scaffold the files inside the Firebase “functions” folder created in the previous step. To do this you need to navigate to “functions” and run the following command instead of the way it is shown in the suggested article:</p><pre>moleculer init project .</pre><h3>Firebase Update</h3><p>Normally, you would like to login to Firebase management console and add a new custom domain like api.yourdomain.com to host Moleculer API static files. However, for this article I would just use the default domain Firebase creates for us.</p><p>We need all the above for our next step which is to update the default <strong>.firebaserc</strong> file created for us during scaffolding by Firebase CLI, which should look like below.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1b3b17b86e6c810b9635d73d828b7575/href">https://medium.com/media/1b3b17b86e6c810b9635d73d828b7575/href</a></iframe><p>Where:</p><ul><li>projects -&gt; default -&gt; moleculer-firebase is the <strong>ID of my Firebase project</strong></li><li>hosting- &gt; api -&gt; moleculer-firebase is the <strong>ID of your custom domain</strong> (otr the default domain in this case)</li></ul><p>Next, we need to update firebase.json to something simmilar with below:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6975451dbf4aacc810151ef71b219b84/href">https://medium.com/media/6975451dbf4aacc810151ef71b219b84/href</a></iframe><p>Where:</p><ul><li><strong>target -&gt; api</strong> corresponds to the “hosting -&gt; api” from <strong>.firebaserc</strong>.</li><li><strong>rewrites -&gt; function -&gt; moleculerApi </strong>is the name of a new Firebase function that we would create next (can be anything)</li></ul><p>Next let’s update package.json and add the Firebase entries from the renamed package_.json before. Just add the Firebase entries to their corresponding sections and you should have something like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/31cc4cb6b455dcaf2503ebcf1c3ca583/href">https://medium.com/media/31cc4cb6b455dcaf2503ebcf1c3ca583/href</a></iframe><p>When all done, delete package_.json because we don’t need it anymore.</p><p><strong>Note:</strong></p><p><strong>engines -&gt; node</strong> should be a Firebase supported value like “8” or “10”. Unlike Moleculer, Firebase is more picky about Node.js versions</p><h3>Moleculer Server</h3><p>Now this is the important part that allowed me to run Moleculer in Firebase. There may be better ways, but this is the solution I came with, by using Moleculer’s as middle-ware with Express (check more details on the <a href="https://moleculer.services/docs/0.13/moleculer-web.html#ExpressJS-middleware-usage">official page</a>).</p><p>Add a <strong>server.js</strong> file with the below content in your “functions” folder:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/efce98f5ce7cf8303abf7ab25332743f/href">https://medium.com/media/efce98f5ce7cf8303abf7ab25332743f/href</a></iframe><p>We are loading Moleculer as middle-ware in Express, together with configuration and all the services.</p><h3>Firebase index.js</h3><p>Now it’s time to update the Firebase function. Navigate to index.js in your “functions” folder and update its content to something like below.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/80125c3401f7c06f21ea51727e4f1775/href">https://medium.com/media/80125c3401f7c06f21ea51727e4f1775/href</a></iframe><p>Where:</p><ul><li><strong>moleculerApi </strong>is the function we would create in Firebase</li></ul><p>Now all the requests to the above Firebase function is served by Moleculer!</p><p>Lets test Moleculer API locally by running the following from inside “functions” folder:</p><pre>npm install<br>npm run dev</pre><p>Navigate to <a href="http://localhost:3000/">http://localhost:3000</a> and you should be presented with the Moleculer landing page.</p><p>Now it’s time to see it working in Firebase :)</p><h3>Deploy to Firebase</h3><p>From “functions” folder, please run the following command:</p><pre>firebase deploy</pre><p>The result should look like in the screenshot below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/902/1*W6k9PUk_Y8SeN34ah-GEAA.png" /></figure><p>If you navigate to the resulting Firebase hosting URL (in my case <a href="https://moleculer-firebase.firebaseapp.com/">https://moleculer-firebase.firebaseapp.com</a>), I hope you see Moleculer landing page below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*11d8lrmKJNWdX96p-JrWng.png" /></figure><p>For your convenience, I’ve pushed a Github repository with all the above code.</p><p><a href="https://github.com/rzvdaniel/moleculer-firebase-tutorial">rzvdaniel/moleculer-firebase-tutorial</a></p><p>Yay!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fd36fa4e91f7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Moleculer First Project]]></title>
            <link>https://razvanpredescu.medium.com/moleculer-first-project-50d60fd5bc70?source=rss-4ae1125d86b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/50d60fd5bc70</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[moleculer]]></category>
            <dc:creator><![CDATA[Razvan Predescu]]></dc:creator>
            <pubDate>Mon, 08 Jul 2019 12:39:00 GMT</pubDate>
            <atom:updated>2020-05-27T22:58:08.174Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/980/1*NZkto85Cyh0zedAQsvu9tQ.png" /><figcaption>Moleculer Header courtesy of <a href="https://github.com/moleculerjs/moleculer">MoleculerJs</a></figcaption></figure><p>A simple introduction</p><h3>About Moleculer</h3><p>As you may already know, Moleculer is a new and promising “progressive microservices framework for Node.js” that showcases a structure inspired by Vue.js, the famous JavaScript framework for building front ends. Due to its nice design, it feels very comfortable to architect software around microservices or to create general purpose Node.js restful APIs.</p><p>You can read more about Moleculer concepts in the official documentation.</p><p><a href="https://moleculer.services/docs">What is Moleculer?</a></p><h3>A simple API</h3><p>There are many frameworks that we can use to create API’s in Nodejs, but Moleculer is a kind of new kid on the block (you’ll love its Vue.js inspired architecture).</p><p>Before everything, you need to install Moleculer CLI by running the following command in your favourite console (you would also need <a href="https://nodejs.org/en">Node.js</a>):</p><pre>npm install -g moleculer-cli</pre><p>Now scaffold a Moleculer project (I called it “simple-project”, but feel free to choose whatever name you like) by running:</p><pre>moleculer init project simple-project</pre><p>Scaffolding process will ask you a few questions on the way, and if you don’t know what to choose, have a look at the example below (say <strong>No</strong> to the “Would you like to communicate with other nodes” question if you are at the beginning of your journey):</p><pre>Template repo: moleculerjs/moleculer-template-project<br>? Add API Gateway (moleculer-web) service? <strong>Yes</strong><br>? Would you like to communicate with other nodes? <strong>No</strong><br>? Would you like to use cache? <strong>No</strong><br>? Add Docker files? <strong>No</strong><br>? Use ESLint to lint your code? <strong>No</strong><br>? Setup unit tests with Jest? <strong>No</strong><br>Create &#39;simple-project&#39; folder...<br>? Would you like to run &#39;npm install&#39;? <strong>Yes</strong></pre><p>For simplicity, I kept the project features at minimum, but I expect that for a real-life scenario you’ll be more picky with the options.</p><p>Scaffolding creates a folder called “simple-project” with the content you can see in the screenshot below (Visual Code explorer).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/503/1*gR7SQr5DUO27eN-2j1PTVg.png" /></figure><p>The CLI tool scaffolds a default <strong>greeter.service.js</strong> with two endpoints as you can see in the next Gist.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8d0360241ddbd4e5db324c2f4294590a/href">https://medium.com/media/8d0360241ddbd4e5db324c2f4294590a/href</a></iframe><p>To see it in action, run the following command from within the project’s root folder (and don’t forget to call <strong>npm install </strong>if you haven’t done it yet).</p><pre>npm install // If you haven&#39;t done it at the end of scaffolding<br>npm run dev</pre><p>After Moleculer runner has started the API, access the following two locations from your favourite browser (or from Postman if you wish to have more control over the requests):</p><ul><li><a href="http://localhost:3000/api/greeter/hello">http://localhost:3000/api/greeter/hello</a> (displays “Hello Moleculer” message)</li><li><a href="http://localhost:3000/api/greeter/welcome?name=Razvan">http://localhost:3000/api/greeter/welcome?name=Razvan</a> (displays “Welcome, Razvan”)</li></ul><p>Congratulations, you have just created and launched your first Moleculer restful API.</p><p>You can also check a live version of a basic Moleculer project at Code Sandbox:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodesandbox.io%2Fembed%2F9wl2i&amp;url=https%3A%2F%2Fcodesandbox.io%2Fs%2F9wl2i&amp;image=https%3A%2F%2Fcodesandbox.io%2Fapi%2Fv1%2Fsandboxes%2F9wl2i%2Fscreenshot.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codesandbox" width="1000" height="500" frameborder="0" scrolling="no"><a href="https://medium.com/media/8e7b3b1da713e5d3c3e221536a3f28a0/href">https://medium.com/media/8e7b3b1da713e5d3c3e221536a3f28a0/href</a></iframe><h3>More Tutorials</h3><ol><li><a href="https://medium.com/@rzvdaniel_71068/moleculer-mixins-a-short-introduction-a69f053148f5">Moleculer Mixins</a></li><li><a href="https://medium.com/@rzvdaniel_71068/moleculer-routing-3c6c7cb29ddb">Moleculer Routing</a></li><li><a href="https://medium.com/@rzvdaniel_71068/how-to-host-moleculer-in-firebase-fd36fa4e91f7">How to host Moleculer in Firebase</a></li></ol><p>Another short list of tutorials can be found on the blog maintained by <a href="https://medium.com/@icebob">Icebob</a> (the original author of the framework).</p><p><a href="https://medium.com/moleculer">Moleculer</a></p><p>Enjoy!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=50d60fd5bc70" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Moleculer Routing]]></title>
            <link>https://razvanpredescu.medium.com/moleculer-routing-3c6c7cb29ddb?source=rss-4ae1125d86b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/3c6c7cb29ddb</guid>
            <category><![CDATA[api-gateway]]></category>
            <category><![CDATA[rest-api]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[moleculer]]></category>
            <dc:creator><![CDATA[Razvan Predescu]]></dc:creator>
            <pubDate>Sat, 06 Jul 2019 20:21:35 GMT</pubDate>
            <atom:updated>2019-07-09T13:00:20.576Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/980/1*NZkto85Cyh0zedAQsvu9tQ.png" /><figcaption>Moleculer Header courtesy of <a href="https://github.com/moleculerjs/moleculer">MoleculerJs</a></figcaption></figure><p>A short introduction</p><p>In this article, we will explore a few ways of setting up API service endpoints when using Moleculer API Gateway. If you don’t know what’s Moleculer API Gateway, please check the official website below.</p><p><a href="https://moleculer.services/docs/0.13/moleculer-web.html">API Gateway</a></p><p>Moleculer provides a few ways of defining API routes and depending on each project needs, you would like to choose between the following:</p><ol><li><a href="#89b1">Default Routes</a></li><li><a href="#0b7a">Auto Aliases</a></li><li><a href="#d5ab">RESTful Aliases</a></li><li><a href="#853f">Shorthand RESTful Aliases</a></li></ol><p>You can check a live version of the examples presented in this article in the code sandbox below:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodesandbox.io%2Fembed%2Fgithub%2Fmoleculerjs%2Fsandbox-moleculer-api-routing%2Ftree%2Fmaster%2F%3Fautoresize%3D1%26fontsize%3D14%26hidenavigation%3D1%26view%3Dpreview&amp;url=https%3A%2F%2Fcodesandbox.io%2Fs%2Fgithub%2Fmoleculerjs%2Fsandbox-moleculer-api-routing%2Ftree%2Fmaster%2F%3Fautoresize%3D1%26fontsize%3D14%26hidenavigation%3D1%26view%3Dpreview&amp;image=https%3A%2F%2Fcodesandbox.io%2Fapi%2Fv1%2Fsandboxes%2F6w4pp%2Fscreenshot.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codesandbox" width="1000" height="500" frameborder="0" scrolling="no"><a href="https://medium.com/media/7010df71523cc84196c36836b567441b/href">https://medium.com/media/7010df71523cc84196c36836b567441b/href</a></iframe><h3>1. Default Routes</h3><p>The default routes allow you to write a service API without too many concerns. It uses the <strong>API Base Path</strong> and <strong>Action Names</strong> to expose the endpoints to the outside world.</p><h4>When to use</h4><p>Use this for quick prototypes, and when the methods the API’s resources are accessed isn’t important. With the default configuration, all the endpoints (called Actions in Moleculer) are available to any kind of HTTP requests (like GET, POST, UPDATE, DELETE etc.)</p><h4>How to use</h4><pre>No extra configuration needed.</pre><ul><li><strong>Route configuration</strong></li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9cfd74b7b366d29c96f39c5be3828869/href">https://medium.com/media/9cfd74b7b366d29c96f39c5be3828869/href</a></iframe><ul><li><strong>Greeter service</strong></li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/766cf319119a7c86aa27cf357d3da6cf/href">https://medium.com/media/766cf319119a7c86aa27cf357d3da6cf/href</a></iframe><ul><li><strong>Route examples</strong></li></ul><pre><strong>GET  </strong>/simple/hello<br><strong>POST </strong>/simple/hello<br><strong>GET  </strong>/simple/welcome?name=Razvan<br><strong>POST </strong>/simple/welcome<br>Body { &quot;name&quot;: &quot;Razvan&quot; }</pre><h3>2. Auto Aliases</h3><p>This is one of the most powerful and interesting ways of creating RESTful APIs with Moleculer. Auto-aliases generator feature provides services with full flexibility to define a REST interface.</p><h4>When to use</h4><p>With Auto-Aliases, all the routes are specified inside services themselves, and this is great when you need to keep the services as loosely coupled as possible.</p><h4>How to use</h4><pre>// Auto generate aliases<br>autoAliases: true</pre><ul><li><strong>Route configuration</strong></li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/39a122461a1b69358462220f9ca2cf87/href">https://medium.com/media/39a122461a1b69358462220f9ca2cf87/href</a></iframe><ul><li><strong>Users Service</strong></li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4c9f9f721190667204adf2a78ba5e218/href">https://medium.com/media/4c9f9f721190667204adf2a78ba5e218/href</a></iframe><ul><li><strong>Route Examples</strong></li></ul><pre><strong>GET </strong>/autoalias/users<br><strong>POST </strong>/autoalias/users<br>Body { &quot;name&quot;: &quot;Razvan Predescu&quot; }<br><strong>GET </strong>/autoalias/users/11<br><strong>PUT </strong>/autoalias/users/11<br>Body { &quot;name&quot;: &quot;Razvan Daniel Predescu&quot; }<br><strong>DELETE </strong>/autoalias/users/11</pre><h3>3. RESTful Aliases</h3><p>This is a variation of the Auto Aliases method above. The difference is that we define the route aliases into the API configuration, instead of services.</p><h4>When to use</h4><p>Use this configuration to create classic RESTful APIs when defining routes outside the services themselves is a better fit.</p><h4>How to use</h4><pre>// RESTful aliases<br>aliases: {<br>  &quot;GET articles&quot;: &quot;articles.list&quot;,<br>  &quot;GET articles/:id&quot;: &quot;articles.get&quot;,<br>  &quot;POST articles&quot;: &quot;articles.create&quot;,<br>  &quot;PUT articles/:id&quot;: &quot;articles.update&quot;,<br>  &quot;DELETE articles/:id&quot;: &quot;articles.remove&quot;<br>}</pre><ul><li><strong>Route configuration</strong></li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cf9267e88e5bebbd190725b92c899ced/href">https://medium.com/media/cf9267e88e5bebbd190725b92c899ced/href</a></iframe><ul><li><strong>Articles Service</strong></li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cc0e42d0b5f17ecc5ecec16a2473b0c2/href">https://medium.com/media/cc0e42d0b5f17ecc5ecec16a2473b0c2/href</a></iframe><ul><li><strong>Route Examples</strong></li></ul><pre><strong>GET </strong>/rest/articles<br><strong>POST </strong>/rest/articles<br>Body { &quot;title&quot;: &quot;New article via REST&quot; }<br><strong>GET </strong>/rest/articles/11<br><strong>PUT </strong>/rest/articles/11<br>Body { &quot;title&quot;: &quot;Modified article title&quot; }<br><strong>DELETE </strong>/rest/articles/11</pre><h3>4. Shorthand RESTful Aliases</h3><p>This is a variation of the RESTful Aliases method above. The difference is that instead of defining each route alias, we tell the API to generate all the routes for us.</p><h4>When to use</h4><p>Use this method to create classic RESTful APIs while writing minimum configuration into the API service.</p><h4>How to use</h4><pre>// Shorthand RESTful aliases<br>aliases: {<br>  &quot;REST articles&quot;: &quot;articles&quot;<br>}</pre><ul><li><strong>Route configuration</strong></li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4eeb24dc15a983bde519d05d4aaa45a2/href">https://medium.com/media/4eeb24dc15a983bde519d05d4aaa45a2/href</a></iframe><ul><li><strong>Articles Service</strong></li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cc0e42d0b5f17ecc5ecec16a2473b0c2/href">https://medium.com/media/cc0e42d0b5f17ecc5ecec16a2473b0c2/href</a></iframe><ul><li><strong>Route Examples</strong></li></ul><pre><strong>GET </strong>/shortrest/articles<br><strong>POST </strong>/shortrest/articles<br>Body { &quot;title&quot;: &quot;New article via REST&quot; }<br><strong>GET </strong>/shortrest/articles/11<br><strong>PUT </strong>/shortrest/articles/11<br>Body { &quot;title&quot;: &quot;Modified article title&quot; }<br><strong>DELETE </strong>/shortrest/articles/11</pre><h3>Summary</h3><p>In this article, we covered a few ways of defining API service endpoints in Moleculer. Choose the most appropriate that makes sense for your projects and don’t be shy to even mix them together as multiple route definitions within the same API configuration are allowed.</p><p>Please check the official Moleculer documentation, and discover all the features this beautiful framework provides.</p><p>Best!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3c6c7cb29ddb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Moleculer Mixins]]></title>
            <link>https://razvanpredescu.medium.com/moleculer-mixins-a-short-introduction-a69f053148f5?source=rss-4ae1125d86b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/a69f053148f5</guid>
            <category><![CDATA[mixin]]></category>
            <category><![CDATA[moleculer]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Razvan Predescu]]></dc:creator>
            <pubDate>Fri, 26 Apr 2019 17:54:22 GMT</pubDate>
            <atom:updated>2019-07-09T12:44:08.649Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/980/1*NZkto85Cyh0zedAQsvu9tQ.png" /><figcaption>Moleculer Header courtesy of <a href="https://github.com/moleculerjs/moleculer">MoleculerJs</a></figcaption></figure><p>A short introduction.</p><h3>Mixins are a form of code reusability</h3><p>Reusability is an important aspect of software development, and it takes different shapes, depending on the context. In this article, we will learn Moleculer’s way of reusing code through mixins.</p><p>From the official documentation:</p><blockquote>“Mixins are a flexible way to distribute reusable functionalities for Moleculer services. The Service constructor merges these mixins with the current schema. It is to extend another service to your service. When a service uses mixins, all properties in the mixin will be “mixed” into the current service.</blockquote><p><a href="https://moleculer.services/docs/0.13/services.html#Mixins">https://moleculer.services/docs/0.13/services.html#Mixins</a></p><h3>Before Mixins</h3><p>Before creating Mixins, you need to scaffold a basic Moleculer API as described in a previous tutorial here:</p><p><a href="https://medium.com/@rzvdaniel_71068/moleculer-first-project-50d60fd5bc70">Moleculer First Project</a></p><h3>A new Hello World service</h3><p>After scaffolding a Moleculer project as described above, let&#39;s create a new service which we will reuse later as an internal Mixin (as opposed to an external one that can be imported from an npm package).</p><p>Name the new service <strong>world.service.js</strong> and write a helloWorld() action that displays the famous <em>“Hello World” </em>message. Add the file to the same folder as the previously generated <strong>greetings.service.js</strong>.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5c53d308cc0e4053262cf68aa074ec07/href">https://medium.com/media/5c53d308cc0e4053262cf68aa074ec07/href</a></iframe><p>Now you can access the World’s endpoint like this:</p><ul><li><a href="http://localhost:3000/api/world/helloWorld">http://localhost:3000/api/world/helloWorld</a> (will display a “Hello World” message)</li></ul><h3>The Mixin</h3><p>We would now include <strong>World </strong>service’s<strong> </strong>functionality within the default <strong>Greeter </strong>service<em> </em>with the following two lines of code:</p><pre>// Import the World service<br>const WorldService = require(&quot;./world.service&quot;);<br>...<br>// Add the World service as a mixin<br>mixins: [WorldService]</pre><p>Here is how the updated <strong>Greeter </strong>service looks:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3d42ae8f2924691ee3642a515fb9b4e1/href">https://medium.com/media/3d42ae8f2924691ee3642a515fb9b4e1/href</a></iframe><p>Because mixins work as a kind of inheritance, we would now be able to access the <strong>World</strong>’s <em>helloWorld</em> endpoint from within the <strong>Greeter </strong>service itself.</p><ul><li><a href="http://localhost:3000/api/greeter/helloWorld">http://localhost:3000/api/greeter/helloWorld</a> (will display a “Hello World” message)</li></ul><p>This doesn’t look like adding too much value to our project because we could already access <em>helloWorld</em> from within <strong>World </strong>service itself, but it makes sense if you import the functionality from npm packages instead.</p><p>The advantage in using Mixins to share functionality within the same project is that <strong>Greeter </strong>service will take advantage of almost any of the <strong>World</strong>’s features like settings, dependencies, hooks, metadata, events, and methods.</p><p>Another example of Mixins value is when using moleculer-db related library for persistence and database operations. The most popular way of using moleculer-db functionality in Moleculer projects is through mixins. Check this SandBox for a live example:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodesandbox.io%2Fembed%2Fgithub%2Fmoleculerjs%2Fsandbox-moleculer-db&amp;url=https%3A%2F%2Fcodesandbox.io%2Fs%2Fgithub%2Fmoleculerjs%2Fsandbox-moleculer-db&amp;image=https%3A%2F%2Fcodesandbox.io%2Fapi%2Fv1%2Fsandboxes%2Fu9zo3%2Fscreenshot.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codesandbox" width="1000" height="500" frameborder="0" scrolling="no"><a href="https://medium.com/media/25c7a5b1d5260cb4c5601bdd6e38beb3/href">https://medium.com/media/25c7a5b1d5260cb4c5601bdd6e38beb3/href</a></iframe><p>Here are more details about how Mixin functionality is merging services: <a href="https://moleculer.services/docs/0.13/services.html#Merge-algorithm">https://moleculer.services/docs/0.13/services.html#Merge-algorithm</a>.</p><p>As a simple example, notice that you can now also use <strong>World</strong>’s service <em>sayHelloWorld</em> method within <strong>Greeter </strong>service itself anywhere you wish.</p><pre>/**<br>* Service created lifecycle event handler<br>*/<br>created() {<br>    // sayHelloWorld() is a World&#39;s service method which is called   // from Greeter service<br>    console.log(this.sayHelloWorld());<br>}</pre><h3>Conclusion</h3><p>The Mixin functionality is a valuable way to inherit and share functionality within Moleculer projects. It is more powerful than just reusing Javascript modules because it uses a convention based merging mechanism that empowers the beautiful structure of Moleculer services.</p><p>Check out the full source code for this tutorial from Github and don’t forget to leave any kind of feedback ’cause I want to learn from you too :).</p><p>Best!</p><p><a href="https://github.com/rzvdaniel/MoleculerMixinsTutorial">rzvdaniel/MoleculerMixinsTutorial</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a69f053148f5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Customize Visual Studio Code for Multiple Fonts and styles.]]></title>
            <link>https://razvanpredescu.medium.com/customize-visual-studio-code-for-multiple-fonts-and-styles-96f83562af58?source=rss-4ae1125d86b5------2</link>
            <guid isPermaLink="false">https://medium.com/p/96f83562af58</guid>
            <category><![CDATA[css]]></category>
            <category><![CDATA[html]]></category>
            <category><![CDATA[visual-studio-code]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Razvan Predescu]]></dc:creator>
            <pubDate>Sun, 11 Feb 2018 20:26:27 GMT</pubDate>
            <atom:updated>2018-04-20T10:26:42.980Z</atom:updated>
            <content:encoded><![CDATA[<p>How I made it work :)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/701/1*XZog5jntWrEDxbA1irnQ9A.png" /></figure><p>A few days ago I came upon an interesting article showcasing a mix of Operator Mono &amp; Fira Code usage in Atom. For Atom users, here it is:</p><p><a href="https://medium.com/@peterpme/operator-mono-fira-code-the-best-of-both-worlds-191be512fd5e">Operator Mono &amp; Fira Code — The Best of Both Worlds</a></p><p>Operator Mono font is a beautifully designed font, with nice font ligatures (for enthusiasts), perfect for any IDE. If you afford, go for it.</p><p>Because I’m a Visual Studio Code fan, I was looking for a way to bring something similar, like multiple fonts, including a cursive one, in my favourite IDE.</p><p>After a little web search, I found an article describing what you have to do in order to activate multiple fonts in VSCode:</p><p><a href="https://medium.com/@zamamohammed/multiple-fonts-alternative-to-operator-mono-in-vscode-7745b52120a0">Multiple Fonts: Alternative to Operator Mono in VSCode</a></p><p>After following the steps, it still did not work. The problem was that newer VSCode versions are using other style names for HTML elements, CSS styles and Javascript keywords, different from the ones described in the article.</p><p>So I searched more and I found a gist that solved the problem, but I encountered the same kind of issues the author (<a href="https://gist.github.com/nickytonline">Nick Taylor</a>) was trying to solve: VSCode style names being updated in the newer version. Here is his gist:</p><p><a href="https://gist.github.com/nickytonline/8086319bf5836797ee3dea802a77000d#file-customizing-vs-code-md">https://gist.github.com/nickytonline/8086319bf5836797ee3dea802a77000d#file-customizing-vs-code-md</a></p><p>So how can you check if the style names being used in the tutorial are still correct in your VSCode version? The answer was at the end of the<em> “Multiple Fonts: Alternative to Operator Mono in VSCode”</em> tutorial.</p><h3>Developer Tools</h3><p>Because VS Code is build using <a href="https://github.com/electron/electron">Electron</a>, we have access to <a href="https://developer.chrome.com/devtools">Chrome DevTools window</a> (the same as in Google Chrome browser). Use <em>Help &gt; Toggle Developer Tools</em> to toggle it on and off.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/927/1*wOkVgFFoK2Ig8YaEhXnVlQ.png" /></figure><p>As you can see in the screenshot above, using selection tool for the <em>new </em>keyword show us that it’s using .mtk7 style, one of the styles missing from Nicky’s gist above. For new VS Code versions, those are the ones you have to modify to apply your own customization.</p><p>If newer versions of VS Code stop rendering your preferred font or another attribute, open DevTools and check if the style name has changed.</p><h3>How I have made it work</h3><ol><li>Install vscode-custom-css extension from<br><a href="https://github.com/be5invis/vscode-custom-css/blob/master/README.md">https://github.com/be5invis/vscode-custom-css/blob/master/README.md</a>. Without it, the statement “vscode_custom_css.imports” is not recognized as a valid one inside your personalized user settings.</li><li>Make sure vscode-custom-css is enabled after installation<br>(use CTRL + SHIFT + P and then type “Enable Custom CSS and JS” as documented on their official page).</li><li>Make sure you have installed your preferred font (Brush Script MT in my case).</li><li>Copy the Styles.css from <a href="https://gist.github.com/rzvdaniel/02ed409eb2f09ac80fbb230b170c66ce#file-styles-css">my fork</a> of Nick Taylor’s gist to the Desktop (works with VS Code version 1.20.0).</li><li>Make sure the path to the Styles.css in your User Settings looks like this one (for Windows version of VSCode):<br><em>“vscode_custom_css.imports”: [“file://C:/Users/daniel/Desktop/styles.css”]</em></li><li>Restart VS Code.</li><li>For any Styles.css update you have to eventually Disable and Enable vscode-custom-css extension with:</li></ol><ul><li>CTRL + SHIFT + P</li><li>Type “Disable Custom CSS and JS”</li><li>Restart VSCode</li><li>Type “Enable Custom CSS and JS”</li><li>Restart VSCode</li></ul><p>If the second font is still not working:</p><ul><li>Navigate to Help -&gt; Toggle Developer Tools in VS Code.</li><li>Use Select Inspector to highlight the keywords you wish to render using the new font and see what is their style (same as you do it in Chrome).</li><li>Add the new style names (if any) in the custom Styles.css.<br>For the version of VS Code that I’m using, I had to add .mtk7 style to make it work with the additional font.</li></ul><h3>Why investing such amount of effort in these styles? Because…</h3><blockquote>“It turns out that style matters in programming for the same reason that it matters in writing. It makes for better reading.” — Douglas Crockford</blockquote><p>Enjoy your IDE. :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=96f83562af58" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>