<?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[MEAN Fire - Medium]]></title>
        <description><![CDATA[Angular, Firebase and Node with Nrwl Extensions. - Medium]]></description>
        <link>https://medium.com/mean-fire?source=rss----30f27c929e14---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>MEAN Fire - Medium</title>
            <link>https://medium.com/mean-fire?source=rss----30f27c929e14---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 01:55:52 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/mean-fire" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Express Application on Firebase Hosting]]></title>
            <link>https://medium.com/mean-fire/express-application-on-firebase-hosting-5baa8914835f?source=rss----30f27c929e14---4</link>
            <guid isPermaLink="false">https://medium.com/p/5baa8914835f</guid>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[firebasehosting]]></category>
            <category><![CDATA[firebase-cloud-functions]]></category>
            <category><![CDATA[firebase]]></category>
            <category><![CDATA[typescript]]></category>
            <dc:creator><![CDATA[Damian Bielecki]]></dc:creator>
            <pubDate>Thu, 27 Jun 2019 19:13:15 GMT</pubDate>
            <atom:updated>2019-07-07T11:03:26.633Z</atom:updated>
            <content:encoded><![CDATA[<p>This is a short followup to <a href="https://medium.com/mean-fire/nx-nrwl-firebase-functions-98f96f514055">Nx Nrwl Firebase Function</a> article. It explains how to setup Firebase Hosting and Functions to host Node Application that serves an Angular App on Firebase Hosting.</p><h4>Setting firebase.json</h4><p>Edit firebase.json:</p><pre>{<br>  ...<br>  },<br>  &quot;hosting&quot;: {<br>    &quot;public&quot;: &quot;dist/apps/web-app&quot;,<br>    &quot;ignore&quot;: [&quot;firebase.json&quot;, &quot;**/.*&quot;, &quot;**/node_modules/**&quot;],<br>    &quot;rewrites&quot;: [<br>      {<br>        &quot;source&quot;: &quot;**&quot;,<br>        &quot;function&quot;: &quot;server&quot;<br>      }<br>    ]<br>  }<br>}</pre><ul><li>public — it is a path to your compiled angular application</li><li>rewrites — it tells to redirect all request to Firebase Function called “server”</li></ul><h4>Setting package.json</h4><p>Modify package.json script:</p><pre>&quot;firebase:serve&quot;: &quot;concurrently --kill-others \&quot;yarn run build functions --watch\&quot; \&quot;firebase serve --only functions,hosting\&quot;&quot;,</pre><h4>Setting functions</h4><p>In the Firebase Functions main file ( apps/function/src/main.ts) add:</p><pre><em>import </em>* <em>as </em>express <em>from </em>&#39;express&#39;;<br><em>import </em>* <em>as </em>functions <em>from </em>&#39;firebase-functions&#39;;<br><em>import </em>* <em>as </em>path <em>from </em>&#39;path&#39;;<br><br><em>const </em>app = express();<br>app.use(express.<em>static</em>(&#39;/../web-app&#39;));<br>app.get(&#39;*&#39;, (req, res) =&gt; res.sendFile(path.join(__dirname, &#39;/../web-app/index.html&#39;)));<br><br><em>export const </em>server = functions.https.onRequest(app);</pre><h3>Summary</h3><p>This covers simple scenario of having Node application serve Angular app. David may provide a more detailed explanation in <a href="https://www.youtube.com/watch?v=LOeioOKUKI8">this video</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5baa8914835f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/mean-fire/express-application-on-firebase-hosting-5baa8914835f">Express Application on Firebase Hosting</a> was originally published in <a href="https://medium.com/mean-fire">MEAN Fire</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Nx Nrwl Ionic]]></title>
            <link>https://medium.com/mean-fire/nx-nrwl-ionic-1baf3a43db74?source=rss----30f27c929e14---4</link>
            <guid isPermaLink="false">https://medium.com/p/1baf3a43db74</guid>
            <category><![CDATA[ionic]]></category>
            <category><![CDATA[nrwl]]></category>
            <category><![CDATA[angular]]></category>
            <dc:creator><![CDATA[Damian Bielecki]]></dc:creator>
            <pubDate>Wed, 01 May 2019 14:58:09 GMT</pubDate>
            <atom:updated>2019-05-18T10:25:30.130Z</atom:updated>
            <content:encoded><![CDATA[<p>In this post I will explain how to setup Ionic App in Nrwl Workspace. It is easier than it may seem.</p><h3>Initialise Ionic</h3><p>Make sure you have ionic CLI installed yarn global add ionic.</p><pre>ionic init --type=angular<br><br>ng g app ionic-app --style=scss --unit-test-runner=jest --e2e-test-runner=cypress --routing --prefix=app<br><br>yarn add @ionic-native/core @ionic-native/http @ionic-native/splash-screen @ionic-native/status-bar @ionic/angular<br>yarn add @ionic/angular-toolkit -D</pre><p>This will install required dependencies and create an angular app that we will replace with ionic implementation.</p><p>Changes introduced in <a href="https://github.com/Bielik20/nx-mean-starter/commit/aacbfa66dbd6465a0e0087fe6dcccd1b805619c3">this commit</a> cover that:</p><ul><li>replaces default app generated by angular with one produced with ionic start</li><li>modifies angular.json to reflect one from ionic start</li><li>modifies tslint.json to allow components with “Page” suffix</li></ul><h3>Add Capacitor</h3><pre>yarn add @capacitor/cli @capacitor/core<br>npm run build --prod ionic-app</pre><p>Now initialise app with “app name” and “bundle id”:</p><pre>npx cap init &lt;name&gt; &lt;id&gt;</pre><p>You can read more about Bundle Identifiers in <a href="https://cocoacasts.com/what-are-app-ids-and-bundle-identifiers/">here</a>. For me it is:</p><pre>npx cap init &quot;Nx MEAN Starter&quot; bielik.nx.mean.starter</pre><p>Now edit capacitor.config.json so that value of webDir field equals dist/apps/ionic-app. It tells capacitor where to look for compiled app.</p><h4>Add iOS</h4><pre>npx cap add ios<br>npx cap sync<br>npx cap open ios</pre><p>Then in Xcode go to general -&gt; signing -&gt; team and choose team.</p><h4>Run new version of app on iOS simulator</h4><pre>npm run build --prod ionic-app<br>npx cap sync<br>npx cap open ios</pre><p>Then choose desired device and click run.</p><h3>Summary</h3><p>That is all there is to it. Source code for this can be found in <a href="https://github.com/Bielik20/nx-mean-starter">here</a>. However it is actively developed so if you want to review THIS version, checkout <a href="https://github.com/Bielik20/nx-mean-starter/tree/93850e2733c4eeeb40eb85b3921eb08e76fccf69">this commit</a>.</p><h4>Appendix: Fixing specs</h4><p>If you encounter beloved bug SyntaxError: Unexpected token import while running tests you can fix that by applying <a href="https://stackoverflow.com/a/56198039/4746094">my answer from stack-overflow</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1baf3a43db74" width="1" height="1" alt=""><hr><p><a href="https://medium.com/mean-fire/nx-nrwl-ionic-1baf3a43db74">Nx Nrwl Ionic</a> was originally published in <a href="https://medium.com/mean-fire">MEAN Fire</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Nx Nrwl Firebase Functions]]></title>
            <link>https://medium.com/mean-fire/nx-nrwl-firebase-functions-98f96f514055?source=rss----30f27c929e14---4</link>
            <guid isPermaLink="false">https://medium.com/p/98f96f514055</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[firebase-cloud-functions]]></category>
            <category><![CDATA[nrwl-nx]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[firebase]]></category>
            <dc:creator><![CDATA[Damian Bielecki]]></dc:creator>
            <pubDate>Thu, 21 Feb 2019 17:13:10 GMT</pubDate>
            <atom:updated>2020-02-10T07:31:07.551Z</atom:updated>
            <content:encoded><![CDATA[<p>Since Nrwl released its <a href="https://blog.nrwl.io/building-full-stack-applications-using-angular-cli-and-nx-5eff205248f1">support</a> for node applications I was looking forward to similar support for Firebase Functions. I have even created an <a href="https://github.com/nrwl/nx/issues/836">issue on GitHub</a> for that. At the time of writing it is still open, that’s why I have decided to create my own solution.</p><h3>The problem</h3><p>When you initialise Firebase Functions withfirebase init it creates functions subdirectory with its own package.json and node_modules. That is not good. We want to share code with functions and manage it using Nx.</p><h3>Goal</h3><ul><li>Firebase Functions exist as a node app</li><li>There is only one package.json and node_modules</li><li>Functions can use shared code fromlibs</li></ul><h3>Prerequisites</h3><p>We assume you have a working Nrwl Project with Angular application. It is also recommended that you have Firebase account and understand what Firebase Functions are.</p><h3>Solution</h3><h4>Setup Firebase</h4><p>If you haven’t already, install firebase-tools and login:</p><pre>yarn global add firebase-tools<br>firebase login</pre><p>Also add .firebaserc in the root dir to make it a Firebase project:</p><pre>{<br>  &quot;projects&quot;: {<br>    &quot;default&quot;: &quot;your-firebase-project-name&quot;<br>  }<br>}</pre><h4>Generate node-app</h4><p>As stated in goal, Functions are to be based on node-app. To do so, create node-app named “functions”:</p><pre>ng add @nrwl/node # Adds Node capabilities<br>ng g @nrwl/node:application functions</pre><h4>Configure Firebase Functions</h4><p>Install Firebase Functions dependencies</p><pre>yarn add firebase firebase-admin firebase-functions</pre><p>Replace contents of apps/functions/src/main.ts with:</p><pre>import * as functions from &#39;firebase-functions&#39;;<br><br>// // Start writing Firebase Functions<br>// // https://firebase.google.com/docs/functions/typescript<br>//<br>export const helloWorld = functions.https.onRequest((request, response) =&gt; {<br>  response.send(&#39;Hello from Firebase!&#39;);<br>});</pre><p>Above snippet is what Firebase generates when using firebase init.</p><p>To setup Firebase Functions so that they are understood create firebase.json in the root directory:</p><pre>{<br>  &quot;functions&quot;: {<br>    &quot;predeploy&quot;: [<br>      &quot;yarn lint functions&quot;,<br>      &quot;yarn build functions --prod&quot;<br>    ],<br>    &quot;source&quot;: &quot;/&quot;<br>  }<br>}</pre><ul><li>predeploy just defines what is fired when you issue command firebase deploy --only functions. In this case it will run linter and production build for our “functions” project.</li><li>source points to the root of the project. Since we have only one package.json and it is in the root directory it needs to point there.</li></ul><p>In package.json add following:</p><pre>&quot;main&quot;: &quot;dist/apps/functions/main.js&quot;,<br>&quot;engines&quot;: {<br>  &quot;node&quot;: &quot;10&quot;<br>},</pre><ul><li>main is required so that Firebase knows what to start after deployment. I have created a feature request to move it to firebase.json but at the time of writing it needs to be there.</li><li>engine is telling Firebase on which node version it should be run. At the time of writing node v10 is the newest supported. Also you CANNOT specify yarn or npm version in here because it will conflict with firebase.</li></ul><h3>Usage</h3><p>Serving Firebase Functions is a little more complicated than typical node app. Add this dev dependancy:</p><pre>yarn add concurrently -D</pre><p>And these scripts to package.json:</p><pre>&quot;firebase:serve&quot;: &quot;concurrently --kill-others \&quot;yarn run build functions --watch\&quot; \&quot;firebase serve --only functions\&quot;&quot;,<br>&quot;firebase:shell&quot;: &quot;concurrently --kill-others \&quot;yarn run build functions --watch\&quot; \&quot;firebase functions:shell\&quot; --raw&quot;,<br>&quot;firebase:deploy&quot;: &quot;firebase deploy&quot;,</pre><ul><li>yarn firebase:serve - run functions locally</li><li>yarn firebase:shell - run functions shell locally</li><li>yarn firebase:deploy --only functions - deploy functions</li></ul><h4>Explanation</h4><p>At the time of writing firebase serve serves functions only from dist directory. To make it work we use concurrently to run build with watch flag, and serve “concurrently”.</p><h3>Summary</h3><p>This pretty much covers it. Easy and elegant way to incorporate Firebase Functions into Nx project. Source code for this can be found in <a href="https://github.com/Bielik20/nx-mean-starter">here</a>. However it is actively developed so if you want to review THIS version, checkout <a href="https://github.com/Bielik20/nx-mean-starter/tree/40d1441166f1d6203129dc81283b7c9b1b489980">this commit</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=98f96f514055" width="1" height="1" alt=""><hr><p><a href="https://medium.com/mean-fire/nx-nrwl-firebase-functions-98f96f514055">Nx Nrwl Firebase Functions</a> was originally published in <a href="https://medium.com/mean-fire">MEAN Fire</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>