<?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: Paul</title>
    <description>The latest articles on DEV Community by Paul (@irosthebeggar).</description>
    <link>https://dev.to/irosthebeggar</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%2F125126%2Fbab965f6-820b-4dd1-b332-887e06a0d37e.png</url>
      <title>DEV Community: Paul</title>
      <link>https://dev.to/irosthebeggar</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/irosthebeggar"/>
    <language>en</language>
    <item>
      <title>Publishing Websites From Home</title>
      <dc:creator>Paul</dc:creator>
      <pubDate>Mon, 22 Apr 2019 06:41:14 +0000</pubDate>
      <link>https://dev.to/irosthebeggar/publishing-websites-at-home-44d3</link>
      <guid>https://dev.to/irosthebeggar/publishing-websites-at-home-44d3</guid>
      <description>&lt;h2&gt;
  
  
  What If I Want to Host My Own Content on the Internet?
&lt;/h2&gt;

&lt;p&gt;Let's say you make something and you want distribute it for free on the internet. Here is the large pile of technical bullshit you have to go through:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Construct your website&lt;/li&gt;
&lt;li&gt;Buy a domain&lt;/li&gt;
&lt;li&gt;Configure DNS for your domain&lt;/li&gt;
&lt;li&gt;Rent a dedicated server&lt;/li&gt;
&lt;li&gt;Install all the software you need&lt;/li&gt;
&lt;li&gt;Upload you site your dedicated server (it's harder than it sounds)&lt;/li&gt;
&lt;li&gt;Get SSL configured for your domain&lt;/li&gt;
&lt;li&gt;Update your server and SSL on a regular basis&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you have never dealt with those problems before, it will take you a long time to figure them all out.  I know because I've already this problem for myself.  Don't try it if you're not willing to dedicate months of your time.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Great Internet Inequality
&lt;/h2&gt;

&lt;p&gt;There's an inequality about the internet I've never been able to get over.  It's an  inequality that has nothing to do with personal identity, but is all about content. Accessing content on the internet is stupidly easy.  I see kids who are too young to walk able to handle an iPhone.  &lt;/p&gt;

&lt;p&gt;Independently publishing some content to the internet is impossible.&lt;/p&gt;

&lt;p&gt;I want to focus on the &lt;code&gt;Independent Publishing&lt;/code&gt; part of this. There are plenty of corporations the exist with the only purpose of getting your content published on the internet.  They have flashy websites, and they will make you their personal bitch for using their services.  Whenever you publish your content through someone'e else site, you and your content are subject to all sorts of ever changing rules and legal mumbo jumbo.  And you can guarantee your data is being analyzed and sold as well.&lt;/p&gt;

&lt;p&gt;Oh, and if you want to make some money off that content yor worked tirelessly to produce, there is at least a minimum 15% fee (usually %20 or higher) from whatever service you choose to serve your content.&lt;/p&gt;

&lt;h2&gt;
  
  
  Publishing From Home
&lt;/h2&gt;

&lt;p&gt;If you have a computer that can access the internet, you should theoretically be able to publish a website anyone else can access from that same computer.  This includes smartphones.&lt;/p&gt;

&lt;p&gt;In practice, this is not possible. For several reasons:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You still need to buy a domain and do DNS configuration&lt;/li&gt;
&lt;li&gt;Port forwarding is complicated and might not even be possible depending on your situation&lt;/li&gt;
&lt;li&gt;ISPs block port 80 &amp;amp; 443 just to make things complex&lt;/li&gt;
&lt;li&gt;Most server software was never designed to be run on a home computer&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So now you're stuck with two options if you want to publish stuff from home.  Get a PhD in computer science, or just go through some sleazy corporation that's going to take a 20% cut of whatever money your content makes.&lt;/p&gt;

&lt;p&gt;Almost everyone goes through the corporation.  And let's be real, a computer science degree won't even cover this kind of topic. &lt;/p&gt;

&lt;h2&gt;
  
  
  The Reverse Proxy Network (RPN)
&lt;/h2&gt;

&lt;p&gt;The RPN is something I've been working on for the last few years. It's basically an inverted VPN. While the VPN lets you access the internet from a different location, the RPN lets you publish your content from a different location.  And location makes a huge difference.&lt;/p&gt;

&lt;p&gt;Netflix has different content catalogs based on location.  And you can get a VPN that makes Netflix think you are in one of those locations with better content.  By using a VPN, Netflix thinks your computer is now in Australia and serves you Australia's catalog.  Turn the VPN off, and Netflix now thinks you are in your own crappy country that's worse than Australia and serves your serves you the accordingly crappy catalog.&lt;/p&gt;

&lt;p&gt;On the internet, there's an ideal place to publish content. There's no ISPs or NATs or other three letter acronyms getting in the way of your publishing.  And a RPN lets others see your computer as if it where in that ideal place.&lt;/p&gt;

&lt;p&gt;Like a VPN, a RPN also helps with security. A well written RPN sets up SSL, obfuscates your IP, and blocks traffic on all ports except the one you choose. &lt;/p&gt;

&lt;h2&gt;
  
  
  A Working RPN
&lt;/h2&gt;

&lt;p&gt;Before I released anything, I wanted to make a fully functional example of the RPN.  So I made my own music streaming server called mStream.  It's cross platform and works on Windows, OSX, and Linux.&lt;/p&gt;

&lt;p&gt;mStream sets up a music server on the computer you run it on.  That way you can stream your music collection from that computer. I personally think Spotify's streaming quality sounds like hot garbage, so I built the mStream server so I can stream my higher quality files straight from my home computer.&lt;/p&gt;

&lt;p&gt;mStream Server comes with an optional RPN built right in.  You just nee to run the program and login to the RPN, and you can access your music collection from anywhere on the internet.  The service is currently invite only, because there's been a lot of demand and I don't want to scale the product too fast.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://mstream.io" rel="noopener noreferrer"&gt;https://mstream.io&lt;/a&gt;&lt;/p&gt;

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

&lt;h2&gt;
  
  
  More Coming Soon
&lt;/h2&gt;

&lt;p&gt;RPN tech has been really popular with the kind of people who have never touched a terminal in their life.  If there is a technical interest for this kind of thing, I will publish more on this site.&lt;/p&gt;

</description>
      <category>vpn</category>
      <category>network</category>
      <category>dns</category>
      <category>publishing</category>
    </item>
    <item>
      <title>2 Months of Flutter Development</title>
      <dc:creator>Paul</dc:creator>
      <pubDate>Sat, 23 Mar 2019 05:53:15 +0000</pubDate>
      <link>https://dev.to/irosthebeggar/2-months-of-flutter-development-2gi5</link>
      <guid>https://dev.to/irosthebeggar/2-months-of-flutter-development-2gi5</guid>
      <description>&lt;p&gt;I started writing some posts on Flutter development back in January, but quickly gave up because writing sucks up a lot of screen time and I like to use that time for other things.  I spend enough time sitting on my ass programming already.&lt;/p&gt;

&lt;p&gt;One article a month sounds much more achievable.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Good
&lt;/h2&gt;

&lt;p&gt;My experience with mobile development is limited to Android dev.  &lt;/p&gt;

&lt;p&gt;If you are going to start mobile dev, I would recommend just going straight to Flutter.  It's faster to pick up than Android development (I've never picked done any iOS dev).  And it't more stable than any other cross platform solution. And the dart package manager is has a lot of high quality packages ready to use.&lt;/p&gt;

