<?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: Abdulquddus Abdulrahman (Lexzee)</title>
    <description>The latest articles on Forem by Abdulquddus Abdulrahman (Lexzee) (@lexzee).</description>
    <link>https://forem.com/lexzee</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%2F2052209%2F36e5cb11-4ccd-4808-8905-d9a9dc6cd670.jpeg</url>
      <title>Forem: Abdulquddus Abdulrahman (Lexzee)</title>
      <link>https://forem.com/lexzee</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/lexzee"/>
    <language>en</language>
    <item>
      <title>Setting up FastAPI development on Mobile</title>
      <dc:creator>Abdulquddus Abdulrahman (Lexzee)</dc:creator>
      <pubDate>Tue, 19 Aug 2025 01:45:19 +0000</pubDate>
      <link>https://forem.com/lexzee/setting-up-fastapi-development-on-mobile-5ei0</link>
      <guid>https://forem.com/lexzee/setting-up-fastapi-development-on-mobile-5ei0</guid>
      <description>&lt;p&gt;In today's digital age, the ability to perform back-end development directly from a mobile device offers unparalleled flexibility and convenience. This article will guide you through the process of configuring your mobile device for back-end development, with a special focus on FastAPI. By setting up this environment, you'll be equipped to efficiently manage development tasks that require terminal access, all from the palm of your hand. Whether you're a seasoned developer or just starting out, this setup will empower you to harness the full potential of mobile technology in your development workflow.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Apps to download&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://play.google.com/store/apps/details?id=com.foxdebug.acodefree" rel="noopener noreferrer"&gt;Acode&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://termux.dev/" rel="noopener noreferrer"&gt;Termux&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Setting up Termux
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Open Termux and run the following commands
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;1. Select repo (optional)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This command allows you to choose from available mirrors, which are servers that host the packages Termux will download. Selecting a mirror can help improve download speeds and reliability.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;termux-change-repo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This brings up a pop-up for you to choose from the available mirrors. These mirrors are where Termux will download packages from. Just keep pressing enter until the pop-up closes.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fryyb28e8g8pappfsc67y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fryyb28e8g8pappfsc67y.png" alt="Termux repo change" width="446" height="472"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Setting up storage&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;termux-setup-storage
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command creates a shared storage space between Termux and your phone, enabling Termux to access your phone's files and folders.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fefzgmifoio6a0947l6mg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fefzgmifoio6a0947l6mg.png" width="459" height="130"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Update and Upgrade environment packages&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;apt update &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; apt upgrade &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Running this command updates the package lists and upgrades all installed packages to their latest versions, ensuring your environment is up to date.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj1kp5oxlgkt6293rrbka.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj1kp5oxlgkt6293rrbka.png" alt=" " width="460" height="188"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv5cr1l3ss24x3jmmszsn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv5cr1l3ss24x3jmmszsn.png" alt=" " width="460" height="133"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Installing required tools&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pkg &lt;span class="nb"&gt;install &lt;/span&gt;python rust git &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command installs Python, Rust, and Git. Python is necessary for running FastAPI, Rust is required for compiling some dependencies, and Git is used for version control.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python &lt;span class="nt"&gt;--version&lt;/span&gt;
rustc &lt;span class="nt"&gt;--version&lt;/span&gt;
cargo  &lt;span class="nt"&gt;--version&lt;/span&gt;
git &lt;span class="nt"&gt;--version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These commands will check if all the packages are installed successfully. You can either run them line by line or just copy and paste them all at once.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fttngvnj8h94f3224s8zt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fttngvnj8h94f3224s8zt.png" alt=" " width="452" height="402"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Create a symlink to a folder that'll be holding your projects&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;mkdir&lt;/span&gt; ~/storage/shared/MyDevFolder
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will create a folder called MyDevFolder in your main storage. On some Android devices, &lt;code&gt;/storage/shared&lt;/code&gt; is &lt;code&gt;/storage/emulated/0&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;ln&lt;/span&gt; &lt;span class="nt"&gt;-s&lt;/span&gt; ~/storage/shared/MyDevFolder ~/MyDevFolder
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command creates a symbolic link (shortcut) to MyDevFolder in your main storage, making it easier to access your project files from Termux&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgvqu0p18nwjvy26klmf6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgvqu0p18nwjvy26klmf6.png" alt=" " width="462" height="218"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Create an empty project folder in &lt;code&gt;MyDevFolder&lt;/code&gt; using:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;mkdir &lt;/span&gt;MyDevFolder/testProject
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;6. Setting up a python virtual environment&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Termux doesn't let you install Python packages directly in the environment, so you need to create a virtual environment for your projects. This ensures that all the packages you install will be specific to each project and won't interfere with your existing Python installation or the global environment.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python &lt;span class="nt"&gt;-m&lt;/span&gt;  venv .venv/testProject
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command will create a virtual environment stored in the &lt;code&gt;.venv&lt;/code&gt; folder for the specific testProject.&lt;/p&gt;

