<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: J.Cho</title>
    <description>The latest articles on DEV Community by J.Cho (@weezer924).</description>
    <link>https://dev.to/weezer924</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F155811%2F584aedd0-1d8d-4f80-80bd-d883bf3504f0.jpeg</url>
      <title>DEV Community: J.Cho</title>
      <link>https://dev.to/weezer924</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/weezer924"/>
    <language>en</language>
    <item>
      <title>Why I left App Engine for Cloud Run</title>
      <dc:creator>J.Cho</dc:creator>
      <pubDate>Thu, 25 Apr 2019 12:50:25 +0000</pubDate>
      <link>https://dev.to/weezer924/why-i-left-app-engine-for-cloud-run-mem</link>
      <guid>https://dev.to/weezer924/why-i-left-app-engine-for-cloud-run-mem</guid>
      <description>&lt;p&gt;Google App Engine is one of my favorite service of GCP.&lt;br&gt;
It makes my application easy to deploy and don't need to worry about the server load.It works well with my Angular/Vue.js SPA applications.&lt;/p&gt;

&lt;p&gt;Then I took an error in the knee...&lt;/p&gt;

&lt;p&gt;Sorry, I mean I took an error in my App Engine Service.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Error: EROFS: read-only file system, mkdir '/srv/sessions' at Object.mkdirSync (fs.js:752:3) at Object.mkdirsSync 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;read-only file system ?!?! &lt;br&gt;
All I just want using node-persist. For some small cache files...&lt;br&gt;
Why're you doing this to me !&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Ftj35fcpg6hldgpt1glh3.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Ftj35fcpg6hldgpt1glh3.gif"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here is the reason from App Engine Documents:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;In App Engine, the local filesystem that your application is deployed to is not writeable. This behavior ensures the security and scalability of your application.&lt;/p&gt;

&lt;p&gt;However, if the application needs to write and read files at runtime, App Engine provides a built-in Google Cloud Storage stream wrapper that allows you to use many of the standard PHP filesystem functions to read and write files in an App Engine PHP app.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;1.I'm not a PHPer, and using Google Cloud Storage for just some cache files? NaN...&lt;/p&gt;

&lt;p&gt;2.My program works well, I don't want to change it.(Like using Cloud Storage)&lt;/p&gt;

&lt;p&gt;3.Using Google Computer Engine and setup server from zero? Who wants to care about the server load? &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F2n04wmsg456fbeyet24v.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F2n04wmsg456fbeyet24v.jpg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then I found a way that it worth to try!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Frd9ytckmzcuaowynkbas.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Frd9ytckmzcuaowynkbas.jpg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Cloud Run is a managed compute platform that enables you to run stateless containers that are invocable via HTTP requests. Cloud Run is serverless: it abstracts away all infrastructure management, so you can focus on what matters most — building great applications. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Humm, This is what I want.&lt;br&gt;
Put my application into a container. Then upload it to Cloud Run.&lt;br&gt;
It will take care of my container offer flexibility and portability of workloads.&lt;/p&gt;

&lt;p&gt;Allright! Let's hack.&lt;/p&gt;

&lt;p&gt;1.Create a docker file.I'm using nuxt.js&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight docker"&gt;&lt;code&gt;&lt;span class="k"&gt;FROM&lt;/span&gt;&lt;span class="s"&gt; node:10&lt;/span&gt;

&lt;span class="k"&gt;WORKDIR&lt;/span&gt;&lt;span class="s"&gt; /usr/src/app&lt;/span&gt;

&lt;span class="k"&gt;ENV&lt;/span&gt;&lt;span class="s"&gt; PORT 8080&lt;/span&gt;
&lt;span class="k"&gt;ENV&lt;/span&gt;&lt;span class="s"&gt; HOST 0.0.0.0&lt;/span&gt;

&lt;span class="k"&gt;COPY&lt;/span&gt;&lt;span class="s"&gt; package*.json ./&lt;/span&gt;

&lt;span class="k"&gt;RUN &lt;/span&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;--only&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;production

&lt;span class="k"&gt;COPY&lt;/span&gt;&lt;span class="s"&gt; . .&lt;/span&gt;

