<?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 Valentine Troy Abako on Medium]]></title>
        <description><![CDATA[Stories by Valentine Troy Abako on Medium]]></description>
        <link>https://medium.com/@elijahvalentinetroyabako?source=rss-dd9f2ed9f7b6------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*iLHLHbcU3zga719WnjEZKg.png</url>
            <title>Stories by Valentine Troy Abako on Medium</title>
            <link>https://medium.com/@elijahvalentinetroyabako?source=rss-dd9f2ed9f7b6------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 15:59:58 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@elijahvalentinetroyabako/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[Docker issue — Operation not permitted — Resolved!]]></title>
            <link>https://medium.com/@elijahvalentinetroyabako/docker-issue-operation-not-permitted-resolved-3d6997891517?source=rss-dd9f2ed9f7b6------2</link>
            <guid isPermaLink="false">https://medium.com/p/3d6997891517</guid>
            <dc:creator><![CDATA[Valentine Troy Abako]]></dc:creator>
            <pubDate>Sat, 25 May 2024 08:36:18 GMT</pubDate>
            <atom:updated>2024-05-25T08:36:18.254Z</atom:updated>
            <content:encoded><![CDATA[<h3>Docker issue — Operation not permitted after upgrading to new OS -Resolved!</h3><p>if you recently updated your OS and docker can no longer access your files and folder. The issue is due to the new permissions requested by the latest Mac OS.</p><p>Now, macOS requests permissions for everything, even for accessing a directory. You probably had a notification about granting Docker for Mac permission to access the shared folder, you didn’t grant it, and now you are facing the outcome of such action “Operation not permitted”.</p><p>To grant privileges now, go to System preferences &gt; Security &amp; Privacy &gt; Files and Folders, and add Docker for Mac and your shared directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/713/1*M5q9gUS7MC8WJKoOMSvySQ.png" /></figure><p>After allowing docker to access my files and folders, I was able to mount my files and folder to docker. I was able to run my application in the docker container successfully.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j5qGnDXvOutDrMMMhiT34A.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3d6997891517" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Restful APIs Using Spring Boot with JPA, Hibernate, MySQL,VueJS and Docker(CRUD). Part 1]]></title>
            <link>https://medium.com/@elijahvalentinetroyabako/restful-apis-using-spring-boot-with-jpa-hibernate-mysql-vuejs-and-docker-crud-part-1-49bda4e33bcb?source=rss-dd9f2ed9f7b6------2</link>
            <guid isPermaLink="false">https://medium.com/p/49bda4e33bcb</guid>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[restful-api]]></category>
            <category><![CDATA[hibernate]]></category>
            <category><![CDATA[mysql]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Valentine Troy Abako]]></dc:creator>
            <pubDate>Wed, 24 Apr 2019 15:21:42 GMT</pubDate>
            <atom:updated>2019-04-24T15:21:42.758Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*gbbhNW12LiLdYNb1k0743g.jpeg" /></figure><p>This tutorial will walk you through the steps of building a full stack CRUD web app and RESTful APIs web services example with Spring Boot, JPA/Hibernate, MySQL, VueJS and Docker. Let’s cut the long story short and proceed to implementation.</p><h3>what you will need</h3><ul><li>JDK 8+ or OpenJDK 8+</li><li>Maven 3+</li><li>MySQL Server 5+ or Docker CE 18+</li></ul><h3>Creating the REST Spring Boot application</h3><p>To create the Spring Boot application, we’ll use <a href="https://start.spring.io/">start.spring.io</a>, which will provide us some bootstrap code (main class and pom.xml files). We need the Web, JPA, Lombok and MySQL packages for this example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d1aSRqfgkavYpA0AsgXjRw.png" /><figcaption>Please type in the search box.</figcaption></figure><h3>Project Structure</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/596/1*bD2FSlGRkTIm7UTp8yzMyw.png" /></figure><h3>Project dependencies</h3><pre>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;<br>&lt;project xmlns=&quot;<a href="http://maven.apache.org/POM/4.0.0">http://maven.apache.org/POM/4.0.0</a>&quot; xmlns:xsi=&quot;<a href="http://www.w3.org/2001/XMLSchema-instance">http://www.w3.org/2001/XMLSchema-instance</a>&quot;<br> xsi:schemaLocation=&quot;<a href="http://maven.apache.org/POM/4.0.0">http://maven.apache.org/POM/4.0.0</a> <a href="http://maven.apache.org/xsd/maven-4.0.0.xsd">http://maven.apache.org/xsd/maven-4.0.0.xsd</a>&quot;&gt;<br> &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;<br> &lt;parent&gt;<br>  &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;<br>  &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;<br>  &lt;version&gt;2.1.4.RELEASE&lt;/version&gt;<br>  &lt;relativePath/&gt; &lt;!-- lookup parent from repository --&gt;<br> &lt;/parent&gt;<br> &lt;groupId&gt;com.crud&lt;/groupId&gt;<br> &lt;artifactId&gt;crud&lt;/artifactId&gt;<br> &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;<br> &lt;name&gt;crud&lt;/name&gt;<br> &lt;description&gt;Demo project for Spring Boot&lt;/description&gt;</pre><pre>&lt;properties&gt;<br>  &lt;java.version&gt;1.8&lt;/java.version&gt;<br> &lt;/properties&gt;</pre><pre>&lt;dependencies&gt;<br>  &lt;dependency&gt;<br>   &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;<br>   &lt;artifactId&gt;spring-boot-starter-data-jpa&lt;/artifactId&gt;<br>  &lt;/dependency&gt;<br>  &lt;dependency&gt;<br>   &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;<br>   &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt;<br>  &lt;/dependency&gt;</pre><pre>&lt;dependency&gt;<br>   &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;<br>   &lt;artifactId&gt;spring-boot-devtools&lt;/artifactId&gt;<br>   &lt;scope&gt;runtime&lt;/scope&gt;<br>  &lt;/dependency&gt;<br>  &lt;dependency&gt;<br>   &lt;groupId&gt;mysql&lt;/groupId&gt;<br>   &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;<br>   &lt;scope&gt;runtime&lt;/scope&gt;<br>  &lt;/dependency&gt;<br>  &lt;dependency&gt;<br>   &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;<br>   &lt;artifactId&gt;spring-boot-starter-test&lt;/artifactId&gt;<br>   &lt;scope&gt;test&lt;/scope&gt;<br>  &lt;/dependency&gt;<br>  &lt;dependency&gt;<br>   &lt;groupId&gt;org.projectlombok&lt;/groupId&gt;<br>   &lt;artifactId&gt;lombok&lt;/artifactId&gt;<br>   &lt;version&gt;1.18.0&lt;/version&gt;<br>   &lt;type&gt;jar&lt;/type&gt;<br>  &lt;/dependency&gt;<br> &lt;/dependencies&gt;</pre><pre>&lt;build&gt;<br>  &lt;plugins&gt;<br>   &lt;plugin&gt;<br>    &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;<br>    &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;<br>   &lt;/plugin&gt;<br>  &lt;/plugins&gt;<br> &lt;/build&gt;</pre><pre>&lt;/project&gt;</pre><h3>Define JPA Entity</h3><p><a href="https://github.com/hellokoding/hellokoding-courses/blob/master/springboot-examples/springboot-crud-mysql-vuejs/src/main/java/com/hellokoding/springboot/restful/product/Product.java">Product.java</a></p><p>/*<br> * To change this license header, choose License Headers in Project Properties.<br> * To change this template file, choose Tools | Templates<br> * and open the template in the editor.<br> */<br>package com.crud.demo.product;</p><p>import java.math.BigDecimal;<br>import java.util.Date;<br>import javax.persistence.Entity;<br>import javax.persistence.GeneratedValue;<br>import javax.persistence.GenerationType;<br>import javax.persistence.Id;<br>import lombok.Data;<br>import org.hibernate.annotations.CreationTimestamp;<br>import org.hibernate.annotations.UpdateTimestamp;</p><p>/**<br> *<br> * <a href="http://twitter.com/author">@author</a> Valentine<br> */<br><a href="http://twitter.com/Entity">@Entity</a></p><p><a href="http://twitter.com/Data">@Data</a><br>public class Product {</p><p><a href="http://twitter.com/Id">@Id</a><br> <a href="http://twitter.com/GeneratedValue">@GeneratedValue</a>(strategy = GenerationType.IDENTITY)<br> private Long id;<br> private String name;<br> private String description;<br> private BigDecimal price;</p><p><a href="http://twitter.com/CreationTimestamp">@CreationTimestamp</a><br> private Date createdAt;</p><p><a href="http://twitter.com/UpdateTimestamp">@UpdateTimestamp</a><br> private Date updatedAt;</p><p>public Product(Long id, String name, String description, BigDecimal price, Date createdAt, Date updatedAt) {<br> this.id = id;<br> this.name = name;<br> this.description = description;<br> this.price = price;<br> this.createdAt = createdAt;<br> this.updatedAt = updatedAt;<br> }</p><p>}</p><h3>Defining the Repository</h3><p>ProductRepository.Java</p><p>/*<br> * To change this license header, choose License Headers in Project Properties.<br> * To change this template file, choose Tools | Templates<br> * and open the template in the editor.<br> */</p><p>package com.crud.demo.product;</p><p>import org.springframework.data.jpa.repository.JpaRepository;</p><p>/**<br> *<br> * <a href="http://twitter.com/author">@author</a> Valentine<br> */<br>public interface ProductRepository extends JpaRepository &lt;Product, Long&gt;{<br> <br>}</p><h3>Defining the Service</h3><p>ProductService.java</p><p>/*<br> * To change this license header, choose License Headers in Project Properties.<br> * To change this template file, choose Tools | Templates<br> * and open the template in the editor.<br> */</p><p>package com.crud.demo.product;</p><p>import java.util.List;<br>import java.util.Optional;<br>import lombok.RequiredArgsConstructor;<br>import org.springframework.stereotype.Service;</p><p>/**<br> *<br> * <a href="http://twitter.com/author">@author</a> Valentine<br> */<br><a href="http://twitter.com/Service">@Service</a></p><p><a href="http://twitter.com/RequiredArgsConstruc">@RequiredArgsConstruc</a>tor<br>public class ProductService {<br> <br> private final ProductRepository productRespository;<br> <br> public List&lt;Product&gt; findAll() {<br> return productRespository.findAll();<br> }<br> <br> public Optional&lt;Product&gt; findbyID(Long id) {<br> return productRespository.findById(id);<br> }<br> <br> public Product save(Product stock) {<br> return productRespository.save(stock);<br> }<br> <br> public void deleteById(Long id) {<br> productRespository.deleteById(id);<br> }<br> <br>}</p><h3>Define REST API and Controller</h3><p>ProductAPI.java</p><p>/*<br> * To change this license header, choose License Headers in Project Properties.<br> * To change this template file, choose Tools | Templates<br> * and open the template in the editor.<br> */<br>package com.crud.demo.product;</p><p>import java.util.List;<br>import java.util.Optional;<br>import javax.validation.Valid;<br>import lombok.RequiredArgsConstructor;<br>import lombok.extern.slf4j.Slf4j;<br>import org.springframework.http.ResponseEntity;<br>import org.springframework.web.bind.annotation.DeleteMapping;<br>import org.springframework.web.bind.annotation.GetMapping;<br>import org.springframework.web.bind.annotation.PathVariable;<br>import org.springframework.web.bind.annotation.PutMapping;<br>import org.springframework.web.bind.annotation.RequestBody;<br>import org.springframework.web.bind.annotation.RequestMapping;<br>import org.springframework.web.bind.annotation.RestController;</p><p>/**<br> *<br> * <a href="http://twitter.com/author">@author</a> Valentine<br> */<br><a href="http://twitter.com/RestController">@RestController</a><br><a href="http://twitter.com/RequestMapping">@RequestMapping</a>(“/api/v1/products”)<br><a href="http://twitter.com/Slf4j">@Slf4j</a><br><a href="http://twitter.com/RequiredArgsConstruc">@RequiredArgsConstruc</a>tor<br>public class ProductAPI {</p><p>private final ProductService productService;</p><p><a href="http://twitter.com/GetMapping">@GetMapping</a><br> public ResponseEntity&lt;List&lt;Product&gt;&gt; findAll() {<br> return ResponseEntity.ok(productService.findAll());<br> }</p><p>public ResponseEntity create(<a href="http://twitter.com/Valid">@Valid</a> <a href="http://twitter.com/RequestBody">@RequestBody</a> Product product) {<br> return ResponseEntity.ok(productService.save(product));<br> }</p><p><a href="http://twitter.com/GetMapping">@GetMapping</a>(“/{id}”)<br> public ResponseEntity&lt;Product&gt; findById(<a href="http://twitter.com/PathVariable">@PathVariable</a> Long id) {<br> Optional&lt;Product&gt; stock = productService.findbyID(id);<br> if (!stock.isPresent()) {<br> log.error(“Id “ + id + “ is not existed”);<br> ResponseEntity.badRequest().build();<br> }<br> return ResponseEntity.ok(stock.get());<br> }</p><p><a href="http://twitter.com/PutMapping">@PutMapping</a>(“/{id}”)<br> public ResponseEntity&lt;Product&gt; update(<a href="http://twitter.com/PathVariable">@PathVariable</a> Long id, <a href="http://twitter.com/Valid">@Valid</a> <a href="http://twitter.com/RequestBody">@RequestBody</a> Product product) {<br> if (!productService.findbyID(id).isPresent()) {<br> log.error(“Id “ + id + “ is not existed”);<br> ResponseEntity.badRequest().build();<br> }</p><p>return ResponseEntity.ok(productService.save(product));<br> }</p><p><a href="http://twitter.com/DeleteMapping">@DeleteMapping</a>(“/{id}”)<br> public ResponseEntity delete(<a href="http://twitter.com/PathVariable">@PathVariable</a> Long id) {<br> if (!productService.findbyID(id).isPresent()) {<br> log.error(“Id “ + id + “ is not existed”);<br> ResponseEntity.badRequest().build();<br> }</p><p>productService.deleteById(id);</p><p>return ResponseEntity.ok().build();<br> }</p><p>}</p><p>ProductController.java</p><p>/*<br> * To change this license header, choose License Headers in Project Properties.<br> * To change this template file, choose Tools | Templates<br> * and open the template in the editor.<br> */</p><p>package com.crud.demo.product;</p><p>import org.springframework.stereotype.Controller;<br>import org.springframework.web.bind.annotation.GetMapping;</p><p>/**<br> *<br> * <a href="http://twitter.com/author">@author</a> Valentine<br> */</p><p><a href="http://twitter.com/Controller">@Controller</a><br>public class ProductController {<br> <br> <a href="http://twitter.com/GetMapping">@GetMapping</a>(“/”)<br> public String list(){<br> return “products”;<br> }<br>}</p><p><strong>Endpoints</strong></p><p>All Products</p><pre>http verb: Get</pre><pre>/api/v1/products</pre><p>View Products by Id</p><pre>http verb: Get</pre><pre>/api/v1/products/{id}</pre><p>Add Product</p><pre>http verb: POST</pre><pre>/api/v1/products</pre><p>Update Product by Id</p><pre>http verb: PUT</pre><pre>/api/v1/products/{id}</pre><p>Delete Product by Id</p><pre>http verb: delete</pre><pre>/api/v1/products/id</pre><p>Ok. I hope this helps. Please feel free to give suggestions, recommendations and gratitude.</p><p>In part two, we will be covering the api integration part using VueJs.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=49bda4e33bcb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Progressive Web Application Technology (PWA) Used By Verify Me Nigeria (verifyme.ng)]]></title>
            <link>https://medium.com/@elijahvalentinetroyabako/progress-web-application-technology-pwa-used-by-verify-me-nigeria-verifyme-ng-19e702de620f?source=rss-dd9f2ed9f7b6------2</link>
            <guid isPermaLink="false">https://medium.com/p/19e702de620f</guid>
            <category><![CDATA[laravel]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[pwa]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[vuejs]]></category>
            <dc:creator><![CDATA[Valentine Troy Abako]]></dc:creator>
            <pubDate>Sun, 20 May 2018 08:57:57 GMT</pubDate>
            <atom:updated>2018-05-23T10:32:28.910Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/259/1*vY8tYV85ZIlErbScH7RMIQ.png" /><figcaption>Progressive Web Applications</figcaption></figure><p>Some call me CTO, some call me Solutions Manager…Thank you…well they all do the same thing. LOL.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/275/1*seDnpZzb1VWDzgS_F6y7Mg.jpeg" /><figcaption>Yeah…CTO…That’s cool. LOL.</figcaption></figure><p>Let’s Progress…..yipppppppppiiiiiiiyyyyyy…</p><p>Progress web application is gradually becoming very popular. <a href="http://konga.com/">Konga.com </a>Became the first company to use PWA in building Application in Nigeria and Africa at large. I remember the chrome submit held 2 years ago at San Francisco, November 10–11, 2016. Konga Nailed it. Andrew Mori (Director of Technology Konga) was the Master mind behind such great idea.</p><blockquote>“ Is not about Implementation is about the idea and how to go about it. ”</blockquote><p>Ok enough of Konga, Let’s Focus on the current trend. The company that is all over social media, all over Nigeria and the company that is putting smiles on the face of Employers, Recruiters and Worker. Ladies and gentlemen I present verify me Nigeria (verifyme.ng) to you, a company that is using great technology to solve problems in Nigeria.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/346/1*lRM6fFUwOFEkSf_B25XaJQ.jpeg" /><figcaption>Work history Reporting and Identity verification Company</figcaption></figure><p>Let’s focus on PWA today.</p><p>PWA came into play in verifyme Nigeria when I was thinking of a solution that will handle offline and online feature. Because of the network strength in Nigeria and Africa as a whole, we had to come up with a solution that depend on little or no internet connectivity. I spoke with my Team and I suggested we go with PWA. I have a very wonderful team full of ideas and skills. We began the implementation, the team did a great job and collectively as a team we came up with “Verifyme Address Verification App (KYC app)”.</p><p>This app is awesome, Reason why I can’t stop smiling and feeling good for Leading this great solution.</p><p>This app has the following features:</p><p>i. Works on web and can also be added on homescreen</p><p>ii. Works as a standalone application (Native app).</p><p>iii. Works offline after loading via initial network connectivity.</p><p>iv. Works online</p><p>v. Support multiple browsers and IOS.</p><p>Isn’t this awesome? yes it is. And Yes Verifyme Nigeria has this app.</p><blockquote>“Are you an employer (Corporate or Domestic) or a recruiting agency, you need a verification company to verify your workers and the workers you outsource. Use Verifyme.ng services. Verifyme uses modern days technology to handle verification and collect data. Data privacy is very important to us”. Visit https://verifyme.ng</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/192/1*9V7N-p5n6Qbc2_Hv_eZpVQ.jpeg" /><figcaption><strong>Oops I almost forgot this great guys…LOL</strong></figcaption></figure><h3>Service worker</h3><p>Service workers are a key element of PWA’s. A service worker is a script that is run in the background by the browser. It sits between the PWA and the server. Depending on network availability, the service worker, acting as a proxy, will serve elements from its cache or will retrieve them over the network on the server. Service workers make it possible to use PWA’s offline. Amongst other tasks, service workers are also responsible for push notification reception on your PWA.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/318/1*1DbQsQK35R456Z6aMWfnCQ.jpeg" /><figcaption>Service worker</figcaption></figure><h3>Web push notifications:<br>Firebase and APNs</h3><p>Your PWA can receive push notifications. This feature is supported by the majority of recent web browsers. For Chrome, Firefox, and Opera, push notifications are delivered by Firebase, which is Google’s platform. For Safari, notifications are delivered by APNs, Apple’s platform.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FazHxlOdB4lKGO4XSjCWzQ.png" /><figcaption>Web Push notification Architect</figcaption></figure><h3>Browser capabilities</h3><p>Your PWA is progressive. It will always deliver the best possible experience given the capabilities of the browser it’s running on. The more modern the browser is, the better the experience</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PU2Alw4DTME5tpp-T2kWcg.png" /><figcaption>Browser Compatibilities.</figcaption></figure><h3>SEO</h3><h3>URL slugs</h3><p>The distribution model of your PWA is the link and the slug is the exact URL of a webpage. You can customize each slug of your PWA, making the URL of important pages SEO friendly. Since every page of your PWA has a dedicated slug, deep linking is easily possible with your PWA.</p><h3>HTTPS</h3><p>Service workers can perform very powerful operation on the user’s browser. To ensure that this power is used for the good, it’s only possible to register a service worker on a page served over https. All your PWA’s pages are served over https by default. It guarantees that the service worker installed on the browser has not been tampered with. It also helps with your pages’ SEO.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gO9ymSodxy6ossIuhlT17A.png" /><figcaption>Http Process Flow in PWA</figcaption></figure><h3>Speed</h3><h3>Optimized image compressor</h3><p>In order to minimize bandwidth consumption and reduce loading time, our engineers developed a dedicated algorithm to manage the compression of images. Each time you upload an image, several copies with different sizes are created. Each copy is compressed with our algorithm which has been coded to minimize quality loss. Copies are then used to deliver an image that is never larger than the version rendered on the user’s screen. It’s the best practice for improving the quality of your PWA and staying compliant with Lighthouse recommendations, by loading images fast and consuming less cellular data.</p><h3>Frameworks</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/128/1*Kr5aAKoAE8jY3w59IHQOrw.png" /><figcaption>Angular</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ACR0gj0wbx91V_xgURifWg.png" /></figure><p>And so many Framework. Isn’t this awesome….wawuuuu….</p><p>Visit Verifyme.ng.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=19e702de620f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Simulating a back-end with Postman’s mock servers]]></title>
            <link>https://medium.com/@elijahvalentinetroyabako/simulating-a-back-end-with-postmans-mock-servers-572e1f2ac400?source=rss-dd9f2ed9f7b6------2</link>
            <guid isPermaLink="false">https://medium.com/p/572e1f2ac400</guid>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Valentine Troy Abako]]></dc:creator>
            <pubDate>Sun, 18 Mar 2018 13:46:23 GMT</pubDate>
            <atom:updated>2018-03-18T13:46:23.224Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/623/1*ThXF5ODMhVmShIrhVM2Wxw.jpeg" /></figure><p>In my last article, I spoke about Mock server. Am going to use postman to achieve this. You read this in details on postman documentation. wawu…Here we go.</p><p>Delays on the front- or back-end make it difficult for dependent teams to complete their work efficiently. Postman’s mock servers can alleviate those delays in the development process.</p><p>Front-end developers can create a mock server to simulate each endpoint and its corresponding environment in a Postman Collection, before sending the actual request. Developers can view potential responses, without spinning up a back end.</p><p>Creating a mock example during the earliest phase of API development fosters clear communication among team members and aligns their expectations. As a result, all teams in the development process can work in parallel; and dependent teams experience fewer delays.</p><h3>Setting up a mock server</h3><p>You can create a mock in several ways:</p><ul><li><strong>New</strong> button</li><li>Launch screen</li><li>Postman app</li><li>Postman API</li></ul><p>Mocks are accessible to the public by default. If you create a mock and specify that it is only to be available privately, Postman Pro and Enterprise users can share the underlying collection with the team or specific team members, and provide permissions to edit or view.</p><p><strong>Note</strong>: This topic only covers how to create a mock with the <strong>New</strong> button and the Launch screen. To learn how to create a mock with the Postman app or the Postman API, click its link for detailed information.</p><h4>New button</h4><ol><li>In the header toolbar, click the <strong>New</strong> button.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*kXgG-U7cWyqVssDR.png" /></figure><p>The <strong>Create New</strong> tab appears.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*LHbKwa4yQGG4L2rl.png" /></figure><p><strong>Note</strong>: At the bottom, you can select “Show this window at launch” to indicate whether you want the <strong>Create New</strong>tab to display each time you open Postman.</p><ol><li>Click “Mock Server”.</li><li>Select if you want to mock a new API or an existing or team collection. If you create a new API to mock, you must select a request method and enter the request path, response code, and response body. If you use an existing or team collection to mock, you must select a collection from a list of existing or team collections.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*iwJIkGGU7PR6pv14.png" /></figure><ol><li>After you select or create the request you want to mock, click the <strong>Next</strong> button.</li><li>In the <strong>Configure mock server</strong> tab, you must:</li></ol><ul><li>Enter the name of the mock</li><li>Select an environment (optional).</li><li>Indicate if you want to make this mock server private</li></ul><p><strong>Note</strong>: The number of calls made to mock servers might be limited by your Postman account. Check your usage limits.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*cRm8BG0V8CnAIWMF.png" /></figure><ol><li>Click the <strong>Create</strong> button.</li></ol><p>In the <strong>Next steps</strong> tab, see a list of suggested next steps to maximize the effectiveness of your mock server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*IThLyo6rWgK3PDgv.png" /></figure><h4>Launch screen</h4><p>The <strong>Create New</strong> tab appears by default when you launch Postman.</p><ol><li>Open the Postman app.</li><li>In the <strong>Create New</strong> tab, click “Mock Server”.</li><li>Follow steps 3–6 in the previous <strong>New</strong> button section.</li></ol><p><strong>Note</strong>: At the bottom, you can select “Show this window at launch” to indicate whether you want the <strong>Create New</strong>tab to display each time you open Postman.</p><h3>Using HTTP access control (CORS) for a mock</h3><p>In addition to using the Postman app to make requests to mock endpoints, you also can make those requests in a browser.</p><p>A web browser makes a cross-origin HTTP request when it requests a resource from a domain, protocol, or port that’s different from its own.</p><p>For security reasons, cross-origin resource sharing (CORS) is a standard that defines a way in which a browser and server can interact securely. In this case, we are referring to how a web browser interacts with the mock endpoints hosted on the Postman server.</p><p>CORS is enabled for Postman mock servers. As a result, you can stub your web apps with mocked data using the mock endpoints. So development or production web apps can make requests to the Postman mock endpoint you just created and receive an example response.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TJsDGVwoG86d8-8lY6GS5A.png" /><figcaption>This is our output….Yes yes yes….</figcaption></figure><h3>Using free mock server calls with your Postman account</h3><p>Your Postman account gives you a limited number of free mock server calls per month.</p><p>You can check your usage limits in the <a href="https://docs.api.getpostman.com/">Postman API</a> or in the <a href="https://go.pstmn.io/postman-account-limits">account usage page</a>.</p><p>Thank you for reading….selah</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=572e1f2ac400" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[MockServer (Mocking API’s)]]></title>
            <link>https://medium.com/@elijahvalentinetroyabako/mockserver-mocking-apis-80b2301aa688?source=rss-dd9f2ed9f7b6------2</link>
            <guid isPermaLink="false">https://medium.com/p/80b2301aa688</guid>
            <category><![CDATA[https]]></category>
            <category><![CDATA[ssl]]></category>
            <category><![CDATA[api]]></category>
            <dc:creator><![CDATA[Valentine Troy Abako]]></dc:creator>
            <pubDate>Sun, 18 Mar 2018 13:16:33 GMT</pubDate>
            <atom:updated>2018-03-18T13:16:33.387Z</atom:updated>
            <content:encoded><![CDATA[<h3>Easy mocking of any system you integrate with via HTTP or HTTPS</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*NbLGyJSTn3WiXQU0jlC2pQ.jpeg" /></figure><h3>What is MockServer</h3><p>MockServer can be used for mocking any system you integrate with via HTTP or HTTPS (i.e. services, web sites, etc).</p><p>When MockServer receives a requests it matches the request against active <strong>expectations</strong> that have been configured.</p><p>An <strong>expectations</strong> defines the <strong>action</strong> that is taken, for example, a response could be returned.</p><p>MockServer supports the follow <strong>actions</strong>:</p><ul><li><strong>return a “mock” response</strong> when a request matches an expectation</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*dENe98nlJsY_r4Pp.png" /></figure><ul><li><strong>forward a request</strong> when the request matches an expectation (i.e. a dynamic port forwarding proxy)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yfW7vTOWnjeW1Y-F.png" /></figure><ul><li><strong>execute a callback</strong> when a request matches an expectation, allowing the response to be created dynamically</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*o2-Z97NDzQQ-HcOy.png" /></figure><ul><li><strong>return an invalid response</strong> or close the connection when a request matches an expectation</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Ve06xsxjvWoqMMdu.png" /></figure><ul><li><strong>verify requests</strong> have been sent (i.e. as a test assertion)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7jq5nFmuRIQP-8U4.png" /></figure><ul><li><a href="http://www.mock-server.com/mock_server/verification.html"><strong>retrieve</strong></a><strong> logs</strong>, <strong>requests</strong> or <strong>expectations</strong> to help debug</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3Ta4veRtnO6FHRGV.png" /></figure><h3>What is MockServer Proxy</h3><p>MockServer Proxy can be used for transparently recording all requests sent by a system (i.e. an application or set of applications).</p><p>MockServer Proxy can:</p><ul><li><a href="http://www.mock-server.com/proxy/getting_started.html"><strong>proxy</strong></a><strong> all requests</strong> using any of the following proxying methods:</li><li>Port Forwarding</li><li>Web Proxying (i.e. HTTP proxy)</li><li>HTTPS Tunneling Proxying (using HTTP CONNECT)</li><li>SOCKS Proxying (i.e. dynamic port forwarding)</li><li><strong>verify requests</strong> have been sent (i.e. in a test assertion)</li><li><strong>record requests and responses</strong> to analyse how a system behaves</li></ul><p>The MockServer Proxy provides the following features:</p><ul><li><strong>Port Forwarding</strong></li><li>all requests for a specific local port are forwarded to a different (local or remote) port and hostname for the system being proxied</li><li>to proxy requests the <strong>HTTP client</strong> should use the hostname and port of the MockServer Proxy instead of the system being proxied</li><li><strong>Web Proxying</strong> (i.e. HTTP proxy)</li><li>each request is forwarded dynamically using its Host header</li><li>to proxy requests the <strong>HTTP client</strong> should be configured to use an HTTP Proxy</li><li><strong>Secure Web Proxying</strong> (i.e. HTTPS tunneling proxying)</li><li>requests are forwarded using a CONNECT request that setups an HTTP tunnel</li><li>an SSL certificate is auto-generated allowing encrypted HTTPS traffic to be recorded transparently</li><li>to proxy requests the <strong>HTTP client</strong> should be configured to use an HTTP Proxy</li><li><strong>SOCKS Proxying</strong> (i.e. dynamic port forwarding)</li><li>requests are forwarded using a SOCK CONNECT CMD request that established a socket tunnel</li><li>if the traffic is encrypted an SSL certificate is auto-generated allowing SSL traffic to be recorded transparently</li><li>to proxy requests the <strong>operating system (or JVM)</strong> should be configured to use an HTTP Proxy</li><li><strong>SSL &amp; Certificates</strong></li><li>all SSL traffic is handled transparently by auto-generating an appropriate SSL certificate</li><li>generated certificates use a single MockServer root CA certificate enabling the root certificate to be <a href="http://www.mock-server.com/proxy/configuring_sut.html">easily imported</a></li><li><strong>Port Unification</strong></li><li>to simplify configuration all protocols (i.e. HTTP, HTTPS / SSL, SOCKS, etc) are supported on the same port</li><li>the protocol is dynamically detected by both MockServer and MockServer Proxy</li></ul><h3>Why use MockServer</h3><p>MockServer allows you to mock any server or service that you connect to over HTTP or HTTPS, such as a REST or RPC service.</p><p>This is useful in the following scenarios:</p><ul><li>testing</li><li>easily recreate all types of responses for HTTP dependencies such as REST or RPC services to test applications easily and affectively</li><li>isolate the system-under-test to ensure tests run reliably and only fail when there is a genuine bug. It is important only the system-under-test is tested and not its dependencies to avoid tests failing due to irrelevant external changes such as network failure or a server being rebooted / redeployed.</li><li>easily setup mock responses independently for each test to ensure test data is encapsulated with each test. Avoid sharing data between tests that is difficult to manage and maintain and risks tests infecting each other</li><li>create test assertions that verify the requests the system-under-test has sent</li><li>de-coupling development</li><li>start working against a service API before the service is available. If an API or service is not yet fully developed MockServer can mock the API allowing any team who is using the service to start work without being delayed</li><li>isolate development teams during the initial development phases when the APIs / services may be extremely unstable and volatile. Using MockServer allows development work to continue even when an external service fails</li><li>isolate single service</li><li>during deployment and debugging it is helpful to run a single application or service or handle a sub-set of requests on on a local machine in debug mode. Using MockServer it is easy to selectively forward requests to a local process running in debug mode, all other request can be forwarded to the real services for example running in a QA or UAT environment</li></ul><p><strong>Mocking Dependencies &amp; Verifying Request</strong></p><p>A system with service dependencies, as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8Erj_jN0f8v-Ki3O.png" /></figure><p>MockServer could be used to mock the service dependencies, as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WUTSi8Nk2bQdDA9a.png" /></figure><p><strong>Isolating Single Service / Application</strong></p><p>A single page application may load static resources such as HTML, CSS and JavaScript from a web server and also make AJAX calls to one or more separate services, as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/971/0*IhRTbxc_T4o3mMFS.png" /></figure><p>To isolate a single AJAX service, for development or debugging, the MockServer can selectively forward specific requests to local instance of the service:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/971/0*GWl9d-lqdbaE-uab.png" /></figure><p>Using MockServer as a content routing load balancer is described in more detail in the section called Isolate Single Service.</p><h3>Why use MockServer Proxy</h3><p>MockServer proxy allows you to record request from the system-under-test or two analysis an existing system by recording outbound requests.</p><p>This is useful in the following scenarios:</p><ul><li>testing</li><li>create test assertions that verify the requests the system-under-test has been sent, without needing to mock any requests</li><li>analyse existing system</li><li>record all outbound requests so it is possible to analise and under stand what outbound requests an existing system is making</li><li>debug HTTP interactions</li><li>log all outbound requests so it is possible to visualise all interactions (for example from a browser) to external services. This is particularly important as network analysis tools in browsers such as Chrome do not accurately show all network interactions, such as, favicon.ico requests. In addition many proxies do not handle encrypted HTTPS traffic, however, MockServer Proxy auto-generates certificates using a single MockServer root CA certificate enabling the root certificate to be easily imported</li><li>record &amp; replay</li><li>all recorded requests can be converted into Java code or JSON expectations to simplify the creation of mocks for complex test scenarios</li></ul><p><strong>Recording Requests &amp; Analysing Behaviour</strong></p><p>MockServer Proxy can record all outbound requests, as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VeOAY2_fky30OITA.png" /></figure><p><strong>Verifying Request</strong></p><p>MockServer Proxy can verify service requests, as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*NDWMYtwDJ0w9pnH3.png" /></figure><p>Was this boring? I don’t like too much text and images too. But I think in this case it is inevitable. LOL. Pardon me please.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=80b2301aa688" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Securing Node.js RESTful APIs with JSON Web Tokens]]></title>
            <link>https://medium.com/@elijahvalentinetroyabako/securing-node-js-restful-apis-with-json-web-tokens-d0a152a97d2c?source=rss-dd9f2ed9f7b6------2</link>
            <guid isPermaLink="false">https://medium.com/p/d0a152a97d2c</guid>
            <category><![CDATA[jwt]]></category>
            <category><![CDATA[postman]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Valentine Troy Abako]]></dc:creator>
            <pubDate>Tue, 06 Mar 2018 23:24:06 GMT</pubDate>
            <atom:updated>2018-03-06T23:24:06.638Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QB3OAu_8NckVCgjJFrk9Ig.png" /><figcaption>Securing Node.js RESTful APIs with JSON Web Tokens</figcaption></figure><p>This is a step by step tutorial of how to add token based authentication to an existing REST API. The authentication strategy in question is JWT (JSON Web Token). Does it sound strange to you? Don’t worry it sounded strange to me as well at first. I heard about this at first when I was at Konga.com.</p><p>JWT Architecture.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KvQ-X_lPwaj1ffKW7zSBsw.jpeg" /><figcaption>JWT Architecture</figcaption></figure><p>JSON Web Token (JWT) is a compact, URL-safe means of representing claims to be transferred between two parties. The claims in a JWT are encoded as a JSON object that is used as the payload of a JSON Web Signature (JWS) structure or as the plaintext of a JSON Web Encryption (JWE) structure, enabling the claims to be digitally signed or integrity protected with a Message Authentication Code (MAC) and/or encrypted<em>.</em></p><p>Let’s say a user wants to sign in to their account. They send a request with the required credentials such as email and password to the server. The server checks to see if the credentials are valid. If they are, the server creates a token using the desired payload and a secret key. This string of characters that results from the encryption is called a token. Then the server sends it back to the client. The client, in turn, saves the token to use it in every other request the user will send. The practice of adding a token to the request headers is as way of authorizing the user to access resources. This is a practical example of how JWT works.</p><p>Enough of the theory. Let’s dive into the code…abi?? Lol.</p><p>Open up a terminal window or command line prompt and run this command:</p><pre>git clone <a href="https://github.com/abako220/Securing_node_restful_api_with_jwt.git">https://github.com/abako220/Securing_node_restful_api_with_jwt.git</a></pre><p>You’ll see a folder appear, open it up. Let’s take a look at the folder structure.</p><pre>&gt; user<br>  - User.js<br>  - UserController.js<br>- db.js <br>- config.js<br>- server.js<br>- app.js<br>- package.json</pre><pre>// config.js<br>module.exports = {<br>  &#39;secret&#39;: &#39;supersecret&#39;<br>};</pre><pre>// AuthController.js</pre><pre>var express = require(&#39;express&#39;);<br>var router = express.Router();<br>var bodyParser = require(&#39;body-parser&#39;);<br>router.use(bodyParser.urlencoded({ extended: false }));<br>router.use(bodyParser.json());<br>var User = require(&#39;../user/User&#39;);</pre><p>Assuming you are used to setting up Node.js Application…Lol. If you can’t please read that up on nodejs.org.</p><p>Create your database also.</p><p>Please always put your secret key in an environment file. For the purpose of this demo I will leave it in the config.js file</p><p>Now you’re ready to add the modules for using <a href="https://github.com/auth0/node-jsonwebtoken">JSON Web Tokens</a> and <a href="https://github.com/dcodeIO/bcrypt.js">encrypting passwords</a>. Paste this code into the <strong>AuthController.js</strong>:</p><pre>var jwt = require(&#39;jsonwebtoken&#39;);<br>var bcrypt = require(&#39;bcryptjs&#39;);<br>var config = require(&#39;../config&#39;);</pre><p>Open up a terminal window in your project folder and install the following modules:</p><pre>npm install jsonwebtoken --save<br>npm install bcryptjs --save</pre><pre>//Take a cup of coffee...Lol</pre><p>That’s all the modules we need to implement our desired authentication. Now you’re ready to create a /register endpoint. Add this piece of code to your <strong>AuthController.js</strong>:</p><pre>router.post(&#39;/register&#39;, function(req, res) {<br>  <br>  var hashedPassword = bcrypt.hashSync(req.body.password, 8);<br>  <br>  User.create({<br>    name : req.body.name,<br>    email : req.body.email,<br>    password : hashedPassword<br>  },<br>  function (err, user) {<br>    if (err) return res.status(500).send(&quot;There was a problem registering the user.&quot;)</pre><pre>// create a token<br>    var token = jwt.sign({ id: user._id }, config.secret, {<br>      expiresIn: 86400 // expires in 24 hours<br>    });</pre><pre>res.status(200).send({ auth: true, token: token });<br>  }); <br>});</pre><p>Here we’re expecting the user to send us three values, a name, an email and a password. We’re immediately going to take the password and encrypt it with Bcrypt’s hashing method. Then take the hashed password, include name and email and create a new user. After the user has been successfully created, we’re at ease to create a token for that user.</p><p>The jwt.sign() method takes a payload and the secret key defined in <strong>config.js </strong>as parameters. It creates a unique string of characters representing the payload. In our case, the payload is an object containing only the id of the user. Let’s write a piece of code to get the user id based on the token we got back from the register endpoint.</p><pre>router.get(&#39;/me&#39;, function(req, res) {</pre><pre>var token = req.headers[&#39;x-access-token&#39;];<br>  if (!token) return res.status(401).send({ auth: false, message: &#39;No token provided.&#39; });<br>  <br>  jwt.verify(token, config.secret, function(err, decoded) {<br>    if (err) return res.status(500).send({ auth: false, message: &#39;Failed to authenticate token.&#39; });<br>    <br>    res.status(200).send(decoded);<br>  });<br>});</pre><p>Here we’re expecting the token be sent along with the request in the headers. The default name for a token in the headers of an HTTP request is x-access-token. If there is no token provided with the request the server sends back an error. To be more precise, an 401 unauthorized status with a response message of <em>‘</em><strong>No token provided</strong><em>’</em>. If the token exists, the jwt.verify()method will be called. This method decodes the token making it possible to view the original payload. We’ll handle errors if there are any and if there are not, send back the decoded value as the response.</p><p>Finally we need to add the route to the <strong>AuthController.js</strong> in our main <strong>app.js</strong>file. First export the router from <strong>AuthController.js</strong>:</p><pre>// add this to the bottom of AuthController.js<br>module.exports = router;</pre><p>Then add a reference to the controller in the main app, right above where you exported the app.</p><pre>// app.js<br>var AuthController = require(&#39;./auth/AuthController&#39;);<br>app.use(&#39;/api/auth&#39;, AuthController);</pre><pre>module.exports = app;</pre><h3>Let’s test this out. Why not?</h3><p>Open up your REST API testing tool of choice, I use <a href="https://www.getpostman.com/postman">Postman</a>.</p><p>Go back to your terminal and run node server.js. If it is running, stop it, save all changes to you files, and run node server.js again.</p><p>Open up Postman and hit the register endpoint (/api/auth/register). Make sure to pick the POST method and x-www-form-url-encoded. Now, add some values. My user’s name is Mike and his password is ‘thisisasecretpassword’. That’s not the best password I’ve ever seen, to be honest, but it’ll do. Hit send!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VW8PuDYCd78cjlCWYLMJ5w.png" /><figcaption>/register</figcaption></figure><p>See the response? The token is a long jumbled string. To try out the /api/auth/me endpoint, first copy the token. Change the URL to /me instead of /register, and the method to GET. Now you can add the token to the request header.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HqpzH4XhCxE8ocgVUwb4XA.png" /><figcaption>/me</figcaption></figure><p>Voilà! The token has been decoded into an object with an id field. Want to make sure that the id really belongs to Mike, the user we just created? Sure you do. Jump back into your code editor.</p><pre>// in AuthController.js change this line<br>res.status(200).send(decoded);</pre><pre>// to<br>User.findById(decoded.id, function (err, user) {<br>  if (err) return res.status(500).send(&quot;There was a problem finding the user.&quot;);<br>  if (!user) return res.status(404).send(&quot;No user found.&quot;);<br>  <br>  res.status(200).send(user);<br>});</pre><p>Now when you send a request to the /me endpoint you’ll see:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wAH8NG9kFEIyTuzcZj85Cg.png" /></figure><p>The response now contains the whole user object! Cool! But, not good. The password should never be returned with the other data about the user. Let’s fix this. We can add a projection to the query and omit the password. Like this:</p><pre>User.findById(decoded.id, <br>  { password: 0 }, // projection<br>  function (err, user) {<br>    if (err) return res.status(500).send(&quot;There was a problem finding the user.&quot;);<br>    if (!user) return res.status(404).send(&quot;No user found.&quot;);</pre><pre>res.status(200).send(user);<br>});</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P_ZOnm0SpQ5jwH7gcK44Ow.png" /></figure><p>That’s better, now we can see all values except the password. Mike’s looking good.</p><h3>Did someone say login?</h3><p>After implementing the registration, we should create a way for existing users to log in. Let’s think about it for a second. The register endpoint required us to create a user, hash a password, and issue a token. What will the login endpoint need us to implement? It should check if a user with the given email exists at all. But also check if the provided password matches the hashed password in the database. Only then will we want to issue a token. Add this to your <strong>AuthController.js</strong>.</p><pre>router.post(&#39;/login&#39;, function(req, res) {</pre><pre>User.findOne({ email: req.body.email }, function (err, user) {<br>    if (err) return res.status(500).send(&#39;Error on the server.&#39;);<br>    if (!user) return res.status(404).send(&#39;No user found.&#39;);</pre><pre>var passwordIsValid = bcrypt.compareSync(req.body.password, user.password);<br>    if (!passwordIsValid) return res.status(401).send({ auth: false, token: null });</pre><pre>var token = jwt.sign({ id: user._id }, config.secret, {<br>      expiresIn: 86400 // expires in 24 hours<br>    });</pre><pre>res.status(200).send({ auth: true, token: token });<br>  });</pre><pre>});</pre><p>First of all we check if the user exists. Then using Bcrypt’s .compareSync()method we compare the password sent with the request to the password in the database. If they match we .sign() a token. That’s pretty much it. Let’s try it out.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KxM7Sz8bPrd6q9iwCr9f2w.png" /></figure><p>Cool it works! What if we get the password wrong?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qI__BMg9d88g2h7o4RzZLA.png" /></figure><p>Great, when the password is wrong the server sends a response status of 401 unauthorized. Just what we wanted!</p><p>To finish off this part of the tutorial, let’s add a simple logout endpoint to nullify the token.</p><pre>// AuthController.js<br>router.get(&#39;/logout&#39;, function(req, res) {<br>  res.status(200).send({ auth: false, token: null });<br>});</pre><blockquote>Remember, <strong>authentication</strong> is the act of logging a user in. <strong>Authorization</strong> is the act of verifying the access rights of a user to interact with a resource.</blockquote><p><strong>Middleware</strong> functions are used as bridges between some pieces of code. When used in the function chain of an endpoint they can be incredibly useful in authorization and error handling.</p><p>Get the rest of the code on my Github repo <a href="https://github.com/abako220/Securing_node_restful_api_with_jwt">https://github.com/abako220/Securing_node_restful_api_with_jwt</a></p><p>Reference: <a href="https://medium.freecodecamp.org/@adnanrahic?source=post_header_lockup">Adnan Rahić</a>Follow Software engineer @bookvar_co. Coding educator @ACADEMY387. Author @PacktPub. Campsite leader</p><p>Please don’t forget to star it on github and also clap on medium.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d0a152a97d2c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a To-Do List with jQuery and Local Storage]]></title>
            <link>https://medium.com/@elijahvalentinetroyabako/building-a-to-do-list-with-jquery-and-local-storage-f287bd95d4dd?source=rss-dd9f2ed9f7b6------2</link>
            <guid isPermaLink="false">https://medium.com/p/f287bd95d4dd</guid>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Valentine Troy Abako]]></dc:creator>
            <pubDate>Wed, 08 Nov 2017 18:18:14 GMT</pubDate>
            <atom:updated>2017-11-08T18:18:14.246Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/450/1*NCDlcbPXpKNI2PrZHjv9pA.png" /><figcaption><strong>Building a To-Do List with jQuery and Local Storage By Valentine Abako</strong></figcaption></figure><p><strong>Building a To-Do List with jQuery and Local Storage</strong></p><p>We all have those days when we have a lot of things to accomplish, but no way to know if we will complete all of them. In these situations, a to-do list is extremely helpful. There are great mobile apps, online tools, and even WordPress plugins which perform this task, but have you ever wondered how long it would take to create one by yourself?</p><p>In this tutorial, we will create a basic to-do list. Tasks will fall into one of three categories — pending, in progress, and completed. Our application will allow new tasks to be created, which go into the pending category by default. Tasks can easily be moved between categories using drag and drop technology. Of course, tasks can also be deleted.</p><h3>Prerequisites</h3><p>The following libraries are used in this project.</p><ul><li>jQuery 1.10.2</li><li>jQuery UI 1.10.3</li><li>Bootstrap 2.2.2</li></ul><h3>Creating the Markup and CSS</h3><p>Let’s create the basic look and feel of the application before adding the functionality via JavaScript.</p><pre>/**</pre><pre>* Created by VSC</pre><pre>* User: Valentine Troy Abako</pre><pre>* Date : 28/06/2017</pre><pre>* Time : 01:39 AM</pre><pre>**/</pre><pre>&lt;div class=&quot;task-list&quot; id=&quot;pending&quot;&gt;<br>  &lt;h3&gt;Pending&lt;/h3&gt;<br>  &lt;!-- Sample task added manually to check look --&gt;<br>  &lt;div class=&quot;todo-task&quot;&gt;<br>    &lt;div class=&quot;task-header&quot;&gt;To-do Header&lt;/div&gt;<br>    &lt;div class=&quot;task-date&quot;&gt;08/11/2017&lt;/div&gt;<br>    &lt;div class=&quot;task-description&quot;&gt;Valentine Target&lt;/div&gt;<br>  &lt;/div&gt;<br>&lt;/div&gt;</pre><pre>&lt;div class=&quot;task-list&quot; id=&quot;inProgress&quot;&gt;<br>  &lt;h3&gt;In Progress&lt;/h3&gt;<br>&lt;/div&gt;</pre><pre>&lt;div class=&quot;task-list&quot; id=&quot;completed&quot;&gt;<br>  &lt;h3&gt;Completed&lt;/h3&gt;<br>&lt;/div&gt;</pre><pre>&lt;div class=&quot;task-list&quot;&gt;<br>  &lt;h3&gt;Add a task&lt;/h3&gt;<br>  &lt;form id=&quot;todo-form&quot;&gt;<br>    &lt;input type=&quot;text&quot; placeholder=&quot;Title&quot; /&gt;<br>    &lt;textarea placeholder=&quot;Descrtipion&quot;&gt;&lt;/textarea&gt;<br>    &lt;input type=&quot;text&quot; placeholder=&quot;Due Date (dd/mm/yyyy)&quot; /&gt;<br>    &lt;input type=&quot;button&quot; class=&quot;btn btn-primary&quot; value=&quot;Add Task&quot; /&gt;<br>  &lt;/form&gt;</pre><pre>  &lt;input type=&quot;button&quot; class=&quot;btn btn-primary&quot; value=&quot;Clear Data&quot; /&gt;</pre><pre>  &lt;div id=&quot;delete-div&quot;&gt;Drag Here to Delete&lt;/div&gt;<br>&lt;/div&gt;</pre><p>Next, add some styling to the elements using the following CSS.</p><pre>.task-list {<br>  width: 250px;<br>  float: left;<br>  margin: 0 5px;<br>  background-color: #e3e3e3;<br>  min-height: 240px;<br>  border-radius: 10px;<br>  padding-bottom: 15px;<br>}</pre><pre>.task-list input, .task-list textarea {<br>  width: 240px;<br>  margin: 1px 5px;<br>}</pre><pre>.task-list input {<br>  height: 30px;<br>}</pre><pre>.todo-task {<br>  border-radius: 5px;<br>  background-color: #fff;<br>  width: 230px;<br>  margin: 5px;<br>  padding: 5px;<br>}</pre><pre>.task-list input[type=&quot;button&quot;] {<br>  width: 100px;<br>  margin: 5px;<br>}</pre><pre>.todo-task &gt; .task-header {<br>  font-weight: bold;<br>}</pre><pre>.todo-task &gt; .task-date {<br>  font-size: small;<br>  font-style: italic;<br>}</pre><pre>.todo-task &gt; .task-description {<br>  font-size: smaller;<br>}</pre><pre>h3 {<br>  text-align: center;<br>}</pre><pre>#delete-div {<br>  background-color: #fff;<br>  border: 3px dotted #000;<br>  margin: 10px;<br>  height: 75px;<br>  line-height: 75px;<br>  text-align: center;<br>}</pre><p>Our static to-do page should look like the following image.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kiUPux9NsFtA20u3SV0_Ow.png" /></figure><h3>Defining the JavaScript Constants</h3><p>Throughout this tutorial, we will be referring to certain constants to avoid hard coding values. These constants are shown below.</p><pre>var defaults = {<br>  // CSS selectors and attributes that would be used by the JavaScript functions<br>  todoTask: &quot;todo-task&quot;,<br>  todoHeader: &quot;task-header&quot;,<br>  todoDate: &quot;task-date&quot;,<br>  todoDescription: &quot;task-description&quot;,<br>  taskId: &quot;task-&quot;,<br>  formId: &quot;todo-form&quot;,<br>  dataAttribute: &quot;data&quot;,<br>  deleteDiv: &quot;delete-div&quot;<br>}, codes = {<br>  &quot;1&quot; : &quot;#pending&quot;, // For pending tasks<br>  &quot;2&quot; : &quot;#inProgress&quot;,<br>  &quot;3&quot; : &quot;#completed&quot;<br>};</pre><h3>Creating Tasks</h3><p>Tasks are created using the following JavaScript function.</p><pre>// Add Task<br>//Guys don&#39;t forget, we are nothing but pencils in the hands<br>//of the feeling.</pre><pre>var generateElement = function(params) {<br>  var parent = $(codes[params.code]),<br>      wrapper;</pre><pre>  if (!parent) {<br>    return;<br>  }</pre><pre>  wrapper = $(&quot;&lt;div /&gt;&quot;, {<br>    &quot;class&quot; : defaults.todoTask,<br>    &quot;id&quot; : defaults.taskId + params.id,<br>    &quot;data&quot; : params.id<br>  }).appendTo(parent);</pre><pre>  $(&quot;&lt;div /&gt;&quot;, {<br>    &quot;class&quot; : defaults.todoHeader,<br>    &quot;text&quot;: params.title<br>  }).appendTo(wrapper);</pre><pre>  $(&quot;&lt;div /&gt;&quot;, {<br>    &quot;class&quot; : defaults.todoDate,<br>    &quot;text&quot;: params.date<br>  }).appendTo(wrapper);</pre><pre>  $(&quot;&lt;div /&gt;&quot;, {<br>    &quot;class&quot; : defaults.todoDescription,<br>    &quot;text&quot;: params.description<br>  }).appendTo(wrapper);<br>};</pre><p>The following code sample shows how a single task is generated.</p><pre>generateElement({<br>  id: &quot;123&quot;,<br>  code: &quot;1&quot;,<br>  title: &quot;Valentine to-do task&quot;,<br>  date: &quot;08/11/2017&quot;,<br>  description: &quot;I have to do a lot of steps to implement this task!&quot;<br>});</pre><h3>Deleting Tasks</h3><p>Removing tasks is fairly simple, and can be accomplished using the following function.</p><pre>var removeElement = function(params) {<br>  $(&quot;#&quot; + defaults.taskId + params.id).remove();<br>};</pre><h3>Saving Tasks in Local Storage</h3><p>The tasks we create could be stored using a database, cookies, or a number of other technologies. However, in this application we’re going to use HTML5’s local storage for its simplicity. In JavaScript, the variable localStorage stores all of this data. The following code sample shows how the to-do list data is retrieved from local storage.</p><pre>var data = JSON.parse(localStorage.getItem(&quot;todoData&quot;));</pre><p>Each task would be stored within the data variable. An example task object is shown below.</p><pre>{<br>  id : id, // Unique ID; timestamp is used here<br>  code: &quot;1&quot;, // Code identifying the category<br>  title: title, // Title of the task<br>  date: date, // Due date<br>  description: description // Description of the task<br>}</pre><p>We update the saved data in local storage using the following code.</p><pre>localStorage.setItem(&quot;todoData&quot;, JSON.stringify(data));</pre><h3>Submitting the To-Do Form</h3><p>When the to-do form is submitted, a new task is created and added to local storage, and the contents of the page are updated. The following function implements this functionality.</p><pre>var addItem = function() {<br>  var inputs = $(&quot;#&quot; + defaults.formId + &quot; :input&quot;),<br>      errorMessage = &quot;Title can not be empty&quot;,<br>      id, title, description, date, tempData;</pre><pre>  if (inputs.length !== 4) {<br>    return;<br>  }</pre><pre>  title = inputs[0].value;<br>  description = inputs[1].value;<br>  date = inputs[2].value;</pre><pre>  if (!title) {<br>    generateDialog(errorMessage);<br>    return;<br>  }</pre><pre>  id = new Date().getTime();</pre><pre>  tempData = {<br>    id : id,<br>    code: &quot;1&quot;,<br>    title: title,<br>    date: date,<br>    description: description<br>  };</pre><pre>  // Saving element in local storage<br>  data[id] = tempData;<br>  localStorage.setItem(&quot;todoData&quot;, JSON.stringify(data));</pre><pre>  // Generate Todo Element<br>  generateElement(tempData);</pre><pre>  // Reset Form<br>  inputs[0].value = &quot;&quot;;<br>  inputs[1].value = &quot;&quot;;<br>  inputs[2].value = &quot;&quot;;<br>};</pre><h3>Implementing Drag and Drop</h3><p>jQuery UI provides drag and drop functionality. We need to make each task draggable and each of the three categories droppable. To delete a task, we need to hide the delete area by default, and show it during the time an item is being dragged. Therefore, we first modify the generateElement() function slightly to first make the to-do list items draggable, and then make the delete area visible when the item is being drug.</p><pre>$(&quot;.&quot; + defaults.todoTask).draggable();</pre><pre>// Add Task<br>var generateElement = function(params) {<br>  wrapper.draggable({<br>    start: function() {<br>      $(&quot;#&quot; + defaults.deleteDiv).show();<br>    },<br>    stop: function() {<br>      $(&quot;#&quot; + defaults.deleteDiv).hide();<br>    }<br>  });<br>...<br>};</pre><p>Secondly, we need to add the droppable() function to each of the categories as the elements are supposed to be dropped in any one of the three areas.</p><pre>// Adding drop function to each category of task<br>$.each(codes, function(index, value) {<br>  $(value).droppable({<br>    drop: function(event, ui) {<br>      var element = ui.helper,<br>          css_id = element.attr(&quot;id&quot;),<br>          id = css_id.replace(options.taskId, &quot;&quot;),<br>          object = data[id];</pre><pre>      // Removing old element<br>      removeElement(object);</pre><pre>      // Changing object code<br>      object.code = index;</pre><pre>      // Generating new element<br>      generateElement(object);</pre><pre>      // Updating Local Storage<br>      data[id] = object;<br>      localStorage.setItem(&quot;todoData&quot;, JSON.stringify(data));</pre><pre>      // Hiding Delete Area<br>      $(&quot;#&quot; + defaults.deleteDiv).hide();<br>    }<br>  });<br>});</pre><p>Thirdly, we need to add some code to delete tasks when they are dropped in the delete area.</p><pre>// Adding drop function to delete div<br>$(&quot;#&quot; + options.deleteDiv).droppable({<br>  drop: function(event, ui) {<br>    var element = ui.helper,<br>        css_id = element.attr(&quot;id&quot;),<br>        id = css_id.replace(options.taskId, &quot;&quot;),<br>        object = data[id];</pre><pre>    // Removing old element<br>    removeElement(object);</pre><pre>    // Updating local storage<br>    delete data[id];<br>    localStorage.setItem(&quot;todoData&quot;, JSON.stringify(data));</pre><pre>    // Hiding Delete Area<br>    $(&quot;#&quot; + defaults.deleteDiv).hide();<br>  }<br>});</pre><h3><strong>Reference : shaumik Daityari</strong></h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f287bd95d4dd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Skills You Need to Be a Backend Developer]]></title>
            <link>https://medium.com/@elijahvalentinetroyabako/the-skills-you-need-to-be-a-backend-developer-b186b49a6a0e?source=rss-dd9f2ed9f7b6------2</link>
            <guid isPermaLink="false">https://medium.com/p/b186b49a6a0e</guid>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Valentine Troy Abako]]></dc:creator>
            <pubDate>Thu, 02 Nov 2017 17:47:27 GMT</pubDate>
            <atom:updated>2017-11-02T17:47:27.184Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*P9XQje1TO9DjuF-OcFL9kA.jpeg" /><figcaption>Valentine Elijah Abako (Software Engineer at <strong>VerifyMe Nigeria</strong>)</figcaption></figure><p>Thinking about moving into the flourishing field of web development?</p><p>As you may already know, there are three types of web developers:</p><ul><li>Front end</li><li>Backend</li><li>And full stack (which combines both)</li></ul><p>Below I will focus solely on backend developers by looking at what they do, the skills required to become a backend developer, and how you can get ultimately become one.</p><h3>What Does a Backend Developer Do?</h3><p>Backend developers are responsible for building out the “server side” in web applications.</p><p>AKA everything that happens before hitting your browser — which is known as the “client side.” (Typically <a href="https://www.thebalance.com/core-skills-to-master-for-front-end-developers-2071283">front end developers</a> are responsible for creating the experience on the client side.)</p><p>While backend developers focus on the inner workings of web applications, they still work hand-in-hand with front-end developers by giving the outward facing web application elements server side logic.</p><p>Backend developer adds this logic by using a server side scripting language like Ruby or <a href="http://learntocodewith.me/getting-started/topics/php/">PHP</a>.</p><p>Aside from making web applications functional, backend developers are also responsible for optimizing the application for speed and efficiency.</p><p>Moreover, backend developers often create a data storage solution with a database.</p><p>The <strong>database</strong> is a crucial component for all web applications for it stores information (like users, comments, posts, etc. ). Common databases include MySQL, MongoDB, and PostgreSQL.</p><h3>Who Does a Backend Developer Work With?</h3><p>Backend developers typically work in teams with others.</p><p>Even within a larger team, there is generally a design, <a href="http://learntocodewith.me/web-dev/front-end-developer-skills/">front end</a> (engineers, <a href="https://www.thebalance.com/career-spotlight-ux-designer-2071282">UX architects</a>, etc.), and then a backend team.</p><p>As far as backend teams go, back-end developers work alongside software engineers. One could do just <a href="http://www.restapitutorial.com/">REST API</a> development or related. Another could be a quality assurance (QA), engineer.</p><p>As you see, even within the backend there are different duties.</p><h3>What Skills/Technologies Must I Know to Become a Backend Developer?</h3><p>Using the <a href="https://www.toptal.com/back-end/job-description">Toptal backend job description template</a> as a reference, below are some of the core skills and technologies a backend developer must know.</p><ul><li>Proficient knowledge of the back-end programming language/framework that the given company relies upon</li><li>Understanding of <a href="https://www.thebalance.com/core-skills-to-master-for-front-end-developers-2071283">front-end web technologies</a> like HTML, CSS, and JavaScript (to communicate with team members on the front end)</li><li>Ability to manage a hosting environment, including database administration as well as scaling applications to handle load changes</li><li>Knowledge of accessibility and security compliance</li><li>Experience with version control, such as Git</li></ul><h3>Where Can I Learn These Backend Skills?</h3><p>Most backend developers and those working on the backend team have formal training in one way or another. AKA a computer science (CS) degree.</p><p>Compared to front-end developers, back-end developers may have to do more <a href="https://www.techopedia.com/definition/3736/abstraction">abstraction</a>. They could be data mining, writing abstract algorithms, and so forth. <em>That’s why a formal CS degree comes in handy.</em></p><p>Nevertheless, if you’re beyond your college years, there are both in-person courses (or boot camps) and online options available to prepare you for a career in backend development.</p><p><strong>In-person Backend Development Courses</strong></p><p>Of course, when doing a face-to-face course location is everything.</p><p>The best way to find an in-person backend development course near you is through online research.</p><p>However, here are two suggestions to get the ball rolling:</p><ul><li><a href="https://generalassemb.ly/education/back-end-web-development"><strong>General Assembly</strong></a> has a 10-week backend development course</li><li><a href="https://betamore.com/academy/full-stack-web-development/"><strong>Betamore</strong></a> has a 12-week backend course (which is part-time)</li></ul><p>In-person boot camps/courses aren’t cheap. But they are more affordable than a formal CS degree. (Plus, unlike online classes, you have the luxury of being able to interact with peers and an instructor.)</p><p><strong>Online Backend (Or Full Stack) Learning Options</strong></p><p>It is not as easy to find backend-only online courses. Most teach full stack — so both the front and backend.<strong> </strong>Nonetheless, here are some online course options to consider:</p><ul><li><a href="https://www.udacity.com/course/full-stack-web-developer-nanodegree--nd004"><strong>Udacity</strong></a> has a full stack nano degree, with backend development emphasis</li><li><a href="https://www.bloc.io/web-development-bootcamp"><strong>Bloc.io</strong></a> has a full stack online course, too, with one-on-one mentorship</li><li><strong>Udemy</strong> has a variety of online course options, including <a href="https://www.udemy.com/refactoru-adv-backend-dev/">backend development</a>(make sure to read the reviews on Udemy before signing up)</li></ul><h3>Conclusion</h3><p>In the end, backend developers play a critical role in web development teams. They are responsible for handling data storage and ensuring content gets delivered to the front end. In fact they are the main system. they handle 70% of the system implementation.</p><p><em>If you know someone thinking about transitioning into web development, make sure to share this article to them. peace…</em></p><p>Reference : <a href="https://www.thebalance.com/laurence-bradford-2070890">Laurence Bradford</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b186b49a6a0e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Reset the permissions of /usr/local and Homebrew’s caches to the current user:]]></title>
            <link>https://medium.com/@elijahvalentinetroyabako/reset-the-permissions-of-usr-local-and-homebrews-caches-to-the-current-user-4ab15e6a3914?source=rss-dd9f2ed9f7b6------2</link>
            <guid isPermaLink="false">https://medium.com/p/4ab15e6a3914</guid>
            <category><![CDATA[homebrew]]></category>
            <dc:creator><![CDATA[Valentine Troy Abako]]></dc:creator>
            <pubDate>Wed, 09 Aug 2017 08:34:22 GMT</pubDate>
            <atom:updated>2017-08-09T08:34:22.434Z</atom:updated>
            <content:encoded><![CDATA[<p>Hey guys, Are you trying to install redis on your Mac and you are running into a permission error? if so, this tutorial is for you. if not just take a glass of water and archive it, you might need it someday.</p><p>In this tutorial <strong>Valentine E. Abako</strong> is trying to start redis service using homebrew on his mac, but he has encounter an error due to permission issues.</p><p>The screenshot below will only occur when redis is not in the current user directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2yJfh4tIA1taUkz3B3e_9w.png" /><figcaption>Screenshot of permission error on Valentine Abako Terminal.</figcaption></figure><p><strong>How to solve the redis permission issue on Mac.</strong></p><p>run the following on the terminal (Mac users only).</p><p><strong><em>sudo chown -R $USER:admin /usr/local /Library/Caches/Homebrew</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/723/1*yhOzljUaPwq8yInlYzfw8A.png" /></figure><p>Redis should be on the current user directory now. if you are able to see the screen below then you are fine now.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LYuvE0tah3PkPqZtlMgWyQ.png" /><figcaption>Brew updating</figcaption></figure><p>yesssss…..we are fine now.</p><p><strong>Start Redis services using brew</strong></p><p>Please run the following command in the terminal.</p><p><strong><em>brew services start redis</em></strong></p><p><strong>Test redis if it running</strong></p><p><strong><em>redis-cli ping</em></strong></p><p>You should see a PONG on your terminal. once seen You are fine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/502/1*MNvAutyL1hYzAiuJz9USuQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4ab15e6a3914" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CLOUDINARY SERVICE AND PHP]]></title>
            <link>https://medium.com/@elijahvalentinetroyabako/cloudinary-service-and-php-eb57ae7082e6?source=rss-dd9f2ed9f7b6------2</link>
            <guid isPermaLink="false">https://medium.com/p/eb57ae7082e6</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Valentine Troy Abako]]></dc:creator>
            <pubDate>Sat, 20 May 2017 07:58:16 GMT</pubDate>
            <atom:updated>2017-05-20T07:58:16.489Z</atom:updated>
            <content:encoded><![CDATA[<h3><a href="http://cloudinary.com/documentation/solution_overview#introduction">Introduction</a></h3><p><em>“Cloudinary is a Software-as-a-Service (SaaS) solution for managing all your web or mobile application’s media assets in the cloud. Cloudinary offers an end-to-end solution for all your image and video needs, including upload, storage, administration, manipulation and delivery. Media upload, processing, and delivery are done on Cloudinary’s servers and automatically scale for handling high load and bursts of traffic.”</em></p><h3><a href="http://cloudinary.com/documentation/solution_overview#the_cloudinary_solution">The Cloudinary solution</a></h3><p>Resources are uploaded, managed, and transformed using Cloudinary’s <a href="http://cloudinary.com/console">Management Console</a> and easy to use APIs, and delivered from high-performance servers through Content Delivery Networks (CDNs). While you can use Cloudinary’s APIs directly within your own custom code, it is simpler (and recommended) to use one of Cloudinary’s client libraries (SDKs), which wrap the Cloudinary APIs and simplify integration with web sites and mobile applications.</p><p>Here is a quick example of how cloudinary service works, the single line of code needed to upload an image to your Cloudinary account, and then the single line of code to deliver the image to your users (including on-the-fly transformations). Although you can use several technologies to interact with cloudinary , in this article I will be using PHP.</p><p>Upload an image from the remote URL <strong>http://www.example.com/sample.jpg</strong>, and set its public_id (identifier) as <strong>sample_woman</strong>:</p><pre><strong>\Cloudinary\Uploader::upload(&quot;http://www.example.com/sample.jpg&quot;, <br>  array(&quot;public_id&quot; =&gt; &quot;sample_woman&quot;));</strong></pre><p><strong>code Description</strong></p><p>Deliver the <strong>sample_image</strong> with the following on-the-fly transformations:</p><ul><li>Cropped to to a width of 400 pixels and a height of 350 pixels and automatically focused on the largest face in the image.</li><li>Rounded corners with a radius of 20 pixels.</li><li>A 5 pixel wide black border.</li><li>The <strong>cloudinary_icon</strong> image added as an overlay: scaled to 25% of the width of the main image, placed 10 pixels away (vertically and horizontally) from the northeast corner, and with 50% opacity.</li><li>Automatic quality encoding for minimizing the file size while maintaining good visual quality.</li><li>Automatic image format selection based on the viewers browser: WebP to Chrome/Opera, JPEG-XR to Internet Explorer, and JPEG to all others.</li></ul><pre><strong>cl_image_tag(&quot;sample_woman.jpg&quot;, array(&quot;transformation&quot;=&gt;array(<br>  array(&quot;width&quot;=&gt;400, &quot;height&quot;=&gt;350, &quot;gravity&quot;=&gt;&quot;face&quot;, &quot;crop&quot;=&gt;&quot;crop&quot;),<br>  array(&quot;radius&quot;=&gt;20, &quot;border&quot;=&gt;&quot;5px_solid_black&quot;),<br>  array(&quot;overlay&quot;=&gt;&quot;cloudinary_icon&quot;, &quot;opacity&quot;=&gt;50, &quot;width&quot;=&gt;0.25, &quot;flags&quot;=&gt;&quot;relative&quot;, &quot;gravity&quot;=&gt;&quot;north_east&quot;, &quot;y&quot;=&gt;10, &quot;x&quot;=&gt;10),<br>  array(&quot;quality&quot;=&gt;&quot;auto&quot;, &quot;fetch_format&quot;=&gt;&quot;auto&quot;)<br>  )))</strong></pre><h3><a href="http://cloudinary.com/documentation/solution_overview#key_benefits_for_developers">Key benefits for developers</a></h3><p>The Cloudinary solution offers many features and benefits for managing your resources in the cloud. Some of the main benefits to developers are:</p><ul><li>Eliminate media related R&amp;D work from your IT and DevOps departments, and reduce your costs by up to 90%.</li><li>Use one-liners for easy integration within your development framework.</li><li>Cutting edge image manipulation features.</li><li>Decrease the time to market of new products.</li><li>Cloud based media library and APIs for upload, delivery and administration.</li><li>Improved user experience: your site looks great and loads fast on any device.</li></ul><h3><a href="http://cloudinary.com/documentation/solution_overview#service_architecture">Service architecture</a></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/757/0*TEOrBA8vXtywC5Sh.jpg" /></figure><h3><a href="http://cloudinary.com/documentation/php_integration#quick_example">Quick example</a></h3><p>Take a look at the following Cloudinary URL that generates the image below:</p><p><a href="http://res.cloudinary.com/demo/image/upload/w_150,h_150,c_thumb,g_face,r_20,e_sepia/l_cloudinary_icon,g_south_east,x_5,y_5,w_50,o_60,e_brightness:200/a_10/front_face.png"><strong>http://res.cloudinary.com/demo/image/upload/w_150,h_150,c_thumb,g_face,r_20,e_sepia/l_cloudinary_icon,g_south_east,x_5,y_5,w_50,o_60,e_brightness:200/a_10/front_face.png</strong></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/174/0*3qJJZu7sT5-BE2K6.png" /><figcaption>174x174 PNG</figcaption></figure><p>Simply accessing the above URL told Cloudinary to transform an uploaded image, create a 150x150px thumbnail using face detection based cropping, round the image’s corners, add a sepia effect, convert it to a transparent PNG format, add a watermark layer, rotate the image by 10 degrees and ultimately delivered the resulting image through a fast CDN using smart caching techniques.</p><h3><a href="http://cloudinary.com/documentation/php_integration#php_library_features">PHP Library Features</a></h3><p>Cloudinary provides an <a href="https://github.com/cloudinary/cloudinary_php">open source PHP library</a> for further simplifying the integration:</p><ul><li>Build URLs for transformation &amp; manipulation.</li><li>PHP view helper methods for embedding and transforming.</li><li>API wrappers: upload, administration, sprite generation and more.</li><li>Direct uploading from the browser using a jQuery plugin.</li></ul><p>The library was tested with <strong>PHP 5.3</strong> and <strong>PHP 5.4</strong>. Cloudinary’s PHP library is based on a generic code that can be used with PHP frameworks such as <strong>Yii</strong>, <strong>CodeIgniter</strong>, <strong>CakePHP</strong>, <strong>Zend</strong>, <strong>Symfony, Slim frame, Laravel </strong>and others.</p><h3><a href="http://cloudinary.com/documentation/php_integration#php_getting_started_guide">PHP — Getting started guide</a></h3><h3><a href="http://cloudinary.com/documentation/php_integration#installation">Installation</a></h3><p>Cloudinary’s PHP integration library is available as an open-source PHP code. You can download the latest sources from the following link:</p><p><a href="https://github.com/cloudinary/cloudinary_php/tarball/master">https://github.com/cloudinary/cloudinary_php/tarball/master</a></p><p>Copy all files from the <strong>src</strong> folder into your PHP project and include Cloudinary’s PHP classes in your code:</p><pre><strong>require &#39;Cloudinary.php&#39;;<br>require &#39;Uploader.php&#39;;<br>require &#39;Api.php&#39;;</strong></pre><p>If you use <strong>Composer</strong> to manage your PHP library dependency, you can install Cloudinary’s PHP library directly from the <a href="https://packagist.org/">Packagist</a> repository. Update your <strong>composer.json</strong> file as follows:</p><pre><strong>{<br>  &quot;require&quot;: {<br>    &quot;cloudinary/cloudinary_php&quot;: &quot;dev-master&quot;<br>  }<br>}</strong></pre><p>Automatically install dependencies including Cloudinary’s PHP package:</p><pre><strong>php composer.phar install</strong></pre><ul><li><a href="https://github.com/cloudinary/cloudinary_php"><strong>https://github.com/cloudinary/cloudinary_php</strong></a></li><li><a href="https://packagist.org/packages/cloudinary/cloudinary_php"><strong>https://packagist.org/packages/cloudinary/cloudinary_php</strong></a></li></ul><h3><a href="http://cloudinary.com/documentation/php_integration#configuration">Configuration</a></h3><p>Your <strong>cloud_name</strong> account parameter is required to build URLs for your media assets. <strong>api_key</strong> and <strong>api_secret</strong> are further needed to perform secure API calls to Cloudinary (e.g., image and video uploads). See <a href="http://cloudinary.com/documentation/solution_overview#account_and_api_setup">Account and API setup</a> for more details.</p><p>Setting the configuration parameters can be done either programmatically in each call to a Cloudinary method or globally using an environment variable or the <strong>config</strong> method.</p><p>You can find your configuration parameters in the dashboard of our <a href="https://cloudinary.com/console">Management Console</a>.</p><p>Here’s an example of setting configuration parameters globally in your PHP application:</p><pre><strong>\Cloudinary::config(array( <br>  &quot;cloud_name&quot; =&gt; &quot;sample&quot;, <br>  &quot;api_key&quot; =&gt; &quot;874837483274837&quot;, <br>  &quot;api_secret&quot; =&gt; &quot;a676b67565c6767a6767d6767f676fe1&quot; <br>));</strong></pre><p>See <a href="http://cloudinary.com/documentation/php_additional_topics#configuration_options">Configuration Options</a> for more details and additional configuration methods.</p><h3><a href="http://cloudinary.com/documentation/php_integration#upload_media_assets">Upload media assets</a></h3><p>You can upload images, videos or <a href="http://cloudinary.com/blog/using_cloudinary_to_manage_all_your_website_s_assets_in_the_cloud">any other files</a> from your PHP server. Uploading is done over HTTPS using a secure protocol based on the api_key and api_secret parameters you provide.</p><p>The following command uploads a local file to Cloudinary:</p><pre><strong>\Cloudinary\Uploader::upload(&quot;/home/my_image.jpg&quot;)</strong></pre><p>Alternatively, you can a specify a local path, a public HTTP URL, an S3 URL or an actual resource file’s data. For example:</p><pre><strong>\Cloudinary\Uploader::upload(&quot;http://www.example.com/image.jpg&quot;)</strong></pre><p>Each resource uploaded to Cloudinary is assigned a unique <strong>Public ID</strong> and is available for immediate delivery and transformation. The upload method returns an associative array with content similar to that shown in the following example:</p><pre><strong>Array<br>(<br>    [public_id] =&gt; sample<br>    [version] =&gt; 1312461204<br>    [width] =&gt; 864<br>    [height] =&gt; 576<br>    [format] =&gt; jpg<br>    [bytes] =&gt; 120253<br>    [url] =&gt; </strong><a href="http://res.cloudinary.com/demo/image/upload/v1371281596/sample.jpg"><strong>http://res.cloudinary.com/demo/image/upload/v1371281596/troy.jpg</strong></a><strong><br>    [secure_url] =&gt; </strong><a href="https://res.cloudinary.com/demo/image/upload/v1371281596/sample.jpg"><strong>https://res.cloudinary.com/demo/image/upload/v1371281596/troy.jpg</strong></a><strong><br>)</strong></pre><p>As you can see in the following example, with a single call you can define your own Public ID, apply an incoming transformation before storing the resource file in the cloud, generate derived versions of the resource eagerly and assign tags to uploaded resources:</p><pre><strong>\Cloudinary\Uploader::upload($_FILES[&quot;file&quot;][&quot;tmp_name&quot;],<br>    array(<br>       &quot;public_id&quot; =&gt; &quot;sample_id&quot;,<br>       &quot;crop&quot; =&gt; &quot;limit&quot;, &quot;width&quot; =&gt; &quot;2000&quot;, &quot;height&quot; =&gt; &quot;2000&quot;,<br>       &quot;eager&quot; =&gt; array(<br>         array( &quot;width&quot; =&gt; 200, &quot;height&quot; =&gt; 200, <br>                &quot;crop&quot; =&gt; &quot;thumb&quot;, &quot;gravity&quot; =&gt; &quot;face&quot;,<br>                &quot;radius&quot; =&gt; 20, &quot;effect&quot; =&gt; &quot;sepia&quot; ),<br>         array( &quot;width&quot; =&gt; 100, &quot;height&quot; =&gt; 150, <br>                &quot;crop&quot; =&gt; &quot;fit&quot;, &quot;format&quot; =&gt; &quot;png&quot; )<br>       ),                                     <br>       &quot;tags&quot; =&gt; array( &quot;special&quot;, &quot;for_homepage&quot; )<br>    ));</strong></pre><p>Many more upload options as well as direct uploading from the browser are detailed here: <a href="http://cloudinary.com/documentation/php_image_upload">PHP image upload</a> and <a href="http://cloudinary.com/documentation/php_video_upload">PHP video upload</a>.</p><h3><a href="http://cloudinary.com/documentation/php_integration#display_and_manipulate_images_and_video">Display and manipulate images and video</a></h3><p>Adding images and video to your PHP view is quite straightforward. Just use the <strong>cl_image_tag</strong> or <strong>cl_video_tag</strong> helper method. This method generates the full source URL based on the given parameters and adds the image to your HTML code:</p><p>For example, displaying the uploaded image with the <strong>sample</strong> public ID, while providing an alternate text:</p><pre><strong>&lt;?php echo cl_image_tag(&quot;troy.jpg&quot;, array( &quot;alt&quot; =&gt; &quot;Sample Image&quot; )); ?&gt;</strong></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/160/1*kzoaiVJeuxQh4cVO6wGOyw.jpeg" /><figcaption>664x476 JPG (Scaled down)</figcaption></figure><p>Now, let’s say that you wish to display a small thumbnail of this uploaded image. Simply add the transformation instructions to your call. For example, displaying the ‘sample’ image transformed to fill a <strong>100x150</strong> rectangle:</p><pre><strong>&lt;?php echo cl_image_tag(&quot;sample.jpg&quot;, <br>                        array( &quot;width&quot; =&gt; 100, &quot;height&quot; =&gt; 150, &quot;crop&quot; =&gt; &quot;fill&quot; )); ?&gt;</strong></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/96/1*FIlbaEd4fJt7mkVa6U-vpQ.jpeg" /><figcaption>100x150 JPG</figcaption></figure><p>This is equivalent to:</p><pre><strong>&lt;img src=&#39;http://res.cloudinary.com/demo/image/upload/c_fill,h_150,w_100/troy.jpg&#39; <br>     width=&#39;100&#39; height=&#39;150&#39; /&gt;</strong></pre><p>Using simple parameters you can perform powerful manipulations. The PHP library builds Cloudinary URLs that you can embed in your web and mobile views for dynamically transforming your uploaded resources in the cloud and delivering the results through a <strong>fast CDN</strong> with advanced caching.</p><p>You can easily convert formats, resize, perform face detection-based image cropping, apply effects and filters, append textual layers or watermarks and more.</p><p>The following command, for example, embeds a JPG thumbnail of a profile photo fetched from Facebook in real-time, crops it to a circle, applies a sepia effect and delivers it optimized through a CDN:</p><pre><strong>&lt;?php echo facebook_profile_image_tag(&quot;billclinton.jpg&quot;, <br>             array( <br>               &quot;width&quot; =&gt; 90, &quot;height&quot; =&gt; 98, <br>               &quot;crop&quot; =&gt; &quot;fill&quot;, &quot;gravity&quot; =&gt; &quot;face&quot;,<br>               &quot;radius&quot; =&gt; &quot;max&quot;, &quot;effect&quot; =&gt; &quot;sepia&quot;<br>             )); ?&gt;</strong></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/90/0*2n78UsifX9AMyRmF.jpg" /><figcaption>90x98 JPG</figcaption></figure><p>For more information about supported transformations and their usage, refer to <a href="http://cloudinary.com/documentation/image_transformations">Image transformations</a> and <a href="http://cloudinary.com/documentation/video_manipulation_and_delivery">Video manipulation and delivery</a>.</p><p>For more details about Cloudinary’s image transformation and manipulation in PHP, see <a href="http://cloudinary.com/documentation/php_image_manipulation">PHP image manipulation</a> and<a href="http://cloudinary.com/documentation/php_video_manipulation">PHP video manipulation</a>.</p><h3><a href="http://cloudinary.com/documentation/php_integration#sample_projects">Sample projects</a></h3><p>To find additional useful code samples and learn how to integrate Cloudinary with your PHP applications, take a look at cloudinary <a href="https://github.com/cloudinary/cloudinary_php/tree/master/samples">Sample Projects</a>.</p><p><strong>Basic PHP sample:</strong> Uploading local and remote images to Cloudinary and generating various transformation URLs.</p><p><strong>PHP Photo Album:</strong> A fully working web application that allows you to uploads photos, maintain a database with references to them, list them with their metadata, and display them using various cloud-based transformations. Image uploading is performed both from the server side and directly from the browser using a jQuery plugin. See cloudinary</p><ul><li><a href="https://github.com/cloudinary/cloudinary_php/tree/master/samples"><strong>https://github.com/cloudinary/cloudinary_php/tree/master/samples</strong></a></li></ul><h3><a href="http://cloudinary.com/documentation/php_integration#what_s_next">What’s next</a></h3><p>why hit or query the database always when you have a service that can handle that. try Cloudinary service today, upload media files of any size and leave the rest to Cloudinary to handle. To see a detail view of how cloudinary service integrate with other framework see. <a href="http://cloudinary.com/documentation/solution_overview#framework_integration_and_migration">http://cloudinary.com/documentation/solution_overview#framework_integration_and_migration</a></p><p>Browse <a href="http://cloudinary.com/documentation/php_additional_topics">additional PHP integration topics</a>: configuration, Admin API, etc.</p><p>Stay tuned for updates, tips and tutorials: <a href="http://cloudinary.com/blog">Blog</a>, <a href="https://twitter.com/cloudinary">Twitter</a>, <a href="http://www.facebook.com/Cloudinary">Facebook</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eb57ae7082e6" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>