<?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>Forem: BeCode</title>
    <description>The latest articles on Forem by BeCode (@becodeorg).</description>
    <link>https://forem.com/becodeorg</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%2Forganization%2Fprofile_image%2F1675%2F3e6f1228-27eb-47af-a6ce-b4cd0854f8ac.png</url>
      <title>Forem: BeCode</title>
      <link>https://forem.com/becodeorg</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/becodeorg"/>
    <language>en</language>
    <item>
      <title>You should never use sudo (while coding)!</title>
      <dc:creator>Leny</dc:creator>
      <pubDate>Tue, 14 Jan 2020 13:49:02 +0000</pubDate>
      <link>https://forem.com/becodeorg/you-should-never-use-sudo-while-coding-4fa0</link>
      <guid>https://forem.com/becodeorg/you-should-never-use-sudo-while-coding-4fa0</guid>
      <description>&lt;p&gt;Yeah, I know, &lt;em&gt;bold move&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;As a coder, I read a lot of &lt;em&gt;great&lt;/em&gt; articles on DEV, Medium, &lt;em&gt;any-other-place on the internet&lt;/em&gt;. Those articles are filled with commands to type to "solve problem" (cargo cult, yeay!).&lt;/p&gt;

&lt;p&gt;As a bootcamp coach, I see a lot of my learners typing those commands &lt;em&gt;"because you know, it can't be worse"&lt;/em&gt; (cargo cult, yeay!).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/SWdRKrNVg8YVz1w3EF/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/SWdRKrNVg8YVz1w3EF/giphy.gif" alt="Cargo cult, yeah!"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And most of those commands begin with &lt;code&gt;sudo&lt;/code&gt;. Or, worse, I often hear this: "it didn't work without &lt;code&gt;sudo&lt;/code&gt;, so... let's try to add it".&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%2Fi.imgflip.com%2F3m2qr4.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%2Fi.imgflip.com%2F3m2qr4.jpg" alt="that damned sudo"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It's &lt;strong&gt;never&lt;/strong&gt; a good idea. Like, never, never.&lt;/p&gt;

&lt;p&gt;I will focus on two common missuses of sudo when coding that you should avoid (and are easy to fix).&lt;/p&gt;

&lt;h2&gt;
  
  
  Usecase one: npm (&lt;code&gt;npm install -g any-global-package&lt;/code&gt;)
&lt;/h2&gt;

&lt;p&gt;Most of those packages don't need the admin rights. But, by default, your system try to write the global npm package into a folder that requires admin right to be written. So... &lt;code&gt;sudo&lt;/code&gt; it is. NO!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/d10dMmzqCYqQ0/giphy-downsized.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/d10dMmzqCYqQ0/giphy-downsized.gif" alt="NO!"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You're lucky, you have two solutions for that. &lt;/p&gt;

&lt;p&gt;The first one is to use &lt;a href="https://www.npmjs.com/package/npx" rel="noopener noreferrer"&gt;&lt;code&gt;npx&lt;/code&gt;&lt;/a&gt;, which will download and add to cache the latest version of the tool you need and then execute it. No need for admin rights. &lt;strong&gt;BONUS MOVE&lt;/strong&gt;, &lt;code&gt;npx&lt;/code&gt; will firstly look inside the current project and use the local version of the tool if it's installed. Damn, I love npx (thanks, &lt;a href="https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f7d4bd282b" rel="noopener noreferrer"&gt;Kat Marchán&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;The second one, but you &lt;em&gt;should&lt;/em&gt; use npx, is to indicate to npm to store the global package in your home folder. Just &lt;a href="https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally#manually-change-npms-default-directory" rel="noopener noreferrer"&gt;follow the steps in this article&lt;/a&gt;, and you will never need to type &lt;code&gt;sudo&lt;/code&gt; before an &lt;code&gt;npm install -g&lt;/code&gt; command.&lt;/p&gt;

&lt;h2&gt;
  
  
  Usecase two: docker (&lt;code&gt;docker run --way --too --many --options wonderful-image&lt;/code&gt;)
&lt;/h2&gt;

&lt;p&gt;I know, docker is all about &lt;em&gt;isolating&lt;/em&gt; things. And it's great. And since it's so great, why should we give it admin rights? You don't need to.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/4TcVFG7EYvp3Yvbu9j/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/4TcVFG7EYvp3Yvbu9j/giphy.gif" alt="You don't need this"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When you install docker, the best way to try if your install is right, is to use this command:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker run hello-world
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;And then it didn't work, and you type &lt;code&gt;sudo docker run hello-world&lt;/code&gt;, and you're happy. And somewhere, someone kills a baby koala. And you should be ashamed.&lt;br&gt;&lt;br&gt;
Because you know what? It's in the &lt;em&gt;freakin'&lt;/em&gt; documentation! You know, the stuff we didn't read?! (Yeah, me too).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/vX9WcCiWwUF7G/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/vX9WcCiWwUF7G/giphy.gif" alt="We all should be ashamed"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the install procedure of docker, they ask you to type this command:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo usermod -a -G docker $USER
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This adds your user in the docker group, allowing you to use the docker command without admin rights. Which is, yeah... right what we wanted.&lt;/p&gt;




&lt;p&gt;It's two simple examples. And I know, I shouldn't be &lt;del&gt;&lt;em&gt;so melodramatic&lt;/em&gt;&lt;/del&gt; &lt;em&gt;such a diva&lt;/em&gt;. But, hey, I do what I want, and you shouldn't use sudo on daily basis.&lt;/p&gt;

&lt;p&gt;Except if you are really sure of what you're doing. &lt;/p&gt;

