<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Temidayo Ajisebutu</title>
    <description>The latest articles on DEV Community by Temidayo Ajisebutu (@sirbootoo).</description>
    <link>https://dev.to/sirbootoo</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F55288%2Fb75f28ea-ea99-4f4a-a0d9-5d525d672cf1.PNG</url>
      <title>DEV Community: Temidayo Ajisebutu</title>
      <link>https://dev.to/sirbootoo</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sirbootoo"/>
    <language>en</language>
    <item>
      <title>Demystifying Database Security: A Guide to Teaching Non-Experts</title>
      <dc:creator>Temidayo Ajisebutu</dc:creator>
      <pubDate>Wed, 04 Oct 2023 22:48:17 +0000</pubDate>
      <link>https://dev.to/sirbootoo/demystifying-database-security-a-guide-to-teaching-non-experts-4a55</link>
      <guid>https://dev.to/sirbootoo/demystifying-database-security-a-guide-to-teaching-non-experts-4a55</guid>
      <description>&lt;p&gt;In today's data-driven world, the importance of database security cannot be overstated. Databases store valuable information, and safeguarding this data is a top priority for any organization. While database security may seem like a complex subject reserved for experts, it's crucial to educate non-experts about it as well. In this article, we'll explore effective strategies for teaching database security to individuals who may not have a deep technical background.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Start with the Basics&lt;/strong&gt;&lt;br&gt;
Before diving into the intricacies of database security, establish a solid foundation. Explain what a database is, its role in an organization, and the types of data it stores. Use simple, non-technical language to ensure everyone understands the fundamental concepts.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Emphasize the Value of Data&lt;/strong&gt;&lt;br&gt;
Help non-experts understand the value of the data stored in databases. Explain how data breaches can lead to financial losses, reputation damage, and legal consequences. This context will motivate them to take database security seriously.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Identify Common Threats&lt;/strong&gt;&lt;br&gt;
Introduce common threats to database security, such as SQL injection, data leaks, and unauthorized access. Use real-world examples and case studies to illustrate the potential consequences of these threats.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Explain Access Control&lt;/strong&gt;&lt;br&gt;
Simplify the concept of access control by comparing it to physical security. Just as you need keys or authorization to enter a restricted area, databases require proper authentication and authorization. Describe user roles, permissions, and the principle of least privilege.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Password Management&lt;/strong&gt;&lt;br&gt;
Highlight the importance of strong, unique passwords for database accounts. Provide practical tips on creating and managing secure passwords. Emphasize the risks of password reuse and the benefits of using password management tools.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. Encryption&lt;/strong&gt;&lt;br&gt;
Demystify encryption by explaining how it protects data at rest and in transit. Use analogies like a locked safe (data at rest) and a secure phone line (data in transit) to illustrate the concept.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7. Secure Coding Practices&lt;/strong&gt;&lt;br&gt;
For non-technical individuals involved in software development, stress the significance of secure coding practices. Teach them about input validation, parameterized queries, and prepared statements to prevent SQL injection attacks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;8. Regular Updates and Patching&lt;/strong&gt;&lt;br&gt;
Simplify the importance of keeping database software and applications up-to-date. Compare it to updating your computer's operating system or smartphone apps to ensure security.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;9. Monitoring and Auditing&lt;/strong&gt;&lt;br&gt;
Explain the role of monitoring and auditing in database security. Show how regular log analysis can detect suspicious activities and potential breaches.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;10. Practical Exercises&lt;/strong&gt;&lt;br&gt;
Engage learners with hands-on exercises. Use training platforms or simulate scenarios where they can practice implementing security measures, setting access controls, and responding to security incidents.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;11. Case Studies and Examples&lt;/strong&gt;&lt;br&gt;
Share real-world database security breaches and their consequences. Analyze what went wrong and how better security practices could have prevented these incidents.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;12. Resources and References&lt;/strong&gt;&lt;br&gt;
Provide non-experts with a list of trusted resources, including books, articles, online courses, and security tools. Encourage them to continue learning and staying updated on database security best practices.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;br&gt;
Teaching database security to non-experts is not only feasible but also essential in today's interconnected world. By breaking down complex concepts into simpler terms, emphasizing the importance of data protection, and providing practical examples and exercises, you can empower individuals from various backgrounds to contribute to the security of their organization's databases. In a time when data breaches are a growing concern, spreading awareness and knowledge about database security is a crucial step towards a safer digital landscape.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Sourcing for funds ain’t your problem, your customers are</title>
      <dc:creator>Temidayo Ajisebutu</dc:creator>
      <pubDate>Mon, 27 Aug 2018 09:57:12 +0000</pubDate>
      <link>https://dev.to/sirbootoo/sourcing-for-funds-aint-your-problem-your-customers-are-1e5j</link>
      <guid>https://dev.to/sirbootoo/sourcing-for-funds-aint-your-problem-your-customers-are-1e5j</guid>
      <description>&lt;p&gt;All I have seen majorly in Nigeria is either people sourcing for funds or looking for cheap labor. Yes It is great to seek for funds but you don’t do that when your start up is just a new born baby.&lt;/p&gt;