&lt;p&gt;I can safely say this is the future of mobile development.  And since Google is backing it, it might actually be the primary form of Android development in the future.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Bad
&lt;/h2&gt;

&lt;p&gt;It's the worst of NPM. And you can't even upgrade a package if it has conflicting dependancies with another one of your packages. (This will be really fun once packages stop getting maintained).&lt;/p&gt;

&lt;p&gt;It feels exactly like programming Javascript because Dart also runs on a single-threaded, asynchronous, event loop.  But there's also a much heavier class system so it feels like coding Java as well. I got lucky and was able to pick up quickly because I've worked extensively with both those languages, but a green programmer might have some trouble with the learning curve.  And since Dart is a newer language, finding solutions to problems requires a mastery of google-fu. (expect to learn a lot about darts the pub game as well)&lt;/p&gt;

&lt;p&gt;It's the WORST of PHP. With Flutter you can put all your UI code and business code in the same file.  Reading through someone else'e Flutter code feels like digging through PHP projects before frameworks got popular.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Spaghetti
&lt;/h2&gt;

&lt;p&gt;In Flutter, the entire UI is written in code.  You make new UI elements by writing something like&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Column(children:[
  Text('Your First Paragraph'),
  Row(children:[
     // You Get The Point
  ])
])
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;There's a lot to be said about the pros and cons of this.  It is easy to work with, but feels less flexible when compared to CSS/HTML.  And there are some rough edges dealing with images.  But the biggest side effect of the 'your UI is code' design philosophy is the spaghetti it makes.&lt;/p&gt;

&lt;p&gt;If you have ever worked on PHP, you probably know about how easy it is to make spaghetti by combining UI and code.  If you have not worked on PHP, the idea is you can embed PHP directly into HTML files.  If done correctly, this makes for a powerful templating language.  When left to an amateur, this leads to 10,000 lined html files that are a bastardization of business logic and UI code.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://mstream.io/software"&gt;My first Flutter app&lt;/a&gt; has already hit the point of hard to read.  I need to spend some time to clean it up and break it into logical chunks.  Right now most of the UI is broken into a handful of 100+ line classes.  And those classes are embedded with event handling code that does a lot of business type logic.  And to top it off I got a little too liberal with global variables.&lt;/p&gt;