&lt;p&gt;To activate the virtual environment, run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;.&lt;/span&gt; ~/.venv/testProject/bin/activate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Change directory to the project folder:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;MyDevFolder/testProject
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjlmz2j2s2otskhknqcyp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjlmz2j2s2otskhknqcyp.png" alt=" " width="451" height="64"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;and Install FastAPI with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="s2"&gt;"fastapi[standard]"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command installs FastAPI and its dependencies within the virtual environment, allowing you to develop and run FastAPI applications.&lt;/p&gt;

&lt;p&gt;The installation and build process might take some time to complete. Please wait until it finishes, then continue to the next phase.&lt;/p&gt;

&lt;h2&gt;
  
  
  Using Acode as a Text Editor
&lt;/h2&gt;

&lt;p&gt;You can edit and write your code directly in Termux using text editors like nano, Vim, or micro. To make things easier, we will use Acode, which has an interface similar to desktop editors like VS Code, but it's designed for mobile.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Add MyDevFolder to the path&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Add your Dev folder to Acode so you can easily access all your projects.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Click the three lines in the upper left corner&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Tap “Open Folder”&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click on “Add a storage”&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click “Select folder” and choose “MyDevFolder”&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click “Use this folder” (depending on your device)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Select “Allow” on the next pop-up, then “Ok”&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Select “MyDevFolder” in Acode, and click the ✅ in the bottom corner&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You should have this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmkrshndpiagelnccwtpi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmkrshndpiagelnccwtpi.png" alt="Acode Side Nav" width="448" height="155"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Create&lt;/strong&gt; a &lt;code&gt;main.py&lt;/code&gt; &lt;strong&gt;file in&lt;/strong&gt; &lt;code&gt;testProject&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Press and hold on "testProject," then choose "New file" and name it "main.py."&lt;/p&gt;

&lt;p&gt;Add this starter code to the file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;fastapi&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;FastAPI&lt;/span&gt;

&lt;span class="n"&gt;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;FastAPI&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="nd"&gt;@app.get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;/&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;welcome&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;message&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Welcome to FastAPI&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save the changes and return to Termux.&lt;/p&gt;

&lt;h2&gt;
  
  
  Running FastAPI development server
&lt;/h2&gt;

&lt;p&gt;Run this command in your Termux terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;fastapi dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should see an output like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fncgcmpcnztmw8ysixsqz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fncgcmpcnztmw8ysixsqz.png" alt="fast dev sever running" width="452" height="668"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Copy and paste the link into your browser, and you should see this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn5bkodiuw2q5mp5ydk1v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn5bkodiuw2q5mp5ydk1v.png" alt="Your API's documentation page" width="455" height="483"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Congratulations! 🎉 Your device is now fully set up to run FastAPI development.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In conclusion, setting up FastAPI on your mobile device provides a unique blend of flexibility, convenience, and efficiency, allowing you to manage back-end development tasks from virtually anywhere. This setup not only enhances your ability to work on-the-go but also serves as a cost-effective solution for developers looking to maximize their productivity without additional hardware investments. With this newfound capability, you're encouraged to explore further development possibilities, experiment with new APIs, and collaborate on projects, unlocking new avenues for creativity and innovation in your workflow.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>backenddevelopment</category>
      <category>fastapi</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