&lt;p&gt;Your primary focus should be problem solving not funds seeking. This which I see is a major reason why Nigerian start ups fail. They all think it’s all about the money, it’s not, yeah you would make a ton of money at the end of the day.&lt;/p&gt;

&lt;p&gt;Please don’t shift your focus from making your customers happy to making your pocket happy. Your customers give you the required money you need at the end of the day not your investor. All your investor does is to kick start your business (And by kick starting I mean they just help you with your primary funds just after they see that you have a good product and see that you and your business are scalable ).&lt;/p&gt;

&lt;p&gt;The technologies and strategies used for proper development of businesses are more important than the funding at the cradle stage of a business. By the way investors will only invest in something that works.&lt;/p&gt;

&lt;p&gt;For example look at Hotels.ng, Mark Essien didn’t sit and wait for investments before figuring out Hotels.ng. He did his work.&lt;/p&gt;

&lt;p&gt;Another thing is User Research, have you considered who will use your platform ? To understand this you have to carry out Design Sprints, Prototype testing and all before coming out to seek for funds.&lt;/p&gt;

&lt;p&gt;I have a philosophy that if you are not as confident as the CEO of the American Start Up Party On Demand, you haven’t finished your research work.&lt;/p&gt;

</description>
      <category>startup</category>
      <category>customers</category>
      <category>nigeria</category>
    </item>
    <item>
      <title>Using Algolia Instantsearch with Angular 6.</title>
      <dc:creator>Temidayo Ajisebutu</dc:creator>
      <pubDate>Tue, 14 Aug 2018 21:16:10 +0000</pubDate>
      <link>https://dev.to/sirbootoo/using-algolia-instantsearch-with-angular-6-2ef5</link>
      <guid>https://dev.to/sirbootoo/using-algolia-instantsearch-with-angular-6-2ef5</guid>
      <description>

&lt;p&gt;Hey ladies and gentlemen of all ages,&lt;/p&gt;

&lt;p&gt;This will be the third post I have written concerning Algolia. The journey so far has been great following up with Algolia Instantsearch and Angular. And no, I am not an employee of Algolia just a fanboy that loves what they do.&lt;/p&gt;

&lt;p&gt;So let’s dive right into the tutorial. Some couple of weeks back Algolia dropped an update which supported Angular 5 and 6 and trust me it is amazing and super simple&lt;/p&gt;

&lt;p&gt;We will start by installing Angular CLI&lt;/p&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;npm&lt;/span&gt; &lt;span class="nx"&gt;install&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;g&lt;/span&gt; &lt;span class="nx"&gt;angular&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;cli&lt;/span&gt;&lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;6&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;After which we will create a new project called ng-algolia&lt;/p&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;ng&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;ng&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;algolia&lt;/span&gt; 
&lt;span class="nx"&gt;cd&lt;/span&gt; &lt;span class="nx"&gt;ng&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;algolia&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;we then move into the project after which it’s done creating and installing all the necessary packages. After that we install the angular-instantsearch package for what we need to do&lt;/p&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;npm&lt;/span&gt; &lt;span class="nx"&gt;install&lt;/span&gt; &lt;span class="nx"&gt;angular&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;instantsearch&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="nx"&gt;save&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;After the installation is complete we can dive into the code. To make the package work we will have to import &lt;code&gt;NgAisModule&lt;/code&gt; into &lt;code&gt;app/src/app.module.ts&lt;/code&gt; file.&lt;/p&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;NgAisModule&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s1"&gt;'angular-instantsearch'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;  
&lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;NgModule&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;   
     &lt;span class="na"&gt;declarations&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;AppComponent&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;...],&lt;/span&gt;   
     &lt;span class="na"&gt;imports&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;NgAisModule&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;forRoot&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="p"&gt;...],&lt;/span&gt;      
     &lt;span class="na"&gt;bootstrap&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;AppComponent&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;                            
&lt;span class="p"&gt;})&lt;/span&gt; 
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nx"&gt;AppModule&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;We add &lt;code&gt;NgAisModule.forRoot()&lt;/code&gt; to the App Module because it is the root module, if you are using it in a shared module (Which means any other module which is not the root module of the application.) you will have to omit .forRoot() .&lt;/p&gt;

&lt;p&gt;Algolia has been kind enough to provide styling for us. to get the Algolia styling we will have to insert the below code into our angular.json in the apps &amp;gt; styles array:&lt;/p&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="s2"&gt;"styles"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="s2"&gt;"node_modules/angular-instantsearch/bundles/instantsearch.min.css"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;"node_modules/angular-instantsearch/bundles/instantsearch-theme-algolia.min.css"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;"styles.css"&lt;/span&gt;
  &lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Then you need to update the file named polyfills.ts to add the below code to the bottom of your code (That is, After all the comments 😉 ).&lt;/p&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;window&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nx"&gt;any&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;process&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;env&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;DEBUG&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;undefined&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;So after all the importation and copy and paste we can now use the Algolia Instantsearch widgets (Hooray!!! 🙌 ).&lt;/p&gt;

&lt;p&gt;I remember saying that this is simple right ? you will see why now. All you need to do can be done in your HTMLfile.&lt;/p&gt;

&lt;p&gt;First we will start with the  node which is the parent node that enables the connection with Algolia.&lt;/p&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;ais-instantsearch
  [config]="{
    apiKey: '6be0576ff61c053d5f9a3225e2a90f76',
    appId: 'latency',
    indexName: 'instant_search',
    routing: true
  }"
&amp;gt;
&amp;lt;/ais-instantsearch&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;The apikey, appId, IndexName can be gotten from your Algolia dashboard.&lt;/p&gt;

&lt;p&gt;Now let’s add the search box (&lt;code&gt;&amp;lt;ais-search-box&amp;gt;&lt;/code&gt;) and the result list which is &lt;code&gt;&amp;lt;ais-hits&amp;gt;&lt;/code&gt; we need.&lt;/p&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;ais-instantsearch [config]="{...}"&amp;gt;
  &amp;lt;ais-search-box&amp;gt;&amp;lt;/ais-search-box&amp;gt;
  &amp;lt;ais-hits&amp;gt;&amp;lt;/ais-hits&amp;gt;
&amp;lt;/ais-instantsearch&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;The above will return the default format of results, which you have in your Algolia dashboard, to get a personalized and customized result you can use this:&lt;/p&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;ais-hits&amp;gt;
  &amp;lt;ng-template let-hits="hits"&amp;gt;
    &amp;lt;div *ngFor="let hit of hits"&amp;gt;
      Hit {{hit.objectID}}: {{hit.name}}
    &amp;lt;/div&amp;gt;
  &amp;lt;/ng-template&amp;gt;
&amp;lt;/ais-hits&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;One very important aspect of the search is highlightning the matching parts of the results. We can use the  widget to do that for you:&lt;/p&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;ais-hits&amp;gt;
  &amp;lt;ng-template let-hits="hits"&amp;gt;
    &amp;lt;div *ngFor="let hit of hits"&amp;gt;
      Hit {{hit.objectID}}:
      &amp;lt;ais-highlight attribute="name" [hit]="hit"&amp;gt;
      &amp;lt;/ais-highlight&amp;gt;
    &amp;lt;/div&amp;gt;
  &amp;lt;/ng-template&amp;gt;
&amp;lt;/ais-hits&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;While the Search Box is the way to go when it comes to textual search, you may also want to provide filters based on the structure of the records.&lt;/p&gt;

&lt;p&gt;Algolia provides a set of parameters for filtering by facets, numbers or geo location. Angular InstantSearch packages those into a set of widgets.&lt;/p&gt;

&lt;p&gt;Since the dataset used here is an e-commerce one, let’s add a RefinementList to filter the products by categories:&lt;/p&gt;

&lt;p&gt;Add this code right after &lt;code&gt;&amp;lt;/ais-search-box&amp;gt;&lt;/code&gt; or anywhere you want it to be in your code.&lt;/p&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;ais-refinement-list attribute="brand"&amp;gt;&amp;lt;/ais-refinement-list&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;The attribute option specifies the faceted attribute to use in this widget. This attribute should be declared as a facet in the index configuration as well.&lt;/p&gt;

&lt;p&gt;The values displayed are computed by Algolia from the results.&lt;/p&gt;

&lt;p&gt;So let’s see the full code:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;AppComponent.ts&lt;/code&gt;&lt;/p&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;ais-instantsearch [config]="{...}"&amp;gt;
  &amp;lt;ais-search-box&amp;gt;&amp;lt;/ais-search-box&amp;gt;
  &amp;lt;ais-refinement-list attribute="brand"&amp;gt;&amp;lt;/ais-refinement-list&amp;gt;
  &amp;lt;ais-hits&amp;gt;
    &amp;lt;ng-template let-hits="hits"&amp;gt;
       &amp;lt;div *ngFor="let hit of hits"&amp;gt;
         Hit {{hit.objectID}}:
         &amp;lt;ais-highlight attribute="name" [hit]="hit"&amp;gt;
         &amp;lt;/ais-highlight&amp;gt;
       &amp;lt;/div&amp;gt;
    &amp;lt;/ng-template&amp;gt;
  &amp;lt;/ais-hits&amp;gt;
&amp;lt;/ais-instantsearch&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Here’s a pictorial result of our efforts so far:&lt;/p&gt;

&lt;p&gt;This has been great so far.&lt;/p&gt;

&lt;p&gt;Yes before I forget, there’s a little challenge which I have the solution to. If you need to edit the style of something like the Search Box or the Refinement List or any of the Algolia Instantsearch components you will have to use &lt;code&gt;::ng-deep&lt;/code&gt; to point to inner nodes in the components.&lt;/p&gt;

&lt;p&gt;example, you if you want to edit the search box input field you will have to do.&lt;/p&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;::ng-deep .ais-SearchBox-input { background-color: #fff; }
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;I hope this helps you create amazing Algolia projects.&lt;/p&gt;


</description>
      <category>javascript</category>
      <category>algolia</category>
      <category>angular6</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Using Cloudinary with Angular 6 and Firebase Firestore</title>
      <dc:creator>Temidayo Ajisebutu</dc:creator>
      <pubDate>Tue, 07 Aug 2018 09:03:34 +0000</pubDate>
      <link>https://dev.to/sirbootoo/using-cloudinary-with-angular-6-and-firebase-firestore-1f9j</link>
      <guid>https://dev.to/sirbootoo/using-cloudinary-with-angular-6-and-firebase-firestore-1f9j</guid>
      <description>&lt;p&gt;Hey there,&lt;/p&gt;

&lt;p&gt;Sorry for the delay, it’s been a very long time since I posted but that’s gonna change.&lt;/p&gt;

&lt;p&gt;Today we are continuing from where we stopped in the &lt;a href="https://medium.com/@_BooToo_/using-cloudinary-with-angular-4-and-firebase-3db8314da3f1"&gt;part 1&lt;/a&gt; tutorial.&lt;/p&gt;

&lt;p&gt;This time we are going to have a simple and straight forward tutorial, below is the tutorial carried out in [StackBlitz.&lt;/p&gt;

&lt;p&gt;firstly we are going to install firebase&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install firebase angularfire2 --save
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After a successful installation of the firebase library we import in a couple of Angularfire modules into our App Module file app.module.ts&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { AngularFireDatabaseModule, AngularFireList } from 'angularfire2/database';
import { AngularFireModule } from 'angularfire2';
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now our app.module.ts&lt;/p&gt;

&lt;p&gt;Before we go into our App Module file we need to set environment variables which the system will interact with and the variables we are setting are the information essential to firebase and cloudinary&lt;/p&gt;

&lt;p&gt;In our environment files which are located in src/environment/&lt;/p&gt;

&lt;p&gt;environment.ts file is responsible for setting environment variable during development while environment-prod.tsis for production mode.&lt;/p&gt;

&lt;p&gt;In our environment.ts file we have something like this.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export const environment = {
production: false,
firebase: {
apiKey: "YOUR API KEY",
authDomain: "YOUR AUTH DOMAIN",
databaseURL: "YOUR DATABASE URL",
projectId: "YOUR PROJECT ID",
storageBucket: "YOUR STORAGE BUCKET",
messagingSenderId: "YOUR MESSAGING SENDER ID"
}
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The config can be gotten from the firebase console.&lt;/p&gt;

&lt;p&gt;After installingthe node library and configuring our emvironment variable with firebase information, we will need to import AngularFire2 and Firebase into our AppModule. So our AppModule file will look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { FormsModule } from '@angular/forms';
import { AppComponent } from './app.component';
import { AngularFireDatabaseModule, AngularFireList } from 'angularfire2/database';
import { AngularFireModule } from 'angularfire2';
import { environment } from '../environments/environment';
import { Ng2CloudinaryModule } from 'ng2-cloudinary';
import { FileUploadModule } from 'ng2-file-upload';
@NgModule({
imports:      [ BrowserModule,
FormsModule,
AngularFireDatabaseModule,
AngularFireModule.initializeApp(environment.firebase),
Ng2CloudinaryModule, FileUploadModule ],
declarations: [ AppComponent ],
bootstrap:    [ AppComponent ]
})
export class AppModule { }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After importing the AngularFireModule, AngularFireDatabaseModule we initialize our AngularFireModule with the information from our environment file as we have done above&lt;/p&gt;

&lt;p&gt;AngularFireModule.initializeApp(environment.firebase)&lt;br&gt;
That’s all for the AppModule file now let’s take a look at out App Component file or any custom component you want to use Firebase in.&lt;/p&gt;

&lt;p&gt;After uploading our image to Cloudinary we need to store some data in our Firebase firestore database so we use&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;this.af.list('/cloudinaryupload').push(this.res) 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;to our data to the firebase firestore db.&lt;/p&gt;

&lt;p&gt;Before we can retreive data from the db we need to have a reference of the database. And to do this all we need to do is&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const ref = this.af.database.ref('/cloudinaryupload');
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That creates a reference to the collection which we are trying to retreive from, after which we get data from the collection using&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ref.on('value', (snapshot) =&amp;gt; {})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;with snapshot, which is the response from the callback. To use the snapshot as an array of objects for the iteration you need in the view I created a function snapshotToArraywhich returns the array of objects representation of the snapshot.&lt;/p&gt;

&lt;p&gt;Full Code of App.component.ts&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { Component } from '@angular/core';
import { AngularFireDatabase, AngularFireList } from 'angularfire2/database';
import { CloudinaryOptions, CloudinaryUploader } from 'ng2-cloudinary';
@Component({
selector: 'my-app',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
name = 'Angular 6';
data: any[] = [];
cloudName = 'YOUR CLOUD NAME';
image_id;
res;
uploader: CloudinaryUploader = new CloudinaryUploader(
new CloudinaryOptions({
cloudName: this.cloudName,
uploadPreset: 'YOUR UPLOAD PRESET'
})
);
loading: any;
constructor(private af: AngularFireDatabase) {
this.getImages();
}
upload() {
this.loading = true;
this.uploader.uploadAll(); // call for uploading the data to Cloudinary
/* Getting the success response from Cloudinary. */
this.uploader.onSuccessItem = (item: any, response: string, status: number, headers: any): any =&amp;gt; {
this.res = JSON.parse(response);
this.loading = false;
this.image_id = this.res.public_id;
console.log(this.res);
this.af.list('/cloudinaryupload').push(this.res) // Storing the complete response from Cloudinary
}
/* Getting the Error message Cloudinary throws. */
this.uploader.onErrorItem = function (fileItem, response, status, headers) {
console.info('onErrorItem', fileItem, response, status, headers)
};
}
/* Listing all the images and their information from the cloudinaryupload collection in firebase */
getImages() {
const ref = this.af.database.ref('/cloudinaryupload');
/* Fat arrow functions which exist in ES6 it is the same as function(snapshot) {} */
ref.on('value', (snapshot) =&amp;gt; {
this.data = this.snapshotToArray(snapshot);
});
}
/*
* Responsible for converting Firebase snapshot to an array.
*/
snapshotToArray(snapshot) {
var returnArr = [];
snapshot.forEach(function (childSnapshot) {
var item = childSnapshot.val();
item.key = childSnapshot.key;
returnArr.push(item);
});
return returnArr;
};
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Below is a demo and codebase of the tutorial above&lt;/p&gt;

&lt;p&gt;Stackblitz for code demo sample&lt;/p&gt;

&lt;p&gt;&lt;a href="https://stackblitz.com/edit/cloudinary-firebase"&gt;Demo and Code&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Converting A File Uploaded To Base64 using FuctBase64</title>
      <dc:creator>Temidayo Ajisebutu</dc:creator>
      <pubDate>Fri, 26 Jan 2018 10:56:59 +0000</pubDate>
      <link>https://dev.to/sirbootoo/converting-a-file-uploaded-to-base64-using-fuctbase64-57go</link>
      <guid>https://dev.to/sirbootoo/converting-a-file-uploaded-to-base64-using-fuctbase64-57go</guid>
      <description>

&lt;h1&gt;
  
  
  fuctBase64
&lt;/h1&gt;

&lt;p&gt;Converting File Uploads To Base64&lt;/p&gt;

&lt;h1&gt;
  
  
  Using the library.
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Installation
&lt;/h2&gt;

&lt;p&gt;install the library using &lt;/p&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;npm&lt;/span&gt; &lt;span class="nx"&gt;install&lt;/span&gt; &lt;span class="nx"&gt;fuctbase64&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;or &lt;/p&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;npm&lt;/span&gt; &lt;span class="nx"&gt;install&lt;/span&gt; &lt;span class="nx"&gt;fuctbase64&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="nx"&gt;save&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;to save to your package.json.&lt;/p&gt;

&lt;h2&gt;
  
  
  Usage
&lt;/h2&gt;

&lt;h3&gt;
  
  
  In Angular 2+
&lt;/h3&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight typescript"&gt;&lt;code&gt;
&lt;span class="c1"&gt;// Imports&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Component&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s1"&gt;'@angular/core'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;fileUpload&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'fuctbase64'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// Component Decorator&lt;/span&gt;
&lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;Component&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;selector&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'app-file-upload-to-base64'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;template&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`&amp;lt;input type="file" name="fileInput" (change)="onFileChange($event)" #fileInput formControlName="fileUpload" /&amp;gt;
  &amp;lt;br&amp;gt;
  &amp;lt;div&amp;gt;
    {{fileResult}}  
  &amp;lt;/div&amp;gt;`&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;

&lt;span class="c1"&gt;// Component Class&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nx"&gt;FileUploadToBase64Component&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;title&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'app works!'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;fileResult&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;any&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;constructor&lt;/span&gt;&lt;span class="p"&gt;(){&lt;/span&gt;

  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="nx"&gt;onFileChange&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
      &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;fileUpload&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;fileResult&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;


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



&lt;p&gt;Check out the &lt;a href="https://plnkr.co/edit/PiAFMiiveFch4tee6CbL?p=preview"&gt;Plunkr&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  In Vanilla Javascript
&lt;/h3&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight html"&gt;&lt;code&gt;
&lt;span class="nt"&gt;&amp;lt;input&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"the-file"&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"file"&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"file"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;

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





&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;fileUpload&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'fuctbase64'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;fileInput&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'the-file'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;fileResult&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;fileUpload&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;fileInput&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;fileResult&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

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



&lt;h4&gt;
  
  
  Multiple File Upload
&lt;/h4&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight html"&gt;&lt;code&gt;    &lt;span class="nt"&gt;&amp;lt;input&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"the-file"&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"file"&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"file"&lt;/span&gt; &lt;span class="na"&gt;multiple&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;





&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;fileUpload&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'fuctbase64'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;fileInput&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'the-file'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;fileResult&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;fileUpload&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;fileInput&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;fileResult&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

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




</description>
      <category>javascript</category>
      <category>angular</category>
      <category>node</category>
      <category>fileupload</category>
    </item>
  </channel>
</rss>