&lt;span class="k"&gt;RUN &lt;/span&gt;npm run build
&lt;span class="k"&gt;CMD&lt;/span&gt;&lt;span class="s"&gt; npm start&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2.build docker image from dockerfile.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt; docker build ./  &lt;span class="nt"&gt;-t&lt;/span&gt;  gcr.io/project-name/image-name:1.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;3.Push the image to your GCP container registry&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker push gcr.io/project-name/image-name:1.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;4.If success It will look like this.(Sorry for the japanese)&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fpdtwu3cg6gdpmyzoxpw3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fpdtwu3cg6gdpmyzoxpw3.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;5.Click it, select 「create a service at cloud run」. A few mins, your container will run at GCP.&lt;/p&gt;

&lt;p&gt;Okey,&lt;br&gt;
My Cache files works! All my program run as well as my local.&lt;br&gt;
And using container to build micro-services is a good feature.&lt;/p&gt;

&lt;p&gt;So, I will say good-bye to the GAE?&lt;/p&gt;

&lt;p&gt;Well, GAE is still a very good service for All the time. Like SPA, You can pay more attention at your front-end.&lt;/p&gt;

&lt;p&gt;Cloud Run just give me another choice. &lt;br&gt;
To understand what you need. Then you can decide which you need to use.&lt;/p&gt;

</description>
      <category>vue</category>
      <category>nuxt</category>
      <category>gcp</category>
      <category>docker</category>
    </item>
    <item>
      <title>Using Atomic Design with Nuxt.js and have a great hacking time. </title>
      <dc:creator>J.Cho</dc:creator>
      <pubDate>Tue, 16 Apr 2019 14:34:31 +0000</pubDate>
      <link>https://dev.to/weezer924/using-atomic-design-with-nuxt-js-and-have-a-great-hacking-time-3lc5</link>
      <guid>https://dev.to/weezer924/using-atomic-design-with-nuxt-js-and-have-a-great-hacking-time-3lc5</guid>
      <description>&lt;p&gt;This is my first time write a english post.&lt;br&gt;
I'm a web application developer working in Japan.And yes, I'm a Chinese.XD&lt;/p&gt;
&lt;h2&gt;
  
  
  What I used in this project
&lt;/h2&gt;

&lt;p&gt;Nuxt.js v2.0&lt;br&gt;
Express v4.0&lt;br&gt;
bootstrap-vue v4.0&lt;/p&gt;
&lt;h2&gt;
  
  
  What is Atomic Design
&lt;/h2&gt;

&lt;p&gt;In case you don't know what is Atomic Design.&lt;br&gt;
Here are some good documents about it.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://atomicdesign.bradfrost.com/"&gt;http://atomicdesign.bradfrost.com/&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.indetail.co.jp/blog/10234/"&gt;https://www.indetail.co.jp/blog/10234/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;TL;Dr: It's a design system to show you how to create your UI component exactly you need to use.&lt;/p&gt;
&lt;h2&gt;
  
  
  How To Separate Your Folder
&lt;/h2&gt;

&lt;p&gt;components&lt;br&gt;
|&lt;br&gt;
|---- atoms&lt;br&gt;
|------ |---Album.vue&lt;br&gt;
|------ |---BackBtn.vue&lt;br&gt;
|---- molecules &lt;br&gt;
|------ |---AlbumList.vue&lt;br&gt;
|---- organisms&lt;br&gt;
|------ |---AlbumBook.vue&lt;br&gt;
|---- page&lt;br&gt;
|------ |---AlbumBooks.vue&lt;/p&gt;
&lt;h2&gt;
  
  
  Atoms Samples
&lt;/h2&gt;

&lt;p&gt;The smallest UI component in your project.&lt;br&gt;
Like this. Just a nuxt-lint, div and img.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;template&amp;gt;
  &amp;lt;div&amp;gt;
    &amp;lt;nuxt-link to="/album"&amp;gt;
      &amp;lt;img class="album-image" :src="album.coverUrl" /&amp;gt;
    &amp;lt;/nuxt-link&amp;gt;
    &amp;lt;div&amp;gt;
      {{ album.title }}
    &amp;lt;/div&amp;gt;
  &amp;lt;/div&amp;gt;
&amp;lt;/template&amp;gt;

&amp;lt;script&amp;gt;
export default {
  props: {
    album: {
      type: Object,
      required: true,
      default: null
    }
  }
}
&amp;lt;/script&amp;gt;

&amp;lt;style scoped&amp;gt;  &amp;lt;-- Use scoped to make the css only in this component
.album-image {
  height: 175px;
  width: 175px;
  object-fit: cover;
  border-radius: 10px;
  margin: 1px;
}
&amp;lt;/style&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2&gt;
  
  
  molecules
&lt;/h2&gt;

&lt;p&gt;contain some atoms&lt;br&gt;
In my case, I make it to be a array of the atoms&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;template&amp;gt;
  &amp;lt;b-row&amp;gt;
    &amp;lt;b-col v-for="album in albums" :key="album.id"&amp;gt;
      &amp;lt;Album :album="album"&amp;gt;&amp;lt;/Album&amp;gt;  &amp;lt;!-- use props in atom to receive the data --&amp;gt;
    &amp;lt;/b-col&amp;gt;
  &amp;lt;/b-row&amp;gt;
&amp;lt;/template&amp;gt;

&amp;lt;script&amp;gt;
import Album from '~/components/atoms/Album.vue'  //  import the atom file

export default {
  components: {
    Album // This is the atom componet
  },

  props: {
    data: {
      type: Object,
      required: true,
      default: () =&amp;gt; null
    }
  }
}
&amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2&gt;
  
  
  organisms
&lt;/h2&gt;

&lt;p&gt;combine different molecules&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;template&amp;gt;
  &amp;lt;section&amp;gt;
    &amp;lt;nav class="navbar navbar-light bg-light"&amp;gt;
      &amp;lt;BackBtn path="/activity"&amp;gt;&amp;lt;/BackBtn&amp;gt;  &amp;lt;--- You can use atom aslo
    &amp;lt;/nav&amp;gt;
    &amp;lt;div class="container-fluid"&amp;gt;
      &amp;lt;AlbumList :data="albums"&amp;gt;&amp;lt;/AlbumList&amp;gt;  
      &amp;lt;CommentList :comments="comments"&amp;gt;&amp;lt;/CommentList&amp;gt;
    &amp;lt;/div&amp;gt;
  &amp;lt;/section&amp;gt;
&amp;lt;/template&amp;gt;

&amp;lt;script&amp;gt;
import BackBtn from '~/components/atoms/BackBtn.vue'
import CommentList from '~/components/molecules/CommentList.vue'
import AlbumList from '~/components/molecules/AlbumList.vue'

export default { 
  components: {
    BackBtn, 
    CommentList, // different molecules
    AlbumList    // some molecules
  }
  data() {
    comments: [
       ... // 
    ]
  },
  computed: {
    albums() {
      return this.$store.state.albums // Using Vuex with Atomic Design is aslo a great idea, you can get your data in different ways.In your atom or your molecules.
    }
  },
}
&amp;lt;/script&amp;gt;

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2&gt;
  
  
  Page
&lt;/h2&gt;

&lt;p&gt;Finally, The page.&lt;br&gt;
Make sure your page using less code you need.&lt;br&gt;
If your page is larger you should think about to separate into small things like atom.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;template&amp;gt;
  &amp;lt;section&amp;gt;
    &amp;lt;AlbumBook&amp;gt;&amp;lt;/AlbumBook&amp;gt;
  &amp;lt;/section&amp;gt;
&amp;lt;/template&amp;gt;

&amp;lt;script&amp;gt;
import AlbumBook from '~/components/organisms/AlbumBook.vue'

export default {
  components: {
    AlbumBook
  }
}
&amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2&gt;
  
  
  At Last
&lt;/h2&gt;

&lt;p&gt;Separate your files, decide which component should be smaller. Maybe is the most challenge thing in your project.&lt;br&gt;
But once you get to the point. you'll get the benefit from it. &lt;br&gt;
Especially in your early development stage.&lt;/p&gt;

&lt;p&gt;1.Every time you want to change your component. You don't need to change them all.Just in one file.Any other your page import that file can be changed.&lt;/p&gt;

&lt;p&gt;2.Easy for management.Less code you need, Less bugs.&lt;/p&gt;

&lt;p&gt;P.S:&lt;br&gt;
This post is what I wrote in my Qiita.(A Japanese Tech blog)&lt;br&gt;
&lt;a href="https://qiita.com/jakushin/items/e8b19f6a2c7bcd037573"&gt;https://qiita.com/jakushin/items/e8b19f6a2c7bcd037573&lt;/a&gt;&lt;/p&gt;

</description>
      <category>vue</category>
      <category>nuxt</category>
      <category>javascript</category>
      <category>frontend</category>
    </item>
  </channel>
</rss>