</description>
      <category>flutter</category>
      <category>mobile</category>
      <category>dart</category>
      <category>android</category>
    </item>
    <item>
      <title>Flutter Development: Day 1 - Choosing Packages</title>
      <dc:creator>Paul</dc:creator>
      <pubDate>Sat, 05 Jan 2019 17:02:51 +0000</pubDate>
      <link>https://dev.to/irosthebeggar/flutter---making-a-music-app-day-1---choosing-packages-28e7</link>
      <guid>https://dev.to/irosthebeggar/flutter---making-a-music-app-day-1---choosing-packages-28e7</guid>
      <description>&lt;p&gt;&lt;a href="https://dev.to/irosthebeggar/flutter-development-day-0-4585"&gt;During Day 0 I got the Flutter Environment Running&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Goal
&lt;/h2&gt;

&lt;p&gt;To select and test packages needed to make a &lt;a href="https://github.com/IrosTheBeggar/mStream"&gt;mStream&lt;/a&gt; Music App&lt;/p&gt;

&lt;h2&gt;
  
  
  The Package Ecosystem
&lt;/h2&gt;

&lt;p&gt;You can search for Dart packages at: &lt;a href="https://pub.dartlang.org/"&gt;https://pub.dartlang.org/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Handling packages in Dart is very similar to handling packages with NPM.  You just write the package name and version in the &lt;code&gt;pubspec.yaml&lt;/code&gt; file and the Flutter environment will automatically install it.  Some packages require you to edit config files in the Android and iOS directories, but so far all the instructions have been easy to follow.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;My pubspec.yaml File:&lt;/em&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--xv2JUr-A--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/3jzwtnh81twbdpm9k9mx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--xv2JUr-A--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/3jzwtnh81twbdpm9k9mx.png" alt="My pubspec.yaml file"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Packages Needed for A Music App
&lt;/h2&gt;

&lt;p&gt;I'll be testing out the following packages.  These should cover all the core features for a music syncing and streaming app:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;HTTP Requests: &lt;a href="https://pub.dartlang.org/packages/http"&gt;The aptly named HTTP library&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Filepath Constructor: &lt;a href="https://pub.dartlang.org/packages/path"&gt;Path Library&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;File Downloads: &lt;a href="https://dev.toflutter_downloader"&gt;Download Manager&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Music Playback: &lt;a href="https://pub.dartlang.org/packages/audioplayers"&gt;Audioplayers Library&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  HTTP, Path, &amp;amp; Downloads
&lt;/h2&gt;

&lt;p&gt;The HTTP and path libraries were easy to setup and test and worked exactly as expected.  Nothing interesting to report here.&lt;/p&gt;

&lt;p&gt;The Download Manager worked just fine as well, but I'll be interested to see how it holds up when syncing a large batch of files.&lt;/p&gt;

&lt;h2&gt;
  
  
  Music Playback
&lt;/h2&gt;

&lt;p&gt;Music playback is more complicated.  The audioplayers library provided an easy to use api for creating multiple audio players that could stream from a remote server.  Having multiple audio player is crucial for gapless playback.  While one player is playing, a second player can cache the next song in the playlist.  &lt;/p&gt;

&lt;p&gt;The audioplayers library does not tie into any of the native audio controls.  So It will be necessary to write some native code for iOS and Android to handle things like lock screen widgets.  There is another library called &lt;a href="https://github.com/ryanheise/audio_service"&gt;audio_service&lt;/a&gt; that handles these things, but it's for Android only and breaks the iOS builds&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;The Dart package manager is very similar to NPM. The Dart Package Manager website even looks like the NPM website. If you are familiar with Node/NPM you will have no problem getting started with Flutter basics.  &lt;/p&gt;

&lt;p&gt;When developing for Android a few years ago it took me over a day just to get a http library working.  With Flutter I was able to test multiple libraries on both Android and iOS in just a few hours.&lt;/p&gt;

&lt;p&gt;The Dart ecosystem already appears to have a lot of core libraries in place as well.  It took me no time to find well documented packages for basic things like HTTP requests, download management, etc.  My only complaint is that the audio libraries are still immature. However this is not surprising considering how complicated media can be and how new Flutter is.&lt;/p&gt;

&lt;h1&gt;
  
  
  Next Steps
&lt;/h1&gt;

&lt;p&gt;Like I said above, the media handling libraries are still immature.  I'm going to develop media streaming for the app after all other features are done.  This way I can re-evalute the media libraries at a later date.  Right now I risk developing against an immature library that loses support.  If this happens I will have to choose a new library later and then re-write all the code against that.&lt;/p&gt;

&lt;p&gt;For now development will concentrate on browsing the music catalog and syncing files between devices.  This will be the fastest path to get the app in a useable state.  From here, mStream users can use whatever mobile audio app they want to play files after being synced.&lt;/p&gt;

</description>
      <category>flutter</category>
      <category>dart</category>
      <category>ios</category>
      <category>android</category>
    </item>
    <item>
      <title>Flutter Development: Day 0</title>
      <dc:creator>Paul</dc:creator>
      <pubDate>Wed, 02 Jan 2019 21:14:16 +0000</pubDate>
      <link>https://dev.to/irosthebeggar/flutter-development-day-0-4585</link>
      <guid>https://dev.to/irosthebeggar/flutter-development-day-0-4585</guid>
      <description>&lt;h2&gt;
  
  
  Goal
&lt;/h2&gt;

&lt;p&gt;To write a music player app in Flutter and release it for Android and iPhone&lt;/p&gt;

&lt;h2&gt;
  
  
  Back Story
&lt;/h2&gt;

&lt;p&gt;I am the owner of a music streaming server called &lt;a href="https://github.com/IrosTheBeggar/mStream"&gt;mStream&lt;/a&gt;.  The goal of mStream is to be a self hosted music server anyone can use.  Currently, mStream Server is stable and in a good place.&lt;/p&gt;

&lt;p&gt;The thing users ask me for the most is a mobile app for the server.  The ideal mobile app would be able to automatically sync music between the server and phone and be able to stream music on demand.  There should also be an option to transcode streams to avoid using too much data. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/IrosTheBeggar/mstream-android-app/issues"&gt;I have tried to make an Android app in the past.&lt;/a&gt;  The app currently works but is has bugs and the UI is clunky.  Turns out writing apps for Android is incredibly time consuming.  I even had help from a friend and professional Android developer and the project still never got very far. And the idea of having to redo the whole thing to make the iOS app just put me off from app development for a while.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Plan
&lt;/h2&gt;

&lt;p&gt;Today's goal is to get the Flutter environment running and to run an example app iOS and Android.&lt;/p&gt;

&lt;p&gt;The long-term plan to is to build the app in several steps&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 0:&lt;/strong&gt; Research libraries needed to build this app.  &lt;a href="https://pub.dartlang.org/"&gt;Dart has a package manager to makes searching for cross platform libraries easy&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1:&lt;/strong&gt; Get the app to connect to the server login. Then get the File Explorer, Playlists, Albums, Artists, and Starred APIs connected.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2:&lt;/strong&gt; Implement a file sync function between server with the phones filesystem&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3:&lt;/strong&gt; Add music streaming to the app.&lt;/p&gt;

&lt;h2&gt;
  
  
  Today's Results
&lt;/h2&gt;

&lt;p&gt;I was able to get the Flutter environment up and running by following the instructions at: &lt;a href="https://flutter.io/docs/get-started/install"&gt;https://flutter.io/docs/get-started/install&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I was VERY impressed with the quality of the install guide for OSX.  The instructions were clear, concise, and easy to follow. They even gave explanations when the was some mysterious commands to be cut and pasted into the prompt:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--qyRWw-UH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/74tn1zcrulqrcgqp7vm0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qyRWw-UH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/74tn1zcrulqrcgqp7vm0.png" alt="Example of a good docs"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The CLI tool 'flutter doctor' made it easy to debug problems when installing Android Studio and XCode.  The hardest part of the installation process was installing all the necessary dependencies for Android Studio. &lt;/p&gt;

&lt;p&gt;Once all the dependencies were installed, I opened up Visual Studio Code and installed their Flutter plugin. The Flutter plugin comes with a function to build an example project. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--qTqkF9ua--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/3dxwwlcrqpa3p5irr261.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qTqkF9ua--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/3dxwwlcrqpa3p5irr261.png" alt="Visual Studio Code Drop Down Menu"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I was able to run the example project on both and iPhone and Android Emulator immediately.  &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---0yPbHV7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/9s084i4pv3j9gc31p80c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---0yPbHV7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/9s084i4pv3j9gc31p80c.png" alt="iOS emulator"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I spent a lot less time on installation than I thought I would.  Within a few hours I went from a clean system running an app on iOS and Android.  I'm hoping the rest of the development cycle is as easy as this.&lt;/p&gt;

</description>
      <category>flutter</category>
      <category>dart</category>
      <category>ios</category>
      <category>android</category>
    </item>
  </channel>
</rss>
