<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Mousam33</title>
    <description>The latest articles on Forem by Mousam33 (@mousam33).</description>
    <link>https://forem.com/mousam33</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%2F1043956%2F188b813b-c583-453f-8b3a-006f0f827d86.png</url>
      <title>Forem: Mousam33</title>
      <link>https://forem.com/mousam33</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/mousam33"/>
    <language>en</language>
    <item>
      <title>How to host your full stack app online free (possibly) forever.</title>
      <dc:creator>Mousam33</dc:creator>
      <pubDate>Mon, 13 Mar 2023 03:12:49 +0000</pubDate>
      <link>https://forem.com/mousam33/how-to-host-your-full-stack-app-online-free-possibly-forever-bbc</link>
      <guid>https://forem.com/mousam33/how-to-host-your-full-stack-app-online-free-possibly-forever-bbc</guid>
      <description>&lt;h2&gt;
  
  
  My todo list &lt;a href="https://cozy-panda-413e52.netlify.app/"&gt;app&lt;/a&gt; hosted for free.
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;[Note: This article is only for development/project purposes]&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pre-requisites:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;You'll be needing your app fully built, this tutorial focuses only on the hosting part.&lt;/li&gt;
&lt;li&gt;Ready everything for deployment. In my case, I used a jar file for the back end and the front end is a react app.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Limitations&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;You'll probably use a database or a file to store your data in the back end, currently the storage limit is capped at 500 Mb.&lt;/li&gt;
&lt;li&gt;The back end process will end after approximately 30 minutes of inactivity. However, it is automatically restarted when the endpoint is hit.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;A bit about my todo list app&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I used springboot for making the app's back end, with a h2 file database. It is hosted in &lt;a href="https://replit.com/~"&gt;replit&lt;/a&gt;. Hosting your back end here provides you with a "https" endpoint.&lt;/p&gt;

&lt;p&gt;The front end is made with react and tailwind. It is hosted in &lt;a href="https://www.netlify.com/"&gt;netlify&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Hosting the back end&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create an account with replit.&lt;/li&gt;
&lt;li&gt;You should see a screen like below after you log in.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--MIaf6KWD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c4ibik3x58fq283vmeqh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--MIaf6KWD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c4ibik3x58fq283vmeqh.png" alt="Image description" width="800" height="305"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Now, go ahead and click on "Create Repl", you should see a pop up as below, here choose the java template (if you want to host a jar file) and assign a Title to your project.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2HBo-uQZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d58y2gkfb3jjt75gfhm7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2HBo-uQZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d58y2gkfb3jjt75gfhm7.png" alt="Image description" width="800" height="578"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--DbkY9ZDU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/628ut058qj0l481bsyc1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--DbkY9ZDU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/628ut058qj0l481bsyc1.png" alt="Image description" width="800" height="468"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Here's what you should be seeing. A Main.java file, along with other files.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ciIA0QxP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3s10ycau3hl8h5mbgulx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ciIA0QxP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3s10ycau3hl8h5mbgulx.png" alt="Image description" width="800" height="362"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Delete all files by clicking on the 3 dots that appear next to a file while hovering on it, and upload your jar file by clicking on the 3 dots on top-right of the "Files" pane.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rRvLIi48--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w3kcxefb37rh2vg37ecj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rRvLIi48--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w3kcxefb37rh2vg37ecj.png" alt="Image description" width="452" height="682"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;After the upload is done, once again click on the same button and select "Show hidden files".&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You should see "Config files" section appear, from there select the ".replit" file.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--DCzRd9fB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l7j8k9n6gswdwbbxpyfv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--DCzRd9fB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l7j8k9n6gswdwbbxpyfv.png" alt="Image description" width="800" height="376"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Now, clear everything in the .replit file until "[packager]" and replace "run" with your own command.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Ti0FSXwj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iktwiv26j19q3uvhml7t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Ti0FSXwj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iktwiv26j19q3uvhml7t.png" alt="Image description" width="800" height="394"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Modifying the ".replit" file changes the behaviour of the "Run" button. Upon starting it, in my case, I saw the typical springboot output on the terminal and replit provided me with a custom "https" url shown on the "webview" pane on the top-right corner of the repl section.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7sRvpNfG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z68kwbu1u66u5viizegn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7sRvpNfG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z68kwbu1u66u5viizegn.png" alt="Image description" width="800" height="826"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And that's it. The API endpoints should now be available.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Hosting the front end&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create a netlify account.&lt;/li&gt;
&lt;li&gt;Log in and in the "Sites" section, select the drop down "Add a new site" and choose "Deploy manually".&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--mKPhwOsM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gsokwbq1g7564ou14hjo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mKPhwOsM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gsokwbq1g7564ou14hjo.png" alt="Image description" width="658" height="334"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;All you have to do now is drag and drop your "build" folder in case you have used react. Otherwise, a folder that contains your "index.html" file should work fine.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Netlify will provide you with your site URL.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You're done.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Final words&lt;/strong&gt;&lt;br&gt;
Once again, this is by no means a tutorial for deploying production level apps. This should only be used for small pet projects.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>java</category>
      <category>react</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