&lt;p&gt;It's probably the only thing you need to remember from this article:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If you don't know why you need &lt;code&gt;sudo&lt;/code&gt; to run a command... don't do it. Or do it, break stuffs, learn things. YOLO!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/SWjCswum5dc0E/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/SWjCswum5dc0E/giphy.gif" alt="YOLOOOO!"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>sudo</category>
      <category>admin</category>
      <category>shame</category>
    </item>
    <item>
      <title>Gamifying a coding bootcamp: the BeCode LUX</title>
      <dc:creator>Alexandre Plennevaux</dc:creator>
      <pubDate>Mon, 16 Dec 2019 20:16:25 +0000</pubDate>
      <link>https://forem.com/becodeorg/gamifying-a-coding-bootcamp-the-becode-lux-86l</link>
      <guid>https://forem.com/becodeorg/gamifying-a-coding-bootcamp-the-becode-lux-86l</guid>
      <description>&lt;p&gt;Learning to code is fun (most of the time). Learning to code with the added goal of &lt;strong&gt;landing a first job as a Junior Developer&lt;/strong&gt; after just 7 months of training can be daunting. Gamification is a great way to build self-confidence through this intensive learning period.&lt;/p&gt;

&lt;p&gt;At &lt;a href="https://becode.org/" rel="noopener noreferrer"&gt;BeCode&lt;/a&gt; (the largest network of inclusive coding bootcamps in Belgium), we may have found a way to both gamify our trainings and improve the job marketability of our learners at the same time.&lt;/p&gt;

&lt;p&gt;It did not happen overnight. All the pieces fell into place recently, while working on our latest advanced training: DevSecOps. This article explains how we gradually came to design &lt;strong&gt;the BeCode Learning User Experience&lt;/strong&gt; (or LUX, as in &lt;em&gt;Light&lt;/em&gt; in Latin).&lt;/p&gt;

&lt;h2&gt;
  
  
  The bits and pieces of our gamification system
&lt;/h2&gt;

&lt;p&gt;Here is more or less chronologically how the pieces started stacking up, through good old trial and error and iterations over almost 3 years.&lt;/p&gt;

&lt;h3&gt;
  
  
  0. The ground floor
&lt;/h3&gt;

&lt;p&gt;When we launched BeCode in 2017 we did not want to create just another school. We wanted learning to be fun, collective, positive, healing. We wanted to surround our learners with the comfort, structure, autonomy and kindness needed to dare take risks and embrace failure. After all, learning is about searching and experimenting "until it works". Inspired by &lt;a href="https://simplon.co/" rel="noopener noreferrer"&gt;Simplon&lt;/a&gt; (a huge network of inclusive coding bootcamps in France), we replaced the teachers by coaches and chose active learning techniques, where the learner is in charge and controls its learning experience. We unleashed the beast in 2017 and since then, boy have we experimented. &lt;/p&gt;

&lt;h3&gt;
  
  
  1. Project-based learning
&lt;/h3&gt;

&lt;p&gt;We organize project-based learning using two types of challenges:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Learning challenges&lt;/strong&gt; are great to explore, try, experiment. They usually involve a lot of googling, discussing and sharing, trying and failing... When the deadline is reached, what sits on the learner's hard drive is most probably buggy, dirty, dysfunctioning, or completely broken. But they have learned.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Consolidation challenges&lt;/strong&gt; come after a few learning challenges to re-invest what has been learned/ explored previously. This type of challenges focuses on the quality of result. It can be used to assess whether the target skills involved in the challenge have reached a professional level.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can find more about our project-based approach on this Slide Deck &lt;a href="https://docs.google.com/presentation/d/e/2PACX-1vQ0d_TigUjz27UZ9RUgXpbZa1EJ9IB_hmMSEQuVoX0gN4i_DR7vgX-ZpesaAfawjy5tXy-WIPthEbLe/pub?start=false&amp;amp;loop=false&amp;amp;delayms=3000" rel="noopener noreferrer"&gt;BeCode LUX: the Learning User Experience&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Informal learning is hard to certify
&lt;/h3&gt;

&lt;p&gt;BeCode basically provides the conditions of learning. Trainers do not teach but stimulate learning via group dynamics, individual coaching, instilling into the group a "failing forward" approach to mistakes and of course, real-life challenges. According to &lt;a href="https://www.coe.int/en/web/lang-migrants/formal-non-formal-and-informal-learning" rel="noopener noreferrer"&gt;European education administration&lt;/a&gt;, the type of learning we offer sits somewhere between &lt;strong&gt;experiential and non-formal learning&lt;/strong&gt;, which by definition happens while working on real-life projects. There are no clear, unified certification system for that. And that’s okay… until you need to reassure companies that you are worth being hired, with no diploma to show for it. This has been an ongoing question for us to solve: how to certify skills in a non-formal learning environment ?&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Open Badges FTW!
&lt;/h3&gt;

&lt;p&gt;In the meanwhile, and pretty much since the first day of the first training, we have been playing around with the &lt;a href="https://openbadges.org/" rel="noopener noreferrer"&gt;Open Badges&lt;/a&gt; technology. It's important for the learner's self-confidence to receive gratifications for their achievements, big or small. Positive reinforcement is key to learning and badges felt like a good way to do that.&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%2Fuhhxv71tpevuxozhnu2g.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%2Fuhhxv71tpevuxozhnu2g.gif" alt="Have a badge, you earned it!"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We started creating and granting badges for every technology we use during the training.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. How to assess Tech Skills ?
&lt;/h3&gt;

&lt;p&gt;The point of these challenges is to grow the skills enabling the learner to enter the job market, bringing value to companies.&lt;/p&gt;

