<?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 Derrick on Medium]]></title>
        <description><![CDATA[Stories by Derrick on Medium]]></description>
        <link>https://medium.com/@neelxie?source=rss-ade0ab3890df------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*qhNspdJKIgVrulrUCtWJdQ.jpeg</url>
            <title>Stories by Derrick on Medium</title>
            <link>https://medium.com/@neelxie?source=rss-ade0ab3890df------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 19:02:46 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@neelxie/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[Implementing Storage Caps and Limit Enforcement in a Database-as-a-Service]]></title>
            <link>https://medium.com/cranecloud/implementing-storage-caps-and-limit-enforcement-in-a-database-as-a-service-3ab659f91906?source=rss-ade0ab3890df------2</link>
            <guid isPermaLink="false">https://medium.com/p/3ab659f91906</guid>
            <category><![CDATA[database-as-a-service]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[database-administration]]></category>
            <category><![CDATA[cloud-services]]></category>
            <category><![CDATA[database]]></category>
            <dc:creator><![CDATA[Derrick]]></dc:creator>
            <pubDate>Fri, 22 Mar 2024 04:46:39 GMT</pubDate>
            <atom:updated>2024-03-22T04:46:39.530Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K3as_LO6HiI-JVVnG5k5zA.png" /><figcaption>image from <a href="https://storyset.com/technology">https://storyset.com/technology</a></figcaption></figure><p>First things first; am guessing we all understand what Database as a Service (DBaaS) is. If not, well it is a cloud computing service that allows you to access and manage databases. This service helps you to be able to do all that(access and management) without having to set up and maintain your own hardware or software.</p><p>So it is you just having a remote database. The service provider handles everything from setting up the database to keeping it secure and up-to-date. Crane Cloud does just that, it is championing Cloud Native Computing initiatives by providing these services. To check out Crane Cloud head over to <a href="https://cranecloud.io/">https://cranecloud.io</a> or if you want to be able to breeze through database management on the platform please do so here: <a href="https://docs.cranecloud.io/databases/database/">https://docs.cranecloud.io/databases/database/</a></p><p>I have had the opportunity to be part of the architecting team for a DBaaS service and I want to share the design/implementation plan I used. First; <strong>why would we need database storage caps or limits?</strong> Well, with Cloud Solutions, you pay for your usage. So in case you have a database for example on Crane Cloud, the database is limited by storage, you have a cap which for example can be around 1 gigabyte of storage.</p><p>To ensure that one user does not exceed the allocated database storage, we must be able to enforce the limit. For simplicity, we did not want to make use of third-party tools so we had to make use of the functionality provided by the database management system itself(Postgres/MySQL). We decided that implementation-wise a custom script or trigger within our application’s codebase would do.</p><p>First, we devised and implemented it in such a way that when your allocated limit is exceeded your database automatically locks you the user out. Well that seemed perfect but it seemed a little malevolent 😊 so we resolved to find another approach.</p><p>The next approach we determined that:</p><ol><li>We have a storage check for all databases and in case a database has reached 80% of its allocated storage we would email the user to notify them. This is intended to assist them in planning effectively and not be surprised when their limit is reached and we take further action.</li><li>Once the limit/cap is reached, the user’s permissions for inserting and updating data into the database are immediately revoked. However, they retain the ability to read from the database and also to delete entries from it.</li><li>The initial implementation of locking out a user would remain unchanged but rather serve in situations where we require the activation and deactivation of a database by either a user or administrator for diverse reasons. One such reason is limiting the billing since it may accumulate instances where deletion of the database is undesired yet it is not being used.</li></ol><p>We settled on the above as it allows us to monitor and control the storage usage on a per-user basis, ensuring adherence to the allocated limits. The storage checks are run using a cron job within our application. In case you have any questions or queries or just want to take a look at the code for this, leave a comment. Catch you on the next one! ✌️</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3ab659f91906" width="1" height="1" alt=""><hr><p><a href="https://medium.com/cranecloud/implementing-storage-caps-and-limit-enforcement-in-a-database-as-a-service-3ab659f91906">Implementing Storage Caps and Limit Enforcement in a Database-as-a-Service</a> was originally published in <a href="https://medium.com/cranecloud">Crane Cloud</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating a Linux snap package for an existing application.]]></title>
            <link>https://medium.com/cranecloud/creating-a-linux-snap-package-for-an-existing-application-800f6aa361d2?source=rss-ade0ab3890df------2</link>
            <guid isPermaLink="false">https://medium.com/p/800f6aa361d2</guid>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[snap]]></category>
            <category><![CDATA[snapcraft]]></category>
            <dc:creator><![CDATA[Derrick]]></dc:creator>
            <pubDate>Mon, 05 Feb 2024 08:43:29 GMT</pubDate>
            <atom:updated>2024-02-05T08:55:36.201Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8U8fWLko-jRcIE7n" /><figcaption>Photo by <a href="https://unsplash.com/@6heinz3r?utm_source=medium&amp;utm_medium=referral">Gabriel Heinzer</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>We have a Command Line Application that we wanted to increase its usability. Our main focus is ease of installation for different users across different platforms we decided to create a snap package for the Linux users as well as homebrew for Mac users. Here I detail the process for the snap package.</p><p>I began by installing the following:</p><pre>sudo snap install snapcraft --classic<br>sudo snap install multipass --classic</pre><p>After installing the above. You can run the following command to test if your installation is successful.</p><pre>snap --version</pre><p>Given that I have an already existing application that I want to create a snap package for. A brief about my application is that it is a command line tool. I clone the repository and create a new branch to work with. In the root directory, I go ahead to run the following command in the root directory.</p><pre>snapcraft init</pre><p>On success, a new folder called `<strong>snap</strong>` will be created, and therein a template <strong>snapcraft.yml</strong> file. It is pre-filled with information you can change.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sRdmSr9iTyPFwfMVvkD2AQ.png" /><figcaption>This is the preliminary snapcraft.yml after for dev mode.</figcaption></figure><p>Let me give a brief breakdown of the contents therein:</p><p><strong>Name:</strong> This is the name of the application, this will also be the name the package is called in the snap store.</p><p><strong>Base:</strong> This defines a run-time environment with a set of libraries common to most applications, the default(created in the template) is core18 but for my application core20 worked fine, yes core22 didn&#39;t work for my application. Goes without saying these are based on Ubuntu versions🫠 guess the correlation with 18, 20, and 22 makes sense now. For more information about these Python plugs <a href="https://snapcraft.io/docs/python-plugin">here</a>.</p><p><strong>Version:</strong> Well if you want to version your snap, this is it, and it is required.</p><p><strong>Summary:</strong> This ought to be a sentence about your application’s purpose.</p><p><strong>Description:</strong> This is an in-depth detailing of everything your application does or how it can be used and any other details.</p><p><strong>Grade:</strong> This indicates the level of stability and support your snap provides. <strong><em>Stable</em></strong> which indicates a stable rigorously tested package ready for production. <strong><em>Devel</em></strong> indicates the package is in development and contains experimental features. <strong><em>Edge</em></strong> usually indicates a package intended for testing and usually has the latest features and updates. <strong><em>Beta</em></strong> indicates the package is in the beta stage and may still contain issues and is used to gather feedback from users before a stable release.</p><p><strong>Confinement:</strong> This means the level of isolation and access restrictions imposed on the snap when it runs on a system. <strong>Strict:</strong> The most secure level of confinement where the snap is isolated and can only access approved resources. <strong>Classic:</strong> This offers more freedom, akin to traditional Linux packages, but necessitates special permission and undergoes rigorous review for Snap Store distribution. <strong>Devmode:</strong> Primarily for development and testing, though unsuitable for stable Snap Store distribution due to security bypasses.</p><p><strong>Parts:</strong> These are the building blocks of a snap. Each part defines how a component of your application or snap should be obtained, built, and staged. They can be libraries, binaries, or any other components necessary for your snap. — <strong>Plugin:</strong> this defines a build process and covers different build systems and languages and for our case python given that my application is Python-based. — <strong>Source:</strong> where to obtain the source code or files for a particular part. It can be a URL to a tarball, a Git repository, a local directory, or other sources supported by Snapcraft. Snapcraft needs to fetch the necessary files to build the snap. In our case, we are building this within the source code hence the dot.</p><p><strong>Apps</strong>: This defines a section for services and applications provided by the snap package each of which is defined under apps. You can define metadata under it like execution commands, environment variables, plugs, and slots.</p><p>`<strong>myapplication`</strong> defined under <strong><em>apps</em></strong> indicates that this snap package provides an application named myapplication.</p><p>Command: The entire line of the command specifies that when myapplication is executed, the executable is located at bin/myapplication within the snap package should be run.</p><p>To run my application just type:</p><pre>snapcraft</pre><p>This will go ahead to create the snap and it will be named something like “<strong>myapplication_1.0_amd64.snap</strong>” and to run and test your application run the following command</p><pre>snap install myapplication_1.0_amd64.snap --devmode</pre><p>This will go ahead to install my application and being a command line tool I just run it with its command indicated of:</p><pre>myapplication</pre><p>With the above my application is able to work perfectly but that is in the development mode.</p><p>To remove the installation run:</p><pre>sudo snap remove myapplication_1.0_amd64.snap</pre><p>Next, we will look at how to configure it for the production environment and how to get it to the snap store. Check it out here in this article:</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=800f6aa361d2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/cranecloud/creating-a-linux-snap-package-for-an-existing-application-800f6aa361d2">Creating a Linux snap package for an existing application.</a> was originally published in <a href="https://medium.com/cranecloud">Crane Cloud</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Sessions: Managing user state in Flask.]]></title>
            <link>https://medium.com/cranecloud/sessions-managing-user-state-in-flask-f2f4205c157a?source=rss-ade0ab3890df------2</link>
            <guid isPermaLink="false">https://medium.com/p/f2f4205c157a</guid>
            <category><![CDATA[sessions]]></category>
            <category><![CDATA[user-management]]></category>
            <category><![CDATA[flask]]></category>
            <dc:creator><![CDATA[Derrick]]></dc:creator>
            <pubDate>Fri, 18 Aug 2023 06:19:16 GMT</pubDate>
            <atom:updated>2023-08-18T06:25:58.970Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*etV5UNxMzjEjLxqx" /><figcaption>Photo by <a href="https://unsplash.com/@switch_dtp_fotografie?utm_source=medium&amp;utm_medium=referral">Lucas van Oort</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>In today’s digital landscape, captivating user engagement and providing tailored experiences is paramount for the success of any tech tool or application. Imagine seamlessly remembering user preferences, and maintaining shopping carts across visits. How do your favorite applications and sites do it?</p><p>Enter <strong>Sessions</strong> — let us uncover its inner workings, and equip you with the knowledge to transform the way you approach user state management. Sessions enable you to maintain user-specific data across multiple requests and Flask provides a simple solution for handling sessions.</p><p>Sessions allow web applications to store and retrieve user-specific information, such as login credentials, preferences, and shopping cart contents, across multiple HTTP requests. In utilizing sessions, we can create personalized experiences for users and maintain continuity throughout their interactions with the application.</p><p>A session is encrypted information that is stored on the web server in a temporary directory. Encrypting data is a secure method employed to store information, particularly when the data should remain untouched or hidden from the user’s view.</p><p><strong>Enable Sessions in Flask:</strong></p><p>Flask provides a built-in session management system that relies on signed cookies to store and retrieve session data securely. To illustrate how we can use sessions let us experiment with a simple example.</p><pre>from flask import Flask, session<br>import secrets<br><br>app = Flask(__name__)<br>app.secret_key = &#39;my_hard_to_crack_secret_key&#39;<br># below is how i run mine<br># app.secret_key = secrets.token_hex(16)</pre><p>In the above code, we import the session from the flask module first. The app.secret_key is used to sign the session cookie, to add an extra layer of security that’s why we can’t run sessions without it. Personally, for extra security, I use ‘secrets’ to help me with that.</p><p><strong>Storing our first Session:</strong></p><p>Sessions are key-value pairs or essentially python dictionaries as such adding information can be easy as:</p><pre>session[&quot;key&quot;] = &quot;value&quot;</pre><p>Most sessions are created at login and let’s explore how to do that:</p><pre>from flask import Flask, session, request, redirect, url_for<br>import secrets<br><br>app = Flask(__name__)<br>app.secret_key = secrets.token_hex(16)<br><br>@app.route(&#39;/login&#39;, methods=[ &#39;POST&#39;])<br>def login():<br> if request.method == &#39;POST&#39;:<br> username = request.form.get(&#39;username&#39;)<br> # Assuming successful authentication<br> session[&#39;username&#39;] = username<br> session[&#39;token&#39;] = access_token<br> session[&#39;role&#39;] = user.role<br> session[&quot;user&quot;] = user<br> return redirect(url_for(&#39;profile&#39;))</pre><p>Information retrieval from a session.</p><pre>@app.route(&#39;/profile&#39;)<br>def profile():<br>if &quot;user&quot; in session:<br>    user = session[&quot;user&quot;]<br>    return f&quot;&lt;h1&gt;{user}&lt;/h1&gt;&quot;<br>else:<br>    return redirect(url_for(&quot;login&quot;))</pre><p>And in our profile page, we can check the session if the user exists and if so we can display user data.</p><pre>@app.route(&#39;/profile&#39;)<br>def profile():<br>    access_token = session.get(&#39;user_token&#39;)<br>    role = session.get(&#39;user_role&#39;)<br>    username = session.get(&#39;username&#39;)<br>    return render_template(&#39;profile.html&#39;, token=access_token, role=role, user=username)</pre><p>and in the profile page we can use can pick the stored user details as shown below:</p><pre>&lt;nav class=&quot;header-user-info&quot;&gt;<br>  &lt;div id=&quot;username&quot;&gt;{{ session.username }}&lt;/div&gt;<br>  &lt;div id=&quot;user_role&quot;&gt;{{ session.role }}&lt;/div&gt;<br>&lt;/div&gt;</pre><p><strong>Clearing the sessions:</strong></p><p>Now, let’s proceed to implement the session clearing, this is usually done with the logout functionality. When a user navigates to “/logout” route, it’s essential to erase their session information. To accomplish this, we can employ a technique known as session.pop(“key”, None). The pop method attempts to eliminate and retrieve the specified key from the session data. If the key is not present, the method will return the provided second argument. In our scenario, we aim to eliminate the “user” key, and if it’s not found, we’ll return None.</p><pre>@app.route(&quot;/logout&quot;)<br>def logout():<br>  session.pop(&quot;username&quot;, None)<br>  session.pop(&quot;token&quot;, None)<br>  session.pop(&quot;role&quot;, None)<br>  session.pop(&quot;user&quot;, None)<br>  return redirect(url_for(&quot;login&quot;))</pre><p><strong>How long is a Session?</strong></p><p>Now that we are familiar with the process of establishing, adding, and eliminating data within sessions, it’s time to delve into their lifespan. By default, a session remains active for the duration of your browser being open. Nonetheless, Flask provides a means to adjust this behavior. We can influence the session’s duration by creating a permanent session, affording us the ability to stipulate its longevity. By default, a permanent session lasts for 30 days. We will start by defining the duration at the beginning of our program.</p><pre>app.permanent_session_lifetime = timedelta(days=1)</pre><p>As shown above I have set the session duration for a day and incase of its expiry I have the login redirect functionality where a user will get redirected to the login to start a new session. That is all about sessions, if I missed out anything or you have a question add a comment. Happy coding.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f2f4205c157a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/cranecloud/sessions-managing-user-state-in-flask-f2f4205c157a">Sessions: Managing user state in Flask.</a> was originally published in <a href="https://medium.com/cranecloud">Crane Cloud</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mastered Docker? Learn Kubernetes]]></title>
            <link>https://medium.com/cranecloud/mastered-docker-learn-kubernetes-9f14ea053003?source=rss-ade0ab3890df------2</link>
            <guid isPermaLink="false">https://medium.com/p/9f14ea053003</guid>
            <category><![CDATA[orchestration]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[cloud-native-application]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Derrick]]></dc:creator>
            <pubDate>Thu, 06 Jul 2023 15:13:48 GMT</pubDate>
            <atom:updated>2023-07-06T15:27:28.117Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Am0-b43VhFCYSk6i" /><figcaption>Photo by <a href="https://unsplash.com/@growtika?utm_source=medium&amp;utm_medium=referral">Growtika</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>In the world of Cloud Native Computing, Docker has established itself as the de facto standard for packaging applications. It is simple and portable, and its widespread adoption has made it an essential tool for software engineers. However, as the complexity and scale of applications grow, Docker alone is not enough to handle the demands of modern containerized environments. That is where Kubernetes comes into play. Kubernetes, often referred to as K8s, is an open-source container orchestration platform Docker containers that can take your container game to the next level as a DevOps engineer. So why should Docker experts embrace Kubernetes?</p><p>Scalability and Orchestration: One of the main reasons to adopt Kubernetes is its ability to scale dockerized applications effortlessly. Since Docker allows you to run containers, Kubernetes helps you to manage and orchestrate a cluster of containers across multiple nodes. With the ability to define how many replicas of your application to run, and it handles the of distributing them across the cluster, to ensure high availability and scalability. Such automation and control are valuable for large-scale applications that would demand flexibility and efficient resource utilization.</p><p>Service Discovery and Load Balancing: With a distributed container environment, service discovery, and load balancing become critical components. Although Docker provides basic networking capabilities, Kubernetes takes it to a whole new level. With Kubernetes, you define a service that will act as a stable endpoint for your applications, which allows other services to discover and communicate seamlessly. Plus, Kubernetes has built-in load balancing mechanisms, distributing incoming traffic intelligently among the containers(pods) running your application ensuring optimal performance and eliminating single points of failure.</p><p>Rolling Updates and Rollbacks: On the CI/CD front maintaining high availability while updating applications is a challenge with Docker. Kubernetes thus offers rolling updates and rollbacks, allowing you to update your application with zero downtime. This means you release new versions of your application gradually, replacing old instances with new ones while ensuring a smooth transition. In case any issues arise during the update process, Kubernetes provides the ability to roll back to the previous stable version, mitigating potential disruptions — (recently Crane Cloud got this too, check it out).</p><p>Monitoring, Logging, and Scalability: Monitoring and managing a large number of containers could overwhelm you without proper tooling. Kubernetes integrates well with popular monitoring and logging solutions like Prometheus, Grafana, and the ELK stack, which provides robust observability for your applications. Such tools enable you to collect metrics, visualize performance, and analyze logs, helping you identify bottlenecks, troubleshoot issues, and ensure the overall health of your applications. Crane Cloud utilizes Prometheus for its application.</p><p>Community and Ecosystem: Kubernetes has a vibrant and rapidly growing community courtesy of the Cloud Native Computing Foundation, with an extensive ecosystem of tools, libraries, and resources. With the embracing of Kubernetes, Docker experts gain access to a wealth of knowledge and a collaborative community. Of course, the active community contributes to the continuous improvement and evolution of Kubernetes, ensuring it remains a cutting-edge platform for container orchestration.</p><p>Kubernetes’ exponential adoption speaks of its significance and impact in the Cloud Native Computing space. Notably, many top companies in the Fortune 100 have recognized the value of Kubernetes and have embraced it as their container management platform of choice. Industry giants like Google, Microsoft, Amazon, Uber, Spotify, and IBM have all invested heavily in Kubernetes, offering managed Kubernetes services and integrating it into their cloud platforms. The level of adoption and endorsement from such major players in the technology landscape further underscores the importance of Kubernetes as a transformative technology.</p><p>In comparison with its competitors in the container orchestration space, such as Docker Swarm and Apache Mesos, Kubernetes emerges as the clear leader. Boasting a staggering adoption rate of 91% among respondents in the CNCF survey of 2020. Unlike Docker Swarm, which offers simplicity but lacks advanced capabilities, Kubernetes excels in managing large-scale deployments, due to its robust scheduling algorithms, load-balancing mechanisms, and self-healing abilities. Additionally, compared to Apache Mesos, Kubernetes provides a higher level of abstraction and enjoys wider industry support, as evidenced by the extensive contributor base, regular releases, and the availability of managed Kubernetes services from major cloud providers. Such factors make Kubernetes the top choice for Docker experts seeking a powerful and scalable container orchestration solution.</p><p>Conclusion:</p><p>While Docker has undoubtedly transformed the way we package and deploy applications, Kubernetes takes containerization to a whole new level. Its scalability, orchestration capabilities, service discovery, rolling updates, and extensive ecosystem make it an essential tool for Docker experts looking to elevate their container game. So, if you’re a Docker expert ready to level up your container orchestration skills, dive into Kubernetes and unlock the full potential of your containerized applications. Read about how Kubernetes has transformed many companies here <a href="https://kubernetes.io/case-studies/spotify/">https://kubernetes.io/case-studies</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9f14ea053003" width="1" height="1" alt=""><hr><p><a href="https://medium.com/cranecloud/mastered-docker-learn-kubernetes-9f14ea053003">Mastered Docker? Learn Kubernetes</a> was originally published in <a href="https://medium.com/cranecloud">Crane Cloud</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[MKDocs: The Ideal Tool for Effective Documentation]]></title>
            <link>https://medium.com/cranecloud/mkdocs-the-ideal-tool-for-effective-documentation-31da0666bb05?source=rss-ade0ab3890df------2</link>
            <guid isPermaLink="false">https://medium.com/p/31da0666bb05</guid>
            <category><![CDATA[mkdocs]]></category>
            <category><![CDATA[documentation]]></category>
            <category><![CDATA[crane-cloud]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Derrick]]></dc:creator>
            <pubDate>Sun, 11 Jun 2023 19:38:04 GMT</pubDate>
            <atom:updated>2023-06-11T19:38:04.330Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*HqojntdhI0xFbeGM" /><figcaption>Photo by <a href="https://unsplash.com/@sigmund?utm_source=medium&amp;utm_medium=referral">Sigmund</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>In the world of software development and project management ( am a Dev, so that’s my world), clear and comprehensive documentation plays a crucial role in ensuring seamless collaboration, knowledge sharing, and project success. While there are various tools available for creating project documentation, one tool that stands out as the ideal choice is MKDocs. In this post, we will explore why MKDocs is considered the best tool for documentation.</p><p><strong>Why MKDocs?</strong></p><p><a href="https://www.mkdocs.org/"><strong>MKDocs</strong></a> is a static site generator designed specifically for creating project documentation. It offers a simple and intuitive way to generate documentation in various formats, including HTML, PDF, and Markdown. What makes MKDocs truly exceptional is its ease of use, flexibility, and extensive customization options. Let’s delve into some key reasons why MKDocs stands out as the ideal tool for documentation.</p><p><strong>Markdown-based Simplicity: </strong>MKDocs leverages the power of Markdown, a lightweight markup language, making it easy for both technical and non-technical team members to contribute to the documentation. Markdown’s simple syntax allows for quick and hassle-free content creation, while also supporting rich text formatting and embedding media.</p><p><strong>Easy navigation and search functionality:</strong> MKDocs automatically generates a table of contents and navigation sidebar, enabling users to navigate through the documentation effortlessly. Additionally, it includes powerful search functionality that allows users to quickly find specific information within the documentation.</p><p><strong>Customization and Theming:</strong> MKDocs offers a wide range of customizable themes, enabling you to create a documentation site that aligns with your project’s branding and style. Additionally, you can easily extend the functionality of MKDocs by integrating plugins, such as search functionality, table of contents, and code syntax highlighting, to enhance the user experience and make your documentation more interactive. More on customization check out this <a href="https://www.mkdocs.org/user-guide/">guide</a> or specifically <a href="https://github.com/mkdocs/mkdocs/wiki/MkDocs-Themes">this one</a>.</p><p><strong>Version Control Integration:</strong> With MKDocs, you can seamlessly integrate your documentation with version control systems like Git, enabling collaborative editing and tracking changes over time. This integration allows teams to work together, review and merge documentation updates efficiently, and maintain a clear history of revisions.</p><p>To illustrate how to create project documentation using MKDocs, let’s walk through a step-by-step process:</p><p>Step 1: Installation: MKDocs requires Python, so ensure you have Python installed beforehand. Begin by installing MKDocs using the package manager of your choice (pip, Homebrew, or Chocolatey). Once installed, create a new project using the command-line interface. More installation details can be found <a href="https://www.mkdocs.org/user-guide/installation/">here</a>.</p><p>Step 2: Configuration: Customize your documentation project by editing the mkdocs.yml configuration file. Define the site name, select a theme, and configure other settings such as the navigation structure and additional plugins.</p><p>Step 3: Content creation: Create individual Markdown files for each section or page of your documentation. Organize them in a logical folder structure within the project directory.</p><p>Step 4: Building and previewing: Use the MKDocs build command to generate a static HTML version of your documentation. Utilize the MKDocs serve command to preview the documentation site locally and make any necessary adjustments.</p><p>Step 5: Deployment: Once satisfied with the documentation, deploy it to your preferred hosting platform or publish it on an internal server for easy access by your team.</p><p><a href="https://www.mkdocs.org/">MKDocs</a> has gained significant popularity across various industries, and numerous companies have chosen it as their preferred documentation tool. One such company is Crane Cloud, a leading provider of cloud-based solutions. Crane Cloud utilizes <a href="https://www.mkdocs.org/">MKDocs</a> to create comprehensive documentation for its users. The documentation site showcases how the platform works, provides tutorials, and offers guidance. You can explore their documentation at <a href="https://docs.cranecloud.io/">https://docs.cranecloud.io</a> or checkout how to run Crane Cloud’s documentation locally at <a href="https://github.com/crane-cloud/documentation">https://github.com/crane-cloud/documentation</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=31da0666bb05" width="1" height="1" alt=""><hr><p><a href="https://medium.com/cranecloud/mkdocs-the-ideal-tool-for-effective-documentation-31da0666bb05">MKDocs: The Ideal Tool for Effective Documentation</a> was originally published in <a href="https://medium.com/cranecloud">Crane Cloud</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AI Enhancing Software Development]]></title>
            <link>https://neelxie.medium.com/ai-enhancing-software-development-a6861f6fd100?source=rss-ade0ab3890df------2</link>
            <guid isPermaLink="false">https://medium.com/p/a6861f6fd100</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Derrick]]></dc:creator>
            <pubDate>Thu, 20 Apr 2023 18:49:19 GMT</pubDate>
            <atom:updated>2023-04-20T18:49:19.484Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*eVNIIusNpp9bl50g" /><figcaption>Photo by <a href="https://unsplash.com/@writecodenow?utm_source=medium&amp;utm_medium=referral">Boitumelo Phetla</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Artificial Intelligence (AI) has transformed several industries and continues to do so with software development being no exception. With AI, software development has seen significant improvements in various areas such as speed, accuracy, and efficiency. In this article, we will discuss the benefits of AI in software development and provide examples of how various development tools are using AI to enhance the software development process.</p><h4>Faster Development Cycles</h4><p>One of the most significant benefits of AI in software development is its ability to reduce the time it takes to develop software. With AI, developers can automate repetitive tasks, such as testing, debugging, and maintenance, freeing up time to focus on more complex tasks. AI can also analyze data and identify patterns, allowing developers to make informed decisions that can speed up the development process.</p><p>For instance, <a href="https://www.ibm.com/cloud/watson-studio">IBM Watson Studio</a> is an AI-powered platform that helps developers build and deploy models faster. It automates many of the repetitive tasks involved in the development process, such as data preparation and feature engineering, enabling developers to focus on building models. Watson Studio also offers collaboration tools that enable team members to work together and share knowledge, reducing the time it takes to develop software.</p><h4>Improved Quality</h4><p>AI can also improve the quality of software development by reducing errors and identifying potential issues before they occur. With AI, developers can test software more thoroughly, ensuring that it meets the required standards before it is released. AI can also analyze data and identify patterns that might lead to errors, enabling developers to make changes before releasing the software.</p><p>For example, <a href="https://test.ai/">Test.ai</a> is an AI-powered platform that automates software testing. It uses machine learning algorithms to analyze user behavior and identify potential issues that might affect the performance of the software. <a href="https://test.ai/">Test.ai</a> also generates test cases automatically, ensuring that the software is tested thoroughly and that potential issues are identified before the software is released.</p><h4>Improved Efficiency</h4><p>AI can also improve the efficiency of software development by reducing the amount of time and resources required to develop software. With AI, developers can automate many of the tasks involved in the development process, such as testing, debugging, and maintenance. This frees up time and resources to focus on more complex tasks, such as designing and building software.</p><p>For instance, <a href="https://visualstudio.microsoft.com/services/intellicode/">Microsoft’s Visual Studio IntelliCode</a> is an AI-powered tool that helps developers write code more efficiently. It uses machine learning algorithms to analyze code and suggest improvements, such as adding missing variables or removing redundant code. IntelliCode also provides autocomplete suggestions, making it faster and easier for developers to write code.</p><h4>Improved User Experience</h4><p>AI can also improve the user experience by analyzing user behavior and making recommendations based on that behavior. With AI, developers can create software that is more intuitive and personalized, leading to a better user experience.</p><p>For example, <a href="https://aws.amazon.com/personalize/">Amazon Personalize</a> is an AI-powered service that helps developers create personalized recommendations for their users. It uses machine learning algorithms to analyze user behavior and identify patterns that might indicate user preferences. Based on this analysis, Personalize can make recommendations that are tailored to each user, improving the user experience.</p><p>AI has transformed software development, offering benefits such as faster development cycles, improved quality, improved efficiency, and improved user experience. AI-powered tools and platforms are now available that enable developers to automate repetitive tasks, identify potential issues, and create software that is more intuitive and personalized. As AI continues to evolve, it is likely that we will see further improvements in software development, making it faster, more efficient, and more user-friendly.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a6861f6fd100" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[6 Practical Suggestions For Becoming An Exceptional Team Player]]></title>
            <link>https://neelxie.medium.com/6-practical-suggestions-for-becoming-an-exceptional-team-player-63147e6846c7?source=rss-ade0ab3890df------2</link>
            <guid isPermaLink="false">https://medium.com/p/63147e6846c7</guid>
            <category><![CDATA[collaboration]]></category>
            <category><![CDATA[empathy]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[continuous-learning]]></category>
            <category><![CDATA[team-player]]></category>
            <dc:creator><![CDATA[Derrick]]></dc:creator>
            <pubDate>Tue, 28 Mar 2023 06:17:43 GMT</pubDate>
            <atom:updated>2023-03-28T08:18:51.988Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1aLNvyxGmwk0O2uV" /><figcaption>Photo by <a href="https://unsplash.com/es/@concoyne?utm_source=medium&amp;utm_medium=referral">Connor Coyne</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p><strong>United We Stand And Divided We Fall</strong> — this rings true to every team in the world whether sports, army, finance, or software engineering. Being a “Dev” my focus will be on software engineering teams or teammates.</p><p>A team’s success is based on the individual people working together towards a common goal. While working in a team can be incredibly rewarding, it can also be challenging. To be an effective team member, you need to have a multitude of skills and here I’ll explore 6 practical exceptional tips on how to become a valuable team member.</p><h4><strong>1. Be Collaborative and Communicative</strong></h4><p>In any team, effective collaboration is essential for achieving success. A team player ought to be willing to work with others, share knowledge, and communicate effectively. Being collaborative means that you are willing to help others and work towards a common goal. It also means that you respect your teammates’ ideas and opinions and are open to feedback.</p><p>Good communication is an essential part of team collaboration. When working in a team, you need to ensure that everyone is on the same page. It means that you need to be clear and concise in your communication. For example, being able to communicate technical information to non-technical people. This skill is essential for ensuring that everyone in the team understands what is happening, even if they do not have the same technical background.</p><p><strong>2. Be Adaptable and Flexible</strong></p><p>Software Engineering is dynamic, projects can change at any time. A good team player should be adaptable and flexible, ready to change course when needed. A team player should be open to new ideas and approaches and be willing to learn new skills.</p><p>Flexibility also means that you are willing to take on new roles or responsibilities. It means that you are not afraid to step out of your comfort zone and try new things. Being adaptable and flexible allows you to contribute more to the team and helps the team succeed.</p><h4><strong>3. Be Accountable and Responsible</strong></h4><p>Accountability and responsibility are essential traits for any team player. Being responsible for the work you do and accountable for its quality. You should take ownership of your work and ensure that it always meets the required standards.</p><p>Being accountable also means that you are willing to take responsibility for your mistakes. When something goes wrong, you own up to your mistakes and work to fix them. It also means that you are willing to learn from your mistakes and take steps to prevent them from happening again.</p><p>Responsibility also means that you meet your deadlines and deliver your work on time. It means that you are reliable and can be counted on to get the work done.</p><h4><strong>4. Be Proactive and Self-Motivated</strong></h4><p>A good team player should be proactive and self-motivated. It means that you take the initiative to not only get things done but also in helping others and ensuring that the team is working efficiently and willing to establish project success. Being proactive means that you are always looking for ways to improve the project and the team’s efficiency.</p><p>Self-motivation is always essential. It means that you are passionate about your work and are committed to achieving the team’s goals. Self-motivation also means that you are always looking for ways to improve your skills and knowledge.</p><h4><strong>5. Be Respectful and Empathetic</strong></h4><p>Respect and empathy are essential traits for any team player. Being respectful of your teammates’ ideas and opinions, even if you disagree with them. It means that you are open to feedback and willing to listen to others’ perspectives.</p><p>Empathy is also crucial for effective collaboration. It means that you can put yourself in someone else’s shoes and understand their perspective. Having empathy enables one to collaborate productively with individuals from diverse cultural and social backgrounds.</p><h4><strong>6. Continuously Learn and Improve</strong></h4><p>The software development field is constantly changing, and new technologies and approaches are emerging all the time. A good team player should be continuously learning and improving their skills. It means that you are open to new ideas and approaches and are willing to learn new technologies.</p><p>Continuous learning and improvement also mean that you are always taking the initiative to learn new things on your own, outside of work hours. Read industry blogs, attend conferences and meetups, and experiment with new technologies in your free time. Bring what you learn back to the team and share it with others.</p><p>Being the ideal team player as a software engineer is a combination of empathy, responsibility, self-motivation, flexibility, adaptability, accountability, communication, and continued learning. It is important to be more than just a skilled engineer. By embodying these qualities, you can become a valuable member of any team, and help create a culture of collaboration and success.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=63147e6846c7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Communication skills: Taking Feedback]]></title>
            <link>https://medium.com/cranecloud/communication-skills-taking-feedback-a7be34e1677a?source=rss-ade0ab3890df------2</link>
            <guid isPermaLink="false">https://medium.com/p/a7be34e1677a</guid>
            <category><![CDATA[feedback]]></category>
            <category><![CDATA[team-collaboration]]></category>
            <category><![CDATA[work-ethic]]></category>
            <category><![CDATA[communication-skills]]></category>
            <dc:creator><![CDATA[Derrick]]></dc:creator>
            <pubDate>Mon, 27 Mar 2023 21:25:43 GMT</pubDate>
            <atom:updated>2023-06-11T15:31:59.629Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*W123hDI0gLKs95n9" /><figcaption>Photo by <a href="https://unsplash.com/@darthxuan?utm_source=medium&amp;utm_medium=referral">Xuan Nguyen</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Feedback is an essential part of growth, and as a software engineer — I am one and that’s the perspective I will share here — it plays an even more crucial role in shaping your skills, abilities, and career trajectory — talking professional growth here! The ability to receive feedback gracefully, learn from it, and implement necessary changes can set you apart in tech and lead to greater success.</p><p><strong>Why Feedback Is Important</strong></p><p>Feedback is essential as it provides insight into how others perceive your work. It helps identify areas in which you need to improve and refine your approach. Without feedback, it can be challenging to gauge how well you’re doing, and you may miss opportunities to grow and learn, thinking you are doing the very best and missing out on areas where to improve.</p><p>Taking feedback from others also shows that you are open to learning and improving. It’s a demonstration of your willingness to listen, consider other perspectives, and adapt your approach. Some people will often take it as a personal affront to their self-esteem or character. Lol…it’s never meant to be personal 😊. It can help build trust and respect among your peers, and supervisors, leading to more opportunities and greater success — professional growth again!</p><p>Another key advantage of feedback is that it enables you to stay connected with the people you’re working with. It can help you build better relationships with your teammates, by giving you insights into what they need, want, and expect from you. By staying connected you can build stronger and more collaborative relationships that can lead to better outcomes for everyone — win-win!</p><p><strong>How to Receive Feedback Gracefully</strong></p><p>Receiving feedback can be challenging(worse when you have a big ego), especially if it’s critical or negative. However, learning to receive feedback gracefully is an essential skill(must be classified as an art) for anyone regardless of occupation. Let me elaborate on easy tips to assist you in accepting feedback in a constructive manner:</p><ol><li>Listen actively: When someone is giving you feedback, try to listen actively — this means paying attention to what they’re saying, asking clarifying questions, and demonstrating that you understand their perspective. Active listening can help you get the most out of feedback and show the other person that you value their input.</li><li>Stay calm:🧘‍♂️ Receiving negative feedback can be emotional, but it’s important to stay calm and composed. Take a deep breath and try to stay focused on the feedback rather than getting defensive or emotional — this can be hard at first. Remember, the goal is to learn and improve, not to argue or defend your work.</li><li>Ask for specifics: If the feedback is vague or unclear, ask for specific examples or suggestions for improvement. This can help you understand the feedback better and provide a starting point for making changes.</li><li>Thank the person giving the feedback: Feedback takes time and effort, and it’s important to acknowledge and appreciate the person who is giving it. Thank them for taking the time to provide feedback, even if it’s difficult to hear. Infact it is recommended the best answer to feedback is “Thank you.”</li><li>Take time to reflect: After receiving feedback, take some time to reflect on it. Consider the feedback objectively — without any emotions, and think about how you can use it to improve. This can help you approach the feedback with a growth mindset and make meaningful changes.</li></ol><p><strong>Making the Most of Feedback</strong></p><p>Receiving feedback is just the first step; the real value comes from using it to improve. I recommend the following two suggestions to make the most of feedback:</p><ol><li><strong>Prioritize feedback:</strong> It is important to note that not all feedback holds the same weight. The value of feedback can vary depending on various factors such as its source and the context of the feedback. Therefore, it is crucial to prioritize feedback based on its potential impact and relevance to your work.</li><li><strong>Identify patterns:</strong> Look for patterns in feedback. Are multiple people giving you similar feedback? Is there a consistent theme or issue that’s coming up? Identifying patterns can help you identify areas you need to improve and prioritize changes.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a7be34e1677a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/cranecloud/communication-skills-taking-feedback-a7be34e1677a">Communication skills: Taking Feedback</a> was originally published in <a href="https://medium.com/cranecloud">Crane Cloud</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cloud Talk: Intro to Cloud Computing]]></title>
            <link>https://medium.com/cranecloud/cloud-talk-intro-to-cloud-computing-425240de2e1d?source=rss-ade0ab3890df------2</link>
            <guid isPermaLink="false">https://medium.com/p/425240de2e1d</guid>
            <category><![CDATA[cavendish-university]]></category>
            <category><![CDATA[makerere-university]]></category>
            <category><![CDATA[google-developer-group]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[cloud-native-computing]]></category>
            <dc:creator><![CDATA[Derrick]]></dc:creator>
            <pubDate>Mon, 06 Mar 2023 08:23:36 GMT</pubDate>
            <atom:updated>2023-03-16T08:51:49.759Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gx-Wok2x_GhrL7RAbXmgSA.jpeg" /><figcaption>The Crane Cloud Team at arrival with the main speaker Janet Namutebi</figcaption></figure><p>It was a beautiful day on the 25th of February 2023 as the Crane Cloud team in partnership with the Google Student Developer Circle, Cavendish University Chapter, held the first of four events under the theme: “The Cloud Talk” at the Cavendish University main branch in Nsambya Kampala. The partnership between the two entities is one of many aimed at spreading the gospel of Cloud Computing not only in Uganda but also across Africa.</p><p>The event was centered around “Introduction to Cloud Computing and Cloud Native Technologies”. It was led by Janet Namutebi, a Software Engineer and alumni of the Google Students Developer Circle Makerere University Chapter. The Crane Cloud team arrived early to find the Cavendish University team led by Joel who is the current Lead for the GDSC for Cavendish university had already finalized the setup, complete with a zoom link for people online to join in. Participant coordination was done by the Cavendish University team as Janet led a successful interactive session, giving precise examples and taking as many questions as possible to engage the participants and ensure knowledge was imparted.</p><p>Janet started off by giving an overview of cloud computing, its benefits, and why it is important in today’s world. She went on to explain cloud-native technologies, which are applications built to run optimally on a cloud infrastructure. Janet gave examples of cloud-native technologies such as Docker, and Kubernetes. She then proceeded to explain how these technologies work and their benefits in terms of scaling, availability, and cost efficiency.</p><p>The participants were fully engaged throughout the session, asking relevant questions and seeking clarification where necessary. Janet was quite patient and thorough in her explanations, making sure that everyone in attendance understood the topic at hand.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5zWInJR13mvk6Vzi2y4Cew.jpeg" /><figcaption>Group photo with some of the participants</figcaption></figure><p>At the end of the session, a “Kahoot” quiz was held, with participants being quizzed on the day’s topic. The quiz was quite exciting, and winners were rewarded with swag from Crane Cloud that included T-shirts, stickers, and wristbands. The participants were excited and appreciative of the gesture, which added to the already great atmosphere.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/1*xpKZkK2pJLJCA3VSpOC0PQ.jpeg" /><figcaption>Dr. Kim ICT faculty patron at Cavendish University with the Kahoot Winner</figcaption></figure><p>The session was closed with snacks for everyone as the Crane Cloud team announced that the follow-up session the coming Saturday would be better, more in-depth, and more hands-on. The participants left the event energized and looking forward to the next session.</p><p>Overall, the event was a great success, with the Crane Cloud team and the Google Student Developer Circle, Cavendish University Chapter, doing an excellent job in organizing and coordinating the event. The choice of Janet Namutebi as the main speaker was also spot on, given her expertise and experience in cloud computing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bVL3psZaYvZphe69YILzrA.jpeg" /><figcaption>A group photo after the event.</figcaption></figure><p>The Crane Cloud team’s effort in spreading the gospel of cloud computing is quite commendable, and this event is just one of many initiatives aimed at achieving this. It is also a great opportunity for students and developers to learn and acquire new skills that will be relevant in today’s rapidly evolving technological landscape.</p><p>In conclusion, the first of four events under “The Cloud Talk” theme was a great success, and we look forward to more insightful and engaging sessions in the coming weeks.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=425240de2e1d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/cranecloud/cloud-talk-intro-to-cloud-computing-425240de2e1d">Cloud Talk: Intro to Cloud Computing</a> was originally published in <a href="https://medium.com/cranecloud">Crane Cloud</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[JSON Upload and Download to Local Storage — Firebase.]]></title>
            <link>https://medium.com/cranecloud/json-upload-and-download-to-local-storage-firebase-967f60cc2aa9?source=rss-ade0ab3890df------2</link>
            <guid isPermaLink="false">https://medium.com/p/967f60cc2aa9</guid>
            <category><![CDATA[firebase]]></category>
            <category><![CDATA[json]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Derrick]]></dc:creator>
            <pubDate>Wed, 01 Mar 2023 18:00:26 GMT</pubDate>
            <atom:updated>2023-03-01T18:00:26.053Z</atom:updated>
            <content:encoded><![CDATA[<h3>JSON Upload and Download to Local Storage — Firebase.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IJwHVzt2AEXUefQkVphZMg.png" /></figure><p>Last week, I had a dilemma on how to upload and download JSON data to firebase. The system design required that the data on Firebase be stored in JSON files that had a cron job that periodically synced for more complex functionality on the admin side but for a regular user, I wanted them to just be able to upload and download at ease with downloading having an abstracted functionality of picking the local storage object and converting it into a JSON file and downloading doing the reverse.</p><p>Uploading and downloading JSON files to and from Firebase can be a useful feature for many web applications lately. With it allowing for easy data storage, management, and sharing. In the next paragraphs, I detail as we explore the process of doing exactly that.</p><p>Firebase is a popular mobile and web application development platform owned by Google. It offers a variety of services such as real-time database, authentication, storage, and hosting. Firebase Storage is one of the services offered by Firebase that allows users to store and retrieve files in the cloud. It can be used to store various types of files, including JSON files — which is our focus today.</p><p>To upload a JSON file to Firebase Storage, I had to first convert the JavaScript object into a Blob. A <strong>Blob</strong> is a binary representation of data that can be used to store files. We can create a Blob from a JavaScript object using the Blob constructor. The constructor takes an array of values and an options object as parameters. We can set the type of the Blob to “<em>application/json</em>” to indicate that it is a JSON file.</p><p>Once we have created the Blob, we can use the File constructor to create an actual file. The constructor takes the Blob and a file name as parameters. We can then use the put method of the Firebase Storage reference to upload the file to the storage bucket. The put method takes the file and an optional metadata object as parameters.</p><p>Here is an example code snippet that demonstrates how to upload a JSON file to Firebase Storage:</p><pre>var filename = jsonFileName + &#39;.json&#39;;<br>// Get the JSON string and parse it into an object<br>var userObject = JSON.parse(localStorage.getItem(&quot;user&quot;));<br><br>// Create a new Blob object with the JSON string as content<br>const blob = new Blob([userJSON], { type: &quot;application/json&quot; });<br><br>let storageRef = firebase.storage().ref(&quot;json/&quot; + filename);<br>let uploadTask = storageRef.put(blob);</pre><p>In the above code, we first pick a JavaScript object from local storage. We then create a Blob from the object using the <strong><em>JSON.stringify</em></strong> method. We pass the Blob and the file name to the File constructor to create the file. We then create a Firebase Storage reference and use the put method to upload the file to the storage bucket.</p><p>To download a JSON file from Firebase Storage, we can use the <strong><em>getDownloadURL</em></strong> method of the storage reference. The method returns a Promise that resolves with the download URL of the file. We can then use the fetch API to download the file from the URL. Once we have the file content, we can parse it into a JavaScript object using the <strong><em>JSON.parse</em></strong> method.</p><p>Here is an example code snippet that demonstrates how to download a JSON file from Firebase Storage:</p><pre>const storageRef = firebase.storage().ref().child(&quot;data.json&quot;);<br>storageRef.getDownloadURL()<br>  .then(url =&gt; fetch(url))<br>  .then(response =&gt; response.json())<br>  .then(data =&gt; localStorage.setItem(&quot;data&quot;, JSON.stringify(data)));</pre><p>In the above code, we first create a Firebase Storage reference to the file we want to download. We then use the <strong><em>getDownloadURL</em></strong> method to get the download URL of the file. We use the fetch API to download the file from the URL. Once we have the file content, we parse it into a JavaScript object using the <strong><em>JSON.parse</em></strong> method. Finally, we store the object in local storage using the <strong><em>setItem</em></strong> method.</p><p>However, there is a known issue with downloading JSON files from Firebase Storage. When we try to download a JSON file directly from the Firebase Storage URL, we may get a CORS (Cross-Origin Resource Sharing) error. This is because Firebase Storage restricts direct access to files from domains other than firebaseapp.com. To mitigate this issue, we need to set the CORS configuration for the Firebase Storage bucket.</p><p>To set the CORS configuration for the Firebase Storage bucket, we can use the <strong><em>gsutil</em></strong> tool provided by Google Cloud SDK. Setting up the tool locally can be done using <a href="https://cloud.google.com/storage/docs/gsutil_install">this documentation</a>.</p><p>I created a filed locally called <strong>cors.json </strong>and<strong> </strong>added this as its contents. This configuration allows GET requests from any domain for up to one hour.</p><pre>[    <br>    {        <br>        &quot;origin&quot;: [&quot;*&quot;],<br>        &quot;method&quot;: [&quot;GET&quot;],<br>        &quot;maxAgeSeconds&quot;: 3600<br>    }<br>]</pre><pre>gsutil cors set cors.json gs://[BUCKET_NAME]</pre><p>Replace [BUCKET_NAME] with the name of your Firebase Storage bucket. With the CORS configuration set, we can now download the JSON file from Firebase Storage without getting a CORS error.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=967f60cc2aa9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/cranecloud/json-upload-and-download-to-local-storage-firebase-967f60cc2aa9">JSON Upload and Download to Local Storage — Firebase.</a> was originally published in <a href="https://medium.com/cranecloud">Crane Cloud</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>