<?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: Puslore</title>
    <description>The latest articles on DEV Community by Puslore (@puslore).</description>
    <link>https://dev.to/puslore</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%2F3938264%2F65c9451f-b21c-49ef-82ad-c1ffbd042ab5.jpeg</url>
      <title>DEV Community: Puslore</title>
      <link>https://dev.to/puslore</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/puslore"/>
    <language>en</language>
    <item>
      <title>Deploying StockUp: A Step-by-Step Guide</title>
      <dc:creator>Puslore</dc:creator>
      <pubDate>Tue, 19 May 2026 02:30:43 +0000</pubDate>
      <link>https://dev.to/puslore/deploying-stockup-a-step-by-step-guide-4nkk</link>
      <guid>https://dev.to/puslore/deploying-stockup-a-step-by-step-guide-4nkk</guid>
      <description>&lt;h1&gt;
  
  
  Deploying StockUp: A Step-by-Step Guide
&lt;/h1&gt;

&lt;p&gt;StockUp is a Telegram Web App designed for family inventory management. Its architecture consists of a Python FastAPI backend, a Go notifier worker, a Vanilla JS frontend, and relies on PostgreSQL and Redis. This guide explains how to deploy the application on your server.&lt;br&gt;
You can also use our app directly, without self-hosting:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://medium.com/@kitamuranaoya348/i-was-tired-of-texting-do-we-need-milk-every-day-so-i-built-stockup-12bebffec5e3" rel="noopener noreferrer"&gt;How to use the app&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Source code:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/Alabaykin/StockUp" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Prerequisites: Installing Docker
&lt;/h2&gt;

&lt;p&gt;The StockUp project uses Docker to manage its services. This approach guarantees that the application runs consistently, regardless of your operating system. &lt;strong&gt;You must install Docker and Docker Compose before you begin.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Depending on your platform, follow the official documentation to install Docker:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Linux&lt;/strong&gt;: For most Linux distributions (like Ubuntu or Debian), you need to install Docker Engine. 
&lt;a href="https://docs.docker.com/engine/install/" rel="noopener noreferrer"&gt;Official Guide for Linux&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Windows&lt;/strong&gt;: If you are deploying on a Windows server or your personal computer, you must install Docker Desktop. 
&lt;a href="https://docs.docker.com/desktop/install/windows/" rel="noopener noreferrer"&gt;Official Guide for Windows&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Make sure Docker is running before moving to the next step.&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 1: Environment Configuration
&lt;/h2&gt;

&lt;p&gt;First, download the project code to your server. &lt;/p&gt;

&lt;p&gt;In the root folder of the project, you will find a file named &lt;code&gt;.env.example&lt;/code&gt;. You need to create a new file named &lt;code&gt;.env&lt;/code&gt; and configure your specific variables. &lt;/p&gt;

&lt;p&gt;Your &lt;code&gt;.env&lt;/code&gt; file should look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;BOT_TOKEN=your_telegram_bot_token
WEBAPP_URL=https://your-domain.com/ 
DATABASE_URL=postgresql+asyncpg://stockup_user:stockup_password@db:5432/stockup_db
REDIS_URL=redis://redis:6379/0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;  &lt;code&gt;BOT_TOKEN&lt;/code&gt;: Get this from BotFather in Telegram.&lt;/li&gt;
&lt;li&gt;  &lt;code&gt;WEBAPP_URL&lt;/code&gt;: The HTTPS URL where your frontend will be available (e.g., using ngrok for local testing or a real domain).&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 2: Running the Project
&lt;/h2&gt;

&lt;p&gt;Because all services (Database, Redis, Backend, and Notifier) are defined in the &lt;code&gt;docker-compose.yml&lt;/code&gt; file, starting the project is very simple.&lt;/p&gt;

&lt;p&gt;Open your terminal, navigate to the project directory, and run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker-compose up &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="nt"&gt;--build&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;  &lt;code&gt;up&lt;/code&gt;: Starts the containers.&lt;/li&gt;
&lt;li&gt;  &lt;code&gt;--build&lt;/code&gt;: Forces Docker to build the images for the Backend and Notifier before starting.&lt;/li&gt;
&lt;li&gt;  &lt;code&gt;-d&lt;/code&gt;: Runs the containers in the background (detached mode).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once the process finishes, the backend will be available at &lt;code&gt;http://localhost:8000&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Database Migrations
&lt;/h2&gt;

&lt;p&gt;After starting the containers for the first time, you need to set up the database tables. Run this command to apply Alembic migrations:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker-compose &lt;span class="nb"&gt;exec &lt;/span&gt;backend alembic upgrade &lt;span class="nb"&gt;head&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 4: Monitoring and Maintenance
&lt;/h2&gt;

&lt;p&gt;To check if everything works correctly, you can view the logs of your services. For example, to see the logs of the Go worker that sends Telegram messages, run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker-compose logs &lt;span class="nt"&gt;-f&lt;/span&gt; notifier
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To stop the application, use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker-compose down
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;By using Docker, deploying StockUp requires only a few commands. Ensure your environment variables are correct and your Docker daemon is active, and your Telegram Web App will be ready to use.&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>beginners</category>
      <category>docker</category>
    </item>
  </channel>
</rss>