&lt;p&gt;Of course, various degrees of craftsmanship are possible. Again, we need something as simple as possible and easy to understand to maximise adoption by everyone - learners and companies. Through various iterations, we came up with this 4-level grid:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Level 0: Skill is non-existent&lt;/li&gt;
&lt;li&gt;  Level 1: Skill has been explored - the candidate has interest and motivation to grow the skill.&lt;/li&gt;
&lt;li&gt;  Level 2: The candidate has been able to use that skill on a professional level.&lt;/li&gt;
&lt;li&gt;  Level 3: The candidate has acquired enough knowledge and experience and has the teaching skills required to be able to train people on that technical skill&lt;/li&gt;
&lt;li&gt;  Level 4: The candidate has contributed to the technology source code, aka "Godmode" - it is of course very rare that someone reach that level. We consider this level to be the ceiling.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Practically it means that learners having finished a learning challenge and shown genuine interest and motivation could claim the Technology’s level 1 badge. When finishing a consolidation challenge, they could get the technology’s level 2 badge. If they give a hands-on workshop on the technology, they could claim to have reached level 3. If Linus Torvald ever comes to BeCode (you never know…) we would grant him Linux’s Level 4 badge. (I'm sure he'd be thrilled!)&lt;/p&gt;

&lt;p&gt;From a business point of view, a level 1 badge certifies that the candidate has "some exploratory" knowledge and is interested to master that skill but is not autonomous yet nor able to use the technology in a real-life professional scenario - some senior mentoring would be required.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. LinkedIn &amp;lt;3 open badges !
&lt;/h3&gt;

&lt;p&gt;An important benefit of Open Badges is the fact that they can be embedded on the Learner's LinkedIn profile (&lt;a href="https://medium.com/becode/sharing-open-badges-on-linkedin-2cddb05e0aa7" rel="noopener noreferrer"&gt;here is how&lt;/a&gt;). The potential employer, reviewing the profile, can click on the badges and check what it means and more importantly, how it was obtained. In that regard, open badges are much more transparent than diplomas and classic certificates. &lt;/p&gt;

&lt;p&gt;They are also very relevant: since every learner is different, the set of badges acquired can more closely represent the strengths of each profile. This is a great way to improve the marketability of our learners and move beyond the "informal" aspect of their training, indeed giving it a recognizable form.&lt;/p&gt;

&lt;h3&gt;
  
  
  6. Soft skills badges
&lt;/h3&gt;

&lt;p&gt;In the summer of 2019, we undertook an important work synthesizing what soft skills we can observe (and thus certify) during the seven months of the bootcamps. Through a couple of co-creation workshops involving smart people from various disciplines (management, previous learners, trainers, marketing people and an external HR expert) we came up with a vocabulary of &lt;a href="https://docs.google.com/presentation/d/e/2PACX-1vQiIr7nHbiK-XyPvHUoic6XZyNs2fr1nGhf71EmrbXY1uCUuwIni3bKQIrC2IaWNbzXoHFc0d7v_ljZ/pub?start=false&amp;amp;loop=false&amp;amp;delayms=5000&amp;amp;slide=id.g4dfce81f19_0_45" rel="noopener noreferrer"&gt;10 Soft Skills badges&lt;/a&gt; that enable everyone at BeCode speak the same language about the behaviours expected in a professional environment.&lt;/p&gt;

&lt;p&gt;When we introduced the soft skill badges to the learners and fellow trainers from Simplon (our French partner), it brought a lot of enthusiasm as it gamifies the acquisition of soft skills, whereas soft skill training is usually experienced as "condescending" and is generally a hard to tame beast, since it is so subjective. Unwillingly, we had created the embryo of a gamification system.&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%2Fx7kk0vn12mxoj7ac02mt.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%2Fx7kk0vn12mxoj7ac02mt.png" alt="The Four Soft skills required to be certified"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  7. Career paths
&lt;/h3&gt;

&lt;p&gt;Ultimately, badges are a mean to an end: finding a job, starting a career path.&lt;/p&gt;

&lt;p&gt;Well, in essence, &lt;em&gt;a career path is a set of tech skills and soft skills to acquire.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;If we can describe a career path through the necessary combination of level 1-4 badges, we have a clear way to describe to the learner what path they need to take to achieve their goals. That's exactly what we did, involving company experts in the process of content creation.&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%2Fjh4uq887e5r81n1zbp6y.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%2Fjh4uq887e5r81n1zbp6y.png" alt="Careers described in skills"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To certify that a learner has acquired all the required badges, we need another badge, representing the career: we called them "meta badges". Here is an example of the Secure Developer metabadge, and the badges necessary to earn it.&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%2Fo5hbsjecevr6a0rvrigs.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%2Fo5hbsjecevr6a0rvrigs.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion: the LUX
&lt;/h3&gt;

&lt;p&gt;The gamification of the Learning User Experience at BeCode essentially means acquiring skills through challenges, deciding which career path to pursue and when learning goals are achieved, certifying them using open badges. The goal of the game is by the end of the training to obtain the meta badge corresponding to the learner's desired career path. That badge certifies that the learner has the soft and technical skills required to enter the job market in that career, and with enough self-confidence to grow into the position autonomously.&lt;/p&gt;

&lt;p&gt;What are the next steps ? Our next trainings will implement it from the starting day. It will be a real life pilot from which I expect to discover a lot of opportunities for improvement. We also need to update our Junior Web Developer training to match this structured gamification approach.&lt;/p&gt;

&lt;p&gt;Also, I am eager to see how “open minded” will companies be about these badges as a way to assess a candidate’s skills. They make a lot of sense to us, trainers, but time will tell if it is actually effective in “landing that first job in IT” – the hardest one.  &lt;/p&gt;

</description>
      <category>becode</category>
      <category>openbadges</category>
      <category>bootcamp</category>
      <category>gamification</category>
    </item>
    <item>
      <title>Introducing Oto, the man in the middle.</title>
      <dc:creator>Leny</dc:creator>
      <pubDate>Sat, 12 Oct 2019 21:37:12 +0000</pubDate>
      <link>https://forem.com/becodeorg/introducing-oto-the-man-in-the-middle-52go</link>
      <guid>https://forem.com/becodeorg/introducing-oto-the-man-in-the-middle-52go</guid>
      <description>&lt;p&gt;☝️ &lt;strong&gt;NOTE:&lt;/strong&gt; this article is an &lt;em&gt;revised&lt;/em&gt; version of one of my &lt;a href="https://medium.com/becode/introducing-oto-the-man-in-the-middle-581311962a6d"&gt;previous article&lt;/a&gt; on Medium.&lt;/p&gt;




&lt;p&gt;As a developer, I love to use APIs.&lt;br&gt;&lt;br&gt;
Moreover, I love to use others’ APIs, and integrate them in my apps.&lt;br&gt;&lt;br&gt;
Like getting stuffs from GitHub, LinkedIN, allowing my users to see their data in my tools.&lt;/p&gt;

&lt;p&gt;But I don’t want to ask my users their credentials for these services (and they wouldn’t probably give them!).&lt;br&gt;&lt;br&gt;
So, I have to use the &lt;strong&gt;OAuth2&lt;/strong&gt; protocol.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;OAuth2&lt;/strong&gt; is a tool used by services to allow third-party apps’ developers (like me! I’m a third-party developer! &lt;em&gt;Woot!&lt;/em&gt;) to access the services’ data of users, with their approval.&lt;/p&gt;

&lt;p&gt;I will not describe OAuth2 in depth, but here’s the big picture: when you create an app, you need to register it on the service you want to use the API.&lt;br&gt;&lt;br&gt;
They will give you two important things: a public access id, which is not secret and can be stored in your code ; and a private access key, which is, huh, secret, and can’t be shared.&lt;br&gt;&lt;br&gt;
When one of your user needs to use the API in your app, they will be redirected on a login page outside your site, on the original service (the login page of GitHub, for instance). The user log himself, and the service redirect him on your app, with a unique code.&lt;br&gt;&lt;br&gt;
Then, your app will contact the service, with the unique code, your public access id and your private access key. The service know that everything’s okay, and will respond you with a token, that you will use for any request to the API.&lt;/p&gt;

&lt;p&gt;And that’s all. It sounds complicated, but it’s quite easy.&lt;/p&gt;




&lt;p&gt;But there’s a small problem: OAuth2 is not really designed to be used on &lt;em&gt;client-side only&lt;/em&gt; apps, like SPA.&lt;br&gt;&lt;br&gt;
As I said, the &lt;em&gt;private access key&lt;/em&gt; needs to stay… huh, &lt;em&gt;private&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;So… we need a server. But we don’t really &lt;em&gt;want&lt;/em&gt; one, since we would like to have static apps.&lt;br&gt;&lt;br&gt;
That’s a tough one.&lt;/p&gt;

&lt;p&gt;But what if I told you we can have a server… &lt;em&gt;without&lt;/em&gt; a server?&lt;br&gt;&lt;br&gt;
We can use a &lt;em&gt;serverless platform&lt;/em&gt;, like &lt;strong&gt;AWS Lambda&lt;/strong&gt;: it’s basically a simple piece of code (a function), bound to an URL, that will be executed when the URL is touched. Simple as &lt;em&gt;f*%&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;And then, we can have a small piece of code that will know our &lt;em&gt;private access key&lt;/em&gt; for OAuth2, and will make the last step of the challenge.&lt;br&gt;
Let me introduce you &lt;a href="https://github.com/becodeorg/oto"&gt;oto&lt;/a&gt;, the man in the middle, the little piece of code to run that.&lt;/p&gt;

&lt;p&gt;For now, it supports GitHub &amp;amp; LinkedIn, but I will add more services in the future.&lt;br&gt;
You can run it locally, or simple use the &lt;a href="https://serverless.com/"&gt;serverless framework&lt;/a&gt; to deploy it on your AWS account.&lt;br&gt;&lt;br&gt;
And, last but not least, its able to handle multiple services and keys at once, simplifying your workflow!&lt;/p&gt;

</description>
      <category>oauth</category>
      <category>spa</category>
      <category>becode</category>
      <category>authentication</category>
    </item>
    <item>
      <title>Collecting squares together!</title>
      <dc:creator>Leny</dc:creator>
      <pubDate>Thu, 12 Sep 2019 06:11:17 +0000</pubDate>
      <link>https://forem.com/becodeorg/collecting-squares-together-updated-4l22</link>
      <guid>https://forem.com/becodeorg/collecting-squares-together-updated-4l22</guid>
      <description>&lt;p&gt;☝️ &lt;strong&gt;NOTE:&lt;/strong&gt; this article is an &lt;em&gt;updated version&lt;/em&gt; of &lt;a href="https://medium.com/becode/collecting-squares-together-cc3177a65c86"&gt;one of my previous article on Medium&lt;/a&gt;, augmented with some updates. Also my first post on &lt;strong&gt;dev.to&lt;/strong&gt;!&lt;/p&gt;




&lt;p&gt;I love &lt;em&gt;gamification&lt;/em&gt;. Really. Collecting achievement just for the sake of it, as any rpg-player.&lt;br&gt;
It’s why I really love the &lt;em&gt;green squares&lt;/em&gt; of the &lt;em&gt;contribution graph&lt;/em&gt; on GitHub profiles.&lt;/p&gt;

&lt;p&gt;But the green squares are personal by essence: it’s &lt;em&gt;your&lt;/em&gt; commits, &lt;em&gt;your&lt;/em&gt; activity on GitHub. There’s no data for teams or organisation.&lt;br&gt;&lt;br&gt;
At BeCode, &lt;a href="https://www.youtube.com/watch?v=pGFGD5pj03M"&gt;we work as a team, we live as a team&lt;/a&gt;. Everything we do, we do as a team!&lt;/p&gt;

&lt;p&gt;It’s why I wanted to create a &lt;em&gt;contribution graph&lt;/em&gt; with informations of all the &lt;em&gt;BeCodians&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Using green squares felt a bit &lt;em&gt;wrong&lt;/em&gt;, so I use the blue tones of BeCode’s identity, and created &lt;a href="https://kareble.becode.xyz"&gt;Kareble&lt;/a&gt;.&lt;/p&gt;


&lt;h2&gt;
  
  
  Fetching the data
&lt;/h2&gt;

&lt;p&gt;I already known about the &lt;a href="https://developer.github.com/v4/"&gt;GraphQL API&lt;/a&gt; of GitHub &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Did I tell you that I really love &lt;a href="https://graphql.org/"&gt;GraphQL&lt;/a&gt;? I love GraphQL. So much. For real. It’s the future, &lt;em&gt;deal with it&lt;/em&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;But unfortunately, the information are deeply hidden in all the data that GitHub serves. And fetching all the data I needed is very slow, so I can’t do it in real time.&lt;br&gt;&lt;br&gt;
The idea is to create a script to fetch the data, and running it once a week.&lt;/p&gt;

&lt;p&gt;After some tests, I ended with this graphql query:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;It gives me all the contributions from the last year, by weeks, for 25 users of our organization. Then, I created a &lt;a href="https://github.com/becodeorg/kareble/blob/master/scripts/fetch-data.js"&gt;small script&lt;/a&gt; to fetch the data of all our users, 10 at a time (I don't care about the time it takes, it's all automated on a CI, will talk about it later).&lt;br&gt;&lt;br&gt;
The script also assemble and clean the data, then set the color of each day, regarding of the quantity of contributions.&lt;br&gt;&lt;br&gt;
It finally writes all the data in a JSON that will be used by our website.&lt;/p&gt;

&lt;p&gt;At the time of the redaction (september 2019), the script fetches the data in 74 batches of 10 users, performing all its tasks in about 2min 30s.&lt;/p&gt;


&lt;h2&gt;
  
  
  Displaying the data
&lt;/h2&gt;

&lt;p&gt;For this little project, I wanted to change my habits.&lt;br&gt;&lt;br&gt;
I could have done it with &lt;strong&gt;React&lt;/strong&gt; or &lt;strong&gt;VueJS&lt;/strong&gt;, but I wanted to use this project as a good pretext to test and discover something I never used before.&lt;/p&gt;

&lt;p&gt;My choice went on &lt;a href="https://svelte.dev"&gt;Svelte&lt;/a&gt;. The version 3 was quite new when I started working on kareble and some podcasters I listen made very &lt;a href="https://shoptalkshow.com/episodes/349/"&gt;enthusiastic&lt;/a&gt; &lt;a href="https://spec.fm/podcasts/toolsday/293076"&gt;episodes&lt;/a&gt; about it.&lt;/p&gt;

&lt;p&gt;Svelte is a very great tool, similar to React or VueJS (working with components), but also quite different - the creator of Svelte describe it as a &lt;em&gt;disappearing framework&lt;/em&gt;: when compiled, the code doesn’t need to include a runtime like React or Vue.&lt;br&gt;&lt;br&gt;
Svelte is also constructed around HTML: you defined components by their markup (svelte components are like small HTML fragments), and a small chunk of scripts to operate with them.&lt;/p&gt;

&lt;p&gt;Svelte is really fast and easy to use, and for small projects, it’s a very good surprise.&lt;/p&gt;

&lt;p&gt;The coding part was really straightforward, you can dig around the code &lt;a href="https://github.com/becodeorg/kareble"&gt;on the repository&lt;/a&gt;.&lt;br&gt;&lt;br&gt;
If you’ve already played with a modern front-end framework like React, you’ll see that Svelte is really easy to understand.&lt;/p&gt;


&lt;h2&gt;
  
  
  Build &amp;amp; deploy
&lt;/h2&gt;

&lt;p&gt;Compiling Svelte is really easy, thanks to &lt;a href="http://rollupjs.org"&gt;rollup&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;To host and deploy, since we can’t fetch the data in real time, we can host the website on any static platform, like &lt;strong&gt;netlify&lt;/strong&gt; or &lt;strong&gt;github-pages&lt;/strong&gt;. For Kareble, I use github-pages.&lt;/p&gt;

&lt;p&gt;At the moment of releasing Kareble, the only missing part was &lt;strong&gt;automation&lt;/strong&gt; - I needed to run three npm scripts to fetch, build and deploy the website each week. A strange &lt;em&gt;sunday morning routine&lt;/em&gt;, but, hey... 😋&lt;/p&gt;

&lt;p&gt;I really wanted to use &lt;a href="https://github.com/features/actions"&gt;GitHub Actions&lt;/a&gt;, which I was testing in beta on my personal GitHub account, but didn't had the beta access on the BeCode organisation... until this september.&lt;/p&gt;

&lt;p&gt;With the newly introduced syntax, I came out with this workflow:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;Thanks to the &lt;em&gt;cron syntax&lt;/em&gt;, this runs every sunday at 8am (while I &lt;em&gt;hope&lt;/em&gt; my son let me sleep a little longer), prepare a node environment, install dependencies (the &lt;a href="https://docs.npmjs.com/cli/ci.html"&gt;&lt;code&gt;npm ci&lt;/code&gt;&lt;/a&gt; is a better/faster &lt;code&gt;npm install&lt;/code&gt; alternative in this case), then publish the result of the build on the &lt;code&gt;gh-pages&lt;/code&gt; branch.&lt;/p&gt;




&lt;p&gt;It was a really nice and fun little project to code.&lt;/p&gt;

&lt;p&gt;You can see the result on &lt;a href="https://kareble.becode.xyz"&gt;kareble.becode.xyz&lt;/a&gt;, and dig in the code on the &lt;a href="https://github.com/becodeorg/kareble"&gt;GitHub repository&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>graphql</category>
      <category>github</category>
      <category>svelte</category>
      <category>becode</category>
    </item>
    <item>
      <title>Automate deployment using GitHub hooks</title>
      <dc:creator>Alexandre Plennevaux</dc:creator>
      <pubDate>Tue, 13 Aug 2019 15:08:29 +0000</pubDate>
      <link>https://forem.com/becodeorg/deploy-an-application-automatically-using-github-hooks-50fd</link>
      <guid>https://forem.com/becodeorg/deploy-an-application-automatically-using-github-hooks-50fd</guid>
      <description>&lt;p&gt;The first time I witnessed the cleverness of the &lt;em&gt;deployment using git&lt;/em&gt; strategy was with GitHub Pages: simply &lt;code&gt;git push&lt;/code&gt; to the master branch of your repository and your static web page is updated. As simple as that.&lt;/p&gt;

&lt;p&gt;I wanted to be able to deploy with the same elegance on my own servers and for more complex applications. I thought I understood how it worked but not how to automate it. So I would manually &lt;code&gt;ssh&lt;/code&gt; into the server, &lt;code&gt;cd&lt;/code&gt; my way into the project folder, then &lt;code&gt;git pull&lt;/code&gt;. Every. time. Not really convenient.&lt;/p&gt;

&lt;p&gt;When I discovered &lt;a href="//htts://roots.io/trellis"&gt;Trellis&lt;/a&gt; I learned to use ansible  to be able to deploy by using a oneliner: &lt;code&gt;./deploy.sh production domain.com&lt;/code&gt;)...&lt;/p&gt;

&lt;p&gt;But then Ansible is a power tool, which does a lot of other things than just deploy. And I learned the hard way that I should not update my local Ansible version otherwise... All hell break loose. &lt;br&gt;
Also, I would still have to &lt;code&gt;git push&lt;/code&gt; to the remote prior to launching the deployment.&lt;/p&gt;
&lt;h2&gt;
  
  
  One line to rule them all
&lt;/h2&gt;

&lt;p&gt;Working at &lt;a href="https://becode.org"&gt;BeCode&lt;/a&gt; is cool because you get to meet dozen of fellow developers, craving to learn and explore. One of our learners pointed me in the direction of using a GitHub Post-Receive hook, thanks to which deployment is a simple : &lt;code&gt;git push production master&lt;/code&gt;. The hook launches a local script that &lt;code&gt;git checkout&lt;/code&gt; the master branch on the production server, then runs any other custom operations you want (such as &lt;code&gt;composer update&lt;/code&gt; for example).&lt;/p&gt;

&lt;p&gt;Let's see how to set it up.&lt;/p&gt;
&lt;h3&gt;
  
  
  1. Setup a bare Git repository on production server
&lt;/h3&gt;

&lt;p&gt;First, create a "bare" repository – one that does not contain the working copy files. It basically is the content of the .git repository folder in a normal working copy. Name it whatever you like (you could also omit the .git part from project.git but I find it best to keep it):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; /path/to/project/folder/
&lt;span class="nb"&gt;mkdir &lt;/span&gt;project-name.git
&lt;span class="nb"&gt;cd &lt;/span&gt;project-name.git
git init &lt;span class="nt"&gt;--bare&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h3&gt;
  
  
  2. Configure the GitHub hook
&lt;/h3&gt;

&lt;p&gt;Create a post-receive hook at &lt;code&gt;/path/to/project/folder/project-name.git/hooks/post-receive&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;touch &lt;/span&gt;hooks/post-receive
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Fill it with your version of the following code (use your specific folder paths) :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;#!/bin/sh&lt;/span&gt;
&lt;span class="nv"&gt;NOW&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;date&lt;/span&gt; +&lt;span class="s1"&gt;'%d-%m-%Y_%T'&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;
&lt;span class="c"&gt;# check out master branch&lt;/span&gt;
&lt;span class="nv"&gt;GIT_WORK_TREE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/path/to/destination/folder/htdocs git checkout &lt;span class="nt"&gt;-f&lt;/span&gt; master

&lt;span class="c"&gt;# custom steps for deployment&lt;/span&gt;
&lt;span class="c"&gt;# For example, let's execute composer to refresh our dependencies : &lt;/span&gt;
&lt;span class="nb"&gt;cd&lt;/span&gt; /path/to/destination/folder/htdocs
composer update
&lt;span class="c"&gt;# backup current version, in case we need to do a rollback&lt;/span&gt;
&lt;span class="nb"&gt;cp&lt;/span&gt; &lt;span class="nt"&gt;-R&lt;/span&gt; /path/to/destination/folder/htdocs/. /backups/project-name/&lt;span class="nv"&gt;$NOW&lt;/span&gt;/
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Make sure it is executable:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;chmod&lt;/span&gt; +x post-receive
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h3&gt;
  
  
  3. Add the remote-repository to your local system
&lt;/h3&gt;

&lt;p&gt;Let's now add a reference to this bare repository to our local system, as a remote location. Let's call this remote "production". (It could also be called "staging" or "live" or "test"... should you want to deploy to a different system or to multiple systems.)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; ~/path/to/working-copy/
&lt;span class="nv"&gt;$ &lt;/span&gt;git remote add production ssh://username@myserver.com:22/path/to/project/folder/project-name.git
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Check that your new remote is now available, and all the existing ones:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;git remote &lt;span class="nt"&gt;-v&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h3&gt;
  
  
  And... that's it!
&lt;/h3&gt;

&lt;p&gt;You can now deploy using this beautiful one liner :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;git push production master
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2&gt;
  
  
  Going beyond ? TDD !!
&lt;/h2&gt;

&lt;p&gt;With this, I have the raw basis of a deployment pipeline. The next step would be to add code testing to make sure code updates do not introduce bugs or break anything (regression testing). I assume I should look at how to use &lt;a href="https://github.com/trinitronx/ansible-tdd"&gt;Ansible&lt;/a&gt; for that. &lt;/p&gt;

&lt;p&gt;Since I don't know how to do that yet, I'll leave you to &lt;del&gt;google&lt;/del&gt; &lt;a href="https://dev.to/search?q=TDD"&gt;dev.to/search&lt;/a&gt; your way around that one ! &lt;/p&gt;

</description>
      <category>git</category>
      <category>githubhooks</category>
      <category>deployment</category>
      <category>becode</category>
    </item>
    <item>
      <title>The easy way to turn a website into a Progressive Web App</title>
      <dc:creator>Alexandre Plennevaux</dc:creator>
      <pubDate>Tue, 21 Nov 2017 09:26:41 +0000</pubDate>
      <link>https://forem.com/becodeorg/the-easy-way-to-turn-a-website-into-a-progressive-web-app-77g</link>
      <guid>https://forem.com/becodeorg/the-easy-way-to-turn-a-website-into-a-progressive-web-app-77g</guid>
      <description>&lt;h2&gt;
  
  
  What is a Progressive Web App?
&lt;/h2&gt;

&lt;p&gt;Basically, a PWA is a website that can be saved on the user's device (desktop, tablet or smartphone) and thus feels and behaves much like a &lt;em&gt;Native application&lt;/em&gt;:  loading screen, removing the browser's interface clutter to enhance user focus, and, should the connection drop, it still displays (cached) content, enabling the user to continue working offline.  &lt;/p&gt;

&lt;h2&gt;
  
  
  Why is it important?
&lt;/h2&gt;

&lt;p&gt;It tends to boost user engagement: if Android's Chrome browser (not sure about other mobile browsers) detects that the website is a PWA, it prompts the user to save it on its device's homescreen using the icon of your choice.&lt;/p&gt;

&lt;p&gt;Compared to a mobile application, it simplifies the end-user setup process, breaking free from app stores. &lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvz18srzbmewqv6slxa5l.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvz18srzbmewqv6slxa5l.jpg" width="700" height="406"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;PWA are good for your client's business&lt;/strong&gt;. Alibaba, the Chinese Amazon, notices a 48% increase in user engagement thanks to the browser's prompt to "install" the website (&lt;a href="https://developers.google.com/web/showcase/2016/alibaba" rel="noopener noreferrer"&gt;source&lt;/a&gt;). &lt;/p&gt;

&lt;p&gt;This makes the effort totally worth fighting for!&lt;/p&gt;

&lt;p&gt;This bounty is possible thanks to a technology called &lt;strong&gt;Service Workers&lt;/strong&gt; that allows you to save static assets in the user system (html, css, javascript, json...), alongside a &lt;code&gt;manifest.json&lt;/code&gt; that specifies how the website should behave as an installed application. Service workers can do much much more, like polling user actions while offline, and syncing them in the background when back online.&lt;/p&gt;
&lt;h2&gt;
  
  
  Examples
&lt;/h2&gt;

&lt;p&gt;Famous PWAs are Slack, Spotify, Starbucks, the NY Times, and &lt;a href="https://www.dizzain.com/blog/insights/pwa-examples/" rel="noopener noreferrer"&gt;many more&lt;/a&gt;... &lt;/p&gt;

&lt;p&gt;Here are a couple PWAs made by myself using the same technique described here.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://plancomptablebelge.be" rel="noopener noreferrer"&gt;plancomptablebelge.be&lt;/a&gt; (a single-page website)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://mathr.app/" rel="noopener noreferrer"&gt;mathr.app&lt;/a&gt; (a game to practice calculous, made using Sveltekit)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Setup
&lt;/h2&gt;

&lt;p&gt;Turning a website into a PWA may sound complicated (Service workers whaaaat ?), but it's not that difficult. Follow my lead and you'll have one by the end of this article !&lt;/p&gt;
&lt;h3&gt;
  
  
  1. requirement: https instead of http
&lt;/h3&gt;

&lt;p&gt;PWA only work on a website running on a secure domain (behind &lt;strong&gt;https&lt;/strong&gt;:// instead of http://).&lt;br&gt;
These are usually very hard to set up manually, but thanksfully, if you have your own server, you can use &lt;a href="https://letsencrypt.org/" rel="noopener noreferrer"&gt;letsencrypt&lt;/a&gt; to make that super easy and automatic. And... FREE.&lt;/p&gt;
&lt;h3&gt;
  
  
  2. Tools
&lt;/h3&gt;
&lt;h4&gt;
  
  
  2.1 lighthouse test
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;the &lt;a href="https://developers.google.com/web/tools/lighthouse/" rel="noopener noreferrer"&gt;lighthouse test&lt;/a&gt; is an automated test created and maintained by Google that test websites against three criteria : Progressive, Performance, Accessibility. It gives a score in percent for each, and advises on how to solve each issue. It's a great learning tool.
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.dropbox.com%2Fs%2Frwfesahj7haglsc%2FCapture%2520d%2527%25C3%25A9cran%25202017-11-21%252010.03.29.png%3Fdl%3D1" alt="Lighthouse test result for didiermotte.be" width="" height=""&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://realfavicongenerator.net" rel="noopener noreferrer"&gt;realfavicongenerator.net&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;the &lt;a href="https://www.talater.com/upup/getting-started-with-offline-first.html" rel="noopener noreferrer"&gt;UpUp.js library&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;
  
  
  2.2 realfavicongenerator.net
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://realfavicongenerator.net" rel="noopener noreferrer"&gt;realfavicongenerator.net&lt;/a&gt; takes care of the visual layer of your PWA. It generates the manifest.json file mentioned above, alongside all the versions of your icons necessary when saving the website onto any mobile device, and an html snippet to add to your page's &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt; tag. &lt;/p&gt;
&lt;h4&gt;
  
  
  2.3 service workers, via upup.js
&lt;/h4&gt;

&lt;p&gt;Service Workers is a javascript technology. I found it hard to grasp for my tired and impatient brain, but luckily, &lt;a href="https://vimeo.com/103221949" rel="noopener noreferrer"&gt;a smart girl from Germany&lt;/a&gt; pointed me to a javascript library by &lt;a href="https://twitter.com/TalAter" rel="noopener noreferrer"&gt;Tal Atler&lt;/a&gt;, that makes it &lt;em&gt;über&lt;/em&gt; easy to make your website behave nicely when the connexion drops. &lt;em&gt;danke schön, Ola Gasidlo !&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Just do the quick &lt;a href="https://www.talater.com/upup/getting-started-with-offline-first.html" rel="noopener noreferrer"&gt;UpUp tutorial&lt;/a&gt; and you're good to go.&lt;/p&gt;
&lt;h4&gt;
  
  
  2.4 The Manifest
&lt;/h4&gt;

&lt;p&gt;Edit the manifest.json file that RFG generated for you. It should contain at minimum these entries: "scope", "start_url", "short_name", "display". Here is a working sample:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"My PWA Sample App"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"short_name"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"PWA"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"start_url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"index.html?utm_source=homescreen"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"scope"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"./"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"icons"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"src"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"./android-chrome-192x192.png"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"sizes"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"192x192"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"image/png"&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"src"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"./android-chrome-512x512.png"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"sizes"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"512x512"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"image/png"&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"theme_color"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"#ffee00"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"background_color"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"#ffee00"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"display"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"standalone"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;More information is available at &lt;a href="https://developers.google.com/web/updates/2017/02/improved-add-to-home-screen#navigating_outside_of_your_progressive_web_app" rel="noopener noreferrer"&gt;developers.google.com&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Methodology
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Use Realfavicongenerator and generate the html and image code. Add them to your website code.&lt;/li&gt;
&lt;li&gt;Publish on your https domain.&lt;/li&gt;
&lt;li&gt;Do the lighthouse test.&lt;/li&gt;
&lt;li&gt;Analyse results.&lt;/li&gt;
&lt;li&gt;Fix each issue one by one.&lt;/li&gt;
&lt;li&gt;Go back to 3, rince and repeat.&lt;/li&gt;
&lt;li&gt;Iterate until you get as close to 100 everywhere, and 100 in "Progressive".&lt;/li&gt;
&lt;li&gt;Test on your mobile phone and see what happens. With chance, on Android you'll see a popup at the bottom, inviting you to save the website onto your phone homescreen!
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fbecodeorg%2FLovelace-promo-2%2Fraw%2Fmaster%2FParcours%2FPWA%2520-%2520progressive%2520web%2520apps%2Fassets%2Fadd-to-homescreen.jpg" width="800" height="400"&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Deeper into the rabbit hole...
&lt;/h2&gt;

&lt;p&gt;Here is a sample PWA project I made using a Github Page, live coded for my juniors at &lt;a href="http://www.becode.org" rel="noopener noreferrer"&gt;BeCode&lt;/a&gt; :  &lt;a href="https://pixeline.github.io/pwa-example/index.html" rel="noopener noreferrer"&gt;visit its Github Page&lt;/a&gt; with your mobile phone to test it. &lt;a href="https://github.com/pixeline/pwa-example" rel="noopener noreferrer"&gt;Visit its repository&lt;/a&gt; to inspect the code.&lt;/p&gt;

&lt;p&gt;You can find all the information you need on PWA in this book:   &lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.amazon.fr/_/dp/1491961651?tag=oreilly20-20" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuiap4swbstsctb0o8bay.jpg" width="381" height="499"&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;That's it! Happy PWA-ing!&lt;/p&gt;




&lt;p&gt;Your PWA is ready: how about you learn &lt;a href="https://dev.to/pixeline/deploy-an-application-automatically-using-github-hooks-50fd"&gt;how to automate its deployment using Git&lt;/a&gt; ?&lt;/p&gt;

</description>
      <category>pwa</category>
      <category>lighthouse</category>
      <category>mobile</category>
    </item>
  </channel>
</rss>
