<?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: Bharath Kumar_30</title>
    <description>The latest articles on Forem by Bharath Kumar_30 (@bharath_kumar_30_vog).</description>
    <link>https://forem.com/bharath_kumar_30_vog</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%2F3761699%2F14147a64-3cbb-46c5-a9b1-205461d1ae70.jpg</url>
      <title>Forem: Bharath Kumar_30</title>
      <link>https://forem.com/bharath_kumar_30_vog</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/bharath_kumar_30_vog"/>
    <language>en</language>
    <item>
      <title>From Docker Failure to PostgreSQL Success: My Real Backend Learning Experience</title>
      <dc:creator>Bharath Kumar_30</dc:creator>
      <pubDate>Wed, 01 Apr 2026 15:58:35 +0000</pubDate>
      <link>https://forem.com/bharath_kumar_30_vog/from-docker-failure-to-postgresql-success-my-real-backend-learning-experience-cn7</link>
      <guid>https://forem.com/bharath_kumar_30_vog/from-docker-failure-to-postgresql-success-my-real-backend-learning-experience-cn7</guid>
      <description>&lt;p&gt;Hey everyone,&lt;/p&gt;

&lt;p&gt;This is a continuation of my journey.&lt;/p&gt;

&lt;p&gt;After struggling with PostgreSQL integration, I decided to try something new:&lt;/p&gt;

&lt;p&gt;Docker&lt;/p&gt;

&lt;p&gt;I thought it would make things easier.&lt;/p&gt;

&lt;p&gt;But again… reality had other plans &lt;/p&gt;




&lt;h2&gt;
  
  
  Trying Docker
&lt;/h2&gt;

&lt;p&gt;I installed Docker Desktop and started setup.&lt;/p&gt;

&lt;p&gt;At first, everything looked fine.&lt;/p&gt;

&lt;p&gt;But then…&lt;/p&gt;




&lt;h2&gt;
  
  
  Issues Started
&lt;/h2&gt;

&lt;p&gt;I faced multiple problems:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Disk space errors&lt;/li&gt;
&lt;li&gt;WSL not working&lt;/li&gt;
&lt;li&gt;Installation failures&lt;/li&gt;
&lt;li&gt;“Catastrophic failure” errors&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It was frustrating.&lt;/p&gt;

&lt;p&gt;I spent time fixing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Environment variables&lt;/li&gt;
&lt;li&gt;WSL updates&lt;/li&gt;
&lt;li&gt;System settings&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Still, it didn’t work smoothly.&lt;/p&gt;




&lt;h2&gt;
  
  
  Reality Check
&lt;/h2&gt;

&lt;p&gt;At that moment, I realized:&lt;/p&gt;

&lt;p&gt;I’m still learning&lt;br&gt;
 I need a simpler path&lt;/p&gt;

&lt;p&gt;So I made a decision.&lt;/p&gt;




&lt;h2&gt;
  
  
  Switching Back to Local Setup
&lt;/h2&gt;

&lt;p&gt;Instead of forcing Docker, I went back to:&lt;/p&gt;

&lt;p&gt;Local PostgreSQL setup&lt;/p&gt;

&lt;p&gt;This time, I focused step by step:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Installed PostgreSQL properly&lt;/li&gt;
&lt;li&gt;Opened pgAdmin&lt;/li&gt;
&lt;li&gt;Created database&lt;/li&gt;
&lt;li&gt;Ran my schema&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Finally… Success!
&lt;/h2&gt;

&lt;p&gt;Then came the best moment:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Tables created successfully&lt;/li&gt;
&lt;li&gt;Database working&lt;/li&gt;
&lt;li&gt;Connection from Python working&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Everything finally clicked &lt;/p&gt;




&lt;h2&gt;
  
  
  What I Learned
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Tools are important, but timing matters&lt;/li&gt;
&lt;li&gt;Docker is powerful, but not always beginner-friendly&lt;/li&gt;
&lt;li&gt;Simplicity wins when learning&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  My Growth
&lt;/h2&gt;

&lt;p&gt;Today I:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Understood PostgreSQL deeply&lt;/li&gt;
&lt;li&gt;Integrated it into my project&lt;/li&gt;
&lt;li&gt;Learned from real errors&lt;/li&gt;
&lt;li&gt;Built confidence&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Final Thought
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;It’s okay to fail.&lt;br&gt;
It’s okay to change direction.&lt;br&gt;
What matters is moving forward.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Today, I didn’t just build a feature.&lt;br&gt;
I built experience.&lt;/p&gt;

&lt;p&gt;And that’s what truly matters &lt;/p&gt;

</description>
      <category>postgressql</category>
      <category>docker</category>
      <category>sql</category>
      <category>learning</category>
    </item>
    <item>
      <title>From SQLite to PostgreSQL: My First Integration Attempt (Failures, Learning &amp; Direction Change)</title>
      <dc:creator>Bharath Kumar_30</dc:creator>
      <pubDate>Wed, 01 Apr 2026 15:55:39 +0000</pubDate>
      <link>https://forem.com/bharath_kumar_30_vog/-from-sqlite-to-postgresql-my-first-integration-attempt-failures-learning-direction-change-3bn4</link>
      <guid>https://forem.com/bharath_kumar_30_vog/-from-sqlite-to-postgresql-my-first-integration-attempt-failures-learning-direction-change-3bn4</guid>
      <description>&lt;p&gt;Hey everyone,&lt;/p&gt;

&lt;p&gt;Today was one of those days where I didn’t just code… I &lt;strong&gt;struggled, failed, learned, and improved&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;I started with a clear goal:&lt;/p&gt;

&lt;p&gt;Replace SQLite with PostgreSQL&lt;br&gt;
 Store all my project data in a real database&lt;/p&gt;

&lt;p&gt;Sounds simple right? &lt;br&gt;
But the journey had some twists.&lt;/p&gt;




&lt;h2&gt;
  
  
  My Initial Plan
&lt;/h2&gt;

&lt;p&gt;My project was using SQLite. It was easy, but not scalable.&lt;/p&gt;

&lt;p&gt;So I decided:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Remove SQLite completely&lt;/li&gt;
&lt;li&gt;Integrate PostgreSQL&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;.env&lt;/code&gt; for security&lt;/li&gt;
&lt;li&gt;Store everything in database&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Step 1: Database Setup
&lt;/h2&gt;

&lt;p&gt;I installed PostgreSQL and opened pgAdmin.&lt;/p&gt;

&lt;p&gt;Then I:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Created a database → &lt;code&gt;social_media_db&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Designed tables using DDL&lt;/li&gt;
&lt;li&gt;Ran SQL successfully&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That moment felt good — my database was ready.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 2: Integration Attempt
&lt;/h2&gt;

&lt;p&gt;Next, I started integrating it into my code.&lt;/p&gt;

&lt;p&gt;I:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Removed &lt;code&gt;sqlite3&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Added &lt;code&gt;psycopg2&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Created a &lt;code&gt;db.py&lt;/code&gt; connection file&lt;/li&gt;
&lt;li&gt;Updated queries (&lt;code&gt;?&lt;/code&gt; → &lt;code&gt;%s&lt;/code&gt;)&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Problems I Faced
&lt;/h2&gt;

&lt;p&gt;This is where things got real.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Connection errors&lt;/li&gt;
&lt;li&gt;Query syntax mistakes&lt;/li&gt;
&lt;li&gt;Forgot &lt;code&gt;commit()&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Small bugs everywhere&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;At first, I thought:&lt;/p&gt;

&lt;p&gt;“Why is this so hard?”&lt;/p&gt;

&lt;p&gt;But slowly I understood…&lt;/p&gt;




&lt;h2&gt;
  
  
  What I Learned
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;SQLite and PostgreSQL are NOT the same&lt;/li&gt;
&lt;li&gt;Small syntax changes matter&lt;/li&gt;
&lt;li&gt;Database connection must be handled properly&lt;/li&gt;
&lt;li&gt;Errors are part of learning&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Change in Thinking
&lt;/h2&gt;

&lt;p&gt;At one point, I felt:&lt;/p&gt;

&lt;p&gt;“Maybe I should try a better setup…”&lt;/p&gt;

&lt;p&gt;That’s when I started thinking about &lt;strong&gt;Docker&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Because:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It gives clean environment&lt;/li&gt;
&lt;li&gt;Easy to manage services&lt;/li&gt;
&lt;li&gt;Industry-level approach&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  My Realization
&lt;/h2&gt;

&lt;p&gt;Today I understood something important:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Learning backend is not just coding…&lt;br&gt;
It’s about understanding systems.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  My Takeaway
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;I successfully designed and created my PostgreSQL database&lt;/li&gt;
&lt;li&gt;I started integrating it into my project&lt;/li&gt;
&lt;li&gt;I faced real-world problems&lt;/li&gt;
&lt;li&gt;And I didn’t give up&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Final Thought
&lt;/h2&gt;

&lt;p&gt;Today was not perfect.&lt;br&gt;
But it was real.&lt;/p&gt;

&lt;p&gt;Failures taught me more than success.&lt;/p&gt;

&lt;p&gt;And tomorrow… I come back stronger &lt;/p&gt;

</description>
      <category>beginners</category>
      <category>database</category>
      <category>learning</category>
      <category>postgres</category>
    </item>
    <item>
      <title># Setting Up PostgreSQL Locally and Connecting It to My Project (Beginner Journey)</title>
      <dc:creator>Bharath Kumar_30</dc:creator>
      <pubDate>Wed, 25 Mar 2026 17:44:50 +0000</pubDate>
      <link>https://forem.com/bharath_kumar_30_vog/-setting-up-postgresql-locally-and-connecting-it-to-my-project-beginner-journey-gmh</link>
      <guid>https://forem.com/bharath_kumar_30_vog/-setting-up-postgresql-locally-and-connecting-it-to-my-project-beginner-journey-gmh</guid>
      <description>&lt;p&gt;Hey everyone,&lt;/p&gt;

&lt;p&gt;Today I worked on something very important in backend development — setting up a database and connecting it to my project.&lt;/p&gt;

&lt;p&gt;Until now, I was mainly focused on coding features. But today I understood that without a proper database setup, a project is not complete.&lt;/p&gt;

&lt;p&gt;So I decided to set up PostgreSQL locally and integrate it step by step.&lt;/p&gt;




&lt;h2&gt;
  
  
  What I focused on today
&lt;/h2&gt;

&lt;p&gt;My main goal was to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Set up PostgreSQL locally&lt;/li&gt;
&lt;li&gt;Create a database&lt;/li&gt;
&lt;li&gt;Configure environment variables&lt;/li&gt;
&lt;li&gt;Connect database using Python&lt;/li&gt;
&lt;li&gt;Execute my database schema&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Step 1: Creating the database
&lt;/h2&gt;

&lt;p&gt;After installing PostgreSQL, I created a database for my project:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;```sql id="y2y3g1"&lt;br&gt;
CREATE DATABASE social_media_db;&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;


This is where all my project data will be stored.

---

##  Step 2: Managing credentials using .env

Instead of writing database credentials directly in code, I used a `.env` file.



```env id="3hkgmq"
DB_HOST=localhost
DB_PORT=5432
DB_NAME=social_media_db
DB_USER=postgres
DB_PASSWORD=your_password
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This made my setup cleaner and more secure.&lt;/p&gt;


&lt;h2&gt;
  
  
  Step 3: Connecting PostgreSQL with Python
&lt;/h2&gt;

&lt;p&gt;To connect my project with the database, I used &lt;code&gt;psycopg2&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;```python id="s6x3jm"&lt;br&gt;
import os&lt;br&gt;
import psycopg2&lt;br&gt;
from dotenv import load_dotenv&lt;/p&gt;

&lt;p&gt;load_dotenv()&lt;/p&gt;

&lt;p&gt;conn = psycopg2.connect(&lt;br&gt;
    host=os.getenv("DB_HOST"),&lt;br&gt;
    port=os.getenv("DB_PORT"),&lt;br&gt;
    dbname=os.getenv("DB_NAME"),&lt;br&gt;
    user=os.getenv("DB_USER"),&lt;br&gt;
    password=os.getenv("DB_PASSWORD")&lt;br&gt;
)&lt;/p&gt;

&lt;p&gt;print("Database connected successfully!")&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;


Seeing this connection work was a great moment.

---

##  Step 4: Executing my database design

Earlier, I had designed my database structure using DDL.

Today, I executed that design in PostgreSQL.

My schema includes:

* Users table
* Platforms table
* Credentials table
* Posts table
* Post logs table

Now my design is no longer just an idea — it’s a working database.

---

##  Step 5: Updating from SQLite to PostgreSQL

My project was previously using SQLite.

So I started adapting it to PostgreSQL.

I learned small but important differences:

* `AUTOINCREMENT` → `SERIAL`
* `DATETIME` → `TIMESTAMP`

These changes helped me understand how different databases work.

---

##  What I learned today

Today was not about writing a lot of code.

It was about understanding how things actually work behind the scenes.

I learned that:

* Database setup is a core part of backend development
* Environment variables are important for security
* Designing and executing a schema are two different steps
* Migrating between databases requires attention to detail

---

##  My takeaway

I feel more confident now working with databases.

Instead of just using default setups, I now understand how to:

* Create and manage databases
* Connect them to applications
* Structure data properly

---

##  Final thought

Every day I’m learning something new.

Some days it’s coding,
Some days it’s understanding systems.

Both are equally important.

This is just one more step in my journey — more learning ahead 🚀
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>webdev</category>
      <category>database</category>
      <category>postgres</category>
      <category>sql</category>
    </item>
    <item>
      <title>Designing My First Real Database Schema with DDL (PostgreSQL)</title>
      <dc:creator>Bharath Kumar_30</dc:creator>
      <pubDate>Wed, 25 Mar 2026 06:12:06 +0000</pubDate>
      <link>https://forem.com/bharath_kumar_30_vog/designing-my-first-real-database-schema-with-ddl-postgresql-4icf</link>
      <guid>https://forem.com/bharath_kumar_30_vog/designing-my-first-real-database-schema-with-ddl-postgresql-4icf</guid>
      <description>&lt;p&gt;Hey everyone,&lt;/p&gt;

&lt;p&gt;Today was a different kind of learning day for me.&lt;/p&gt;

&lt;p&gt;Instead of writing APIs or working on frontend, I focused on something very important in backend development — &lt;strong&gt;database design using DDL commands&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;At first, I thought database means just creating tables. But today I understood that it’s much more than that.&lt;/p&gt;




&lt;h2&gt;
  
  
  What I worked on today
&lt;/h2&gt;

&lt;p&gt;My guide asked me to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Design the database structure&lt;/li&gt;
&lt;li&gt;Write DDL commands (CREATE TABLE)&lt;/li&gt;
&lt;li&gt;Apply constraints (for data integrity)&lt;/li&gt;
&lt;li&gt;Think about optimization&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So I didn’t just create tables — I designed a proper structure for my project.&lt;/p&gt;




&lt;h2&gt;
  
  
  What is DDL?
&lt;/h2&gt;

&lt;p&gt;DDL stands for &lt;strong&gt;Data Definition Language&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It is used to define the structure of the database.&lt;/p&gt;

&lt;p&gt;Some common commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt;
&lt;span class="k"&gt;ALTER&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt;
&lt;span class="k"&gt;DROP&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Today, I mainly worked with &lt;code&gt;CREATE TABLE&lt;/code&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  My Database Design (Project Based)
&lt;/h2&gt;

&lt;p&gt;My project is about &lt;strong&gt;social media automation&lt;/strong&gt;, so I designed tables based on real use cases.&lt;/p&gt;




&lt;h3&gt;
  
  
  Users Table
&lt;/h3&gt;

&lt;p&gt;Stores user details like username, email, and password.&lt;/p&gt;

&lt;p&gt;Important:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Email is unique&lt;/li&gt;
&lt;li&gt;Password is stored securely&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Platforms Table
&lt;/h3&gt;

&lt;p&gt;Instead of hardcoding platforms like Telegram or Twitter, I created a separate table.&lt;/p&gt;

&lt;p&gt;Benefit:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Easy to add new platforms later&lt;/li&gt;
&lt;li&gt;No need to change code&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Credentials Table
&lt;/h3&gt;

&lt;p&gt;This table connects users and platforms.&lt;/p&gt;

&lt;p&gt;Key points:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Stores API keys (in encrypted format)&lt;/li&gt;
&lt;li&gt;Prevents duplicate connections using UNIQUE constraint&lt;/li&gt;
&lt;li&gt;Uses ON DELETE CASCADE&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Posts Table
&lt;/h3&gt;

&lt;p&gt;Stores content that users want to post.&lt;/p&gt;

&lt;p&gt;Includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Content&lt;/li&gt;
&lt;li&gt;Status (pending, sent, failed)&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Post Logs Table
&lt;/h3&gt;

&lt;p&gt;This was a very important part.&lt;/p&gt;

&lt;p&gt;One post can go to multiple platforms&lt;br&gt;
 Each platform result is stored separately&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Telegram → Success&lt;/li&gt;
&lt;li&gt;Twitter → Failed&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So logs help track everything clearly.&lt;/p&gt;




&lt;h2&gt;
  
  
  Data Integrity (Important Learning)
&lt;/h2&gt;

&lt;p&gt;Today I understood that just creating tables is not enough.&lt;/p&gt;

&lt;p&gt;We must protect the data.&lt;/p&gt;

&lt;p&gt;I used:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;PRIMARY KEY → unique identification&lt;/li&gt;
&lt;li&gt;FOREIGN KEY → relationships&lt;/li&gt;
&lt;li&gt;UNIQUE → no duplicates&lt;/li&gt;
&lt;li&gt;NOT NULL → required fields&lt;/li&gt;
&lt;li&gt;CHECK → restrict valid values&lt;/li&gt;
&lt;li&gt;ON DELETE CASCADE → automatic cleanup&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Optimization (Small but powerful)
&lt;/h2&gt;

&lt;p&gt;I also added indexes.&lt;/p&gt;

&lt;p&gt;Why?&lt;/p&gt;

&lt;p&gt;Because:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Faster queries&lt;/li&gt;
&lt;li&gt;Better performance&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  What I realized today
&lt;/h2&gt;

&lt;p&gt;Earlier, I used to think:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Database = just store data”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Now I understand:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Database design = foundation of the entire application”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If the structure is wrong, everything becomes difficult later.&lt;/p&gt;




&lt;h2&gt;
  
  
  My takeaway
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Think before creating tables&lt;/li&gt;
&lt;li&gt;Design based on real use cases&lt;/li&gt;
&lt;li&gt;Always include constraints&lt;/li&gt;
&lt;li&gt;Plan for scalability&lt;/li&gt;
&lt;li&gt;Keep it clean and structured&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Final thought
&lt;/h2&gt;

&lt;p&gt;Today I didn’t just write SQL.&lt;/p&gt;

&lt;p&gt;I learned how to think like a backend developer.&lt;/p&gt;

&lt;p&gt;Still learning, still improving — one step at a time.&lt;/p&gt;

&lt;p&gt;More updates coming soon &lt;/p&gt;

</description>
      <category>database</category>
      <category>webdev</category>
      <category>ddl</category>
      <category>programming</category>
    </item>
    <item>
      <title>I Reached the Final Round… But Didn’t Get Selected (And That’s Okay)</title>
      <dc:creator>Bharath Kumar_30</dc:creator>
      <pubDate>Mon, 23 Mar 2026 16:14:13 +0000</pubDate>
      <link>https://forem.com/bharath_kumar_30_vog/i-reached-the-final-round-but-didnt-get-selected-and-thats-okay-5aga</link>
      <guid>https://forem.com/bharath_kumar_30_vog/i-reached-the-final-round-but-didnt-get-selected-and-thats-okay-5aga</guid>
      <description>&lt;p&gt;Hey everyone,&lt;/p&gt;

&lt;p&gt;Today I wanted to share something real from my journey.&lt;/p&gt;

&lt;p&gt;Not a success story.&lt;br&gt;
Not a “I got placed” post.&lt;/p&gt;

&lt;p&gt;But something that actually matters more.&lt;/p&gt;




&lt;h2&gt;
  
  
  💬 What happened?
&lt;/h2&gt;

&lt;p&gt;I attended an interview process that went on for around 10 days.&lt;/p&gt;

&lt;p&gt;It was not easy at all. There were more than 450+ candidates.&lt;/p&gt;

&lt;p&gt;Round by round, people were getting filtered out.&lt;/p&gt;

&lt;p&gt;And somehow… I kept moving forward.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Cleared aptitude&lt;/li&gt;
&lt;li&gt;Cleared coding&lt;/li&gt;
&lt;li&gt;Cleared mock interview&lt;/li&gt;
&lt;li&gt;Cleared technical round&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Finally…&lt;/p&gt;

&lt;p&gt;👉 I reached the &lt;strong&gt;last round&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;👉 Top 5 candidates&lt;/p&gt;

&lt;p&gt;Honestly, that moment itself felt like a win.&lt;/p&gt;




&lt;h2&gt;
  
  
  😶 But here’s the truth
&lt;/h2&gt;

&lt;p&gt;I didn’t get selected in the final HR round.&lt;/p&gt;

&lt;p&gt;Yeah… that hurt.&lt;/p&gt;

&lt;p&gt;After coming so far, losing in the last step is not easy to accept.&lt;/p&gt;

&lt;p&gt;But at the same time, I didn’t feel like I failed.&lt;/p&gt;

&lt;p&gt;Because I know how far I came.&lt;/p&gt;




&lt;h2&gt;
  
  
  🧠 What I realized
&lt;/h2&gt;

&lt;p&gt;Till now, I always focused on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Learning AI tools&lt;/li&gt;
&lt;li&gt;Practicing prompt engineering&lt;/li&gt;
&lt;li&gt;Understanding LLMs&lt;/li&gt;
&lt;li&gt;Building projects&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I’m still new, but I’ve been learning consistently.&lt;/p&gt;

&lt;p&gt;And those things helped me clear all the technical rounds.&lt;/p&gt;

&lt;p&gt;But the final round showed me something different.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Being good technically is not enough.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  🧩 The missing piece
&lt;/h2&gt;

&lt;p&gt;The HR round was not about coding.&lt;/p&gt;

&lt;p&gt;It was about:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How you speak&lt;/li&gt;
&lt;li&gt;How you present yourself&lt;/li&gt;
&lt;li&gt;How clearly you think&lt;/li&gt;
&lt;li&gt;How confidently you answer&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And I understood…&lt;/p&gt;

&lt;p&gt;👉 I need to improve there.&lt;/p&gt;




&lt;h2&gt;
  
  
  💡 One thing I learned deeply
&lt;/h2&gt;

&lt;p&gt;In this field, especially in corporate life:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;You have to keep updating yourself every single day.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Not just in coding.&lt;/p&gt;

&lt;p&gt;But in:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Communication&lt;/li&gt;
&lt;li&gt;Thinking&lt;/li&gt;
&lt;li&gt;Confidence&lt;/li&gt;
&lt;li&gt;Real-world understanding&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🔥 My biggest takeaway
&lt;/h2&gt;

&lt;p&gt;From 450+ people to Top 5.&lt;/p&gt;

&lt;p&gt;That itself tells me something:&lt;/p&gt;

&lt;p&gt;👉 I am on the right path.&lt;/p&gt;

&lt;p&gt;I didn’t lose.&lt;/p&gt;

&lt;p&gt;I just found what I need to improve next.&lt;/p&gt;




&lt;h2&gt;
  
  
  💪 What I’m going to do next
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Work on communication skills&lt;/li&gt;
&lt;li&gt;Practice more real interview scenarios&lt;/li&gt;
&lt;li&gt;Keep building projects&lt;/li&gt;
&lt;li&gt;Keep learning AI and LLM deeply&lt;/li&gt;
&lt;li&gt;Come back stronger&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🤝 To anyone reading this
&lt;/h2&gt;

&lt;p&gt;If you are also preparing for interviews…&lt;/p&gt;

&lt;p&gt;Listen carefully:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Rejection is normal&lt;/li&gt;
&lt;li&gt;Pressure is normal&lt;/li&gt;
&lt;li&gt;Self-doubt is normal&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But stopping is not.&lt;/p&gt;




&lt;h2&gt;
  
  
  🌱 Final thought
&lt;/h2&gt;

&lt;p&gt;Sometimes you won’t get what you worked for.&lt;/p&gt;

&lt;p&gt;But you will get what you &lt;em&gt;learned from it&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;And that matters more.&lt;/p&gt;




&lt;p&gt;This is just one step in my journey.&lt;/p&gt;

&lt;p&gt;I’ll keep learning.&lt;br&gt;
I’ll keep improving.&lt;br&gt;
I’ll keep showing up.&lt;/p&gt;

&lt;p&gt;One day… I’ll write a “selected” post too.&lt;/p&gt;

&lt;p&gt;Until then — we move forward 🚀&lt;/p&gt;

</description>
      <category>codereview</category>
      <category>motivation</category>
      <category>interview</category>
      <category>learning</category>
    </item>
    <item>
      <title>My Learning Journey: Factory Pattern, Encryption (AES), and PostgreSQL Database Design</title>
      <dc:creator>Bharath Kumar_30</dc:creator>
      <pubDate>Mon, 23 Mar 2026 15:44:05 +0000</pubDate>
      <link>https://forem.com/bharath_kumar_30_vog/my-learning-journey-factory-pattern-encryption-aes-and-postgresql-database-design-579j</link>
      <guid>https://forem.com/bharath_kumar_30_vog/my-learning-journey-factory-pattern-encryption-aes-and-postgresql-database-design-579j</guid>
      <description>&lt;p&gt;Today was a really productive day in my project journey. I focused on understanding some important backend concepts that are actually used in real-world applications. I worked on three main areas:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Factory Pattern (Design Pattern)&lt;/li&gt;
&lt;li&gt;Encryption (AES vs Hashing)&lt;/li&gt;
&lt;li&gt;PostgreSQL Database Design (DDL + Structure)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I’ll explain everything in a simple and practical way based on what I learned.&lt;/p&gt;




&lt;h1&gt;
  
  
  🧠 1. Understanding Factory Pattern
&lt;/h1&gt;

&lt;p&gt;At first, I was confused about why we need a factory when we already have routers. But now it’s clear.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Factory?
&lt;/h2&gt;

&lt;p&gt;Factory is just a helper function that creates the correct object based on input.&lt;/p&gt;

&lt;p&gt;Instead of writing multiple if-else conditions everywhere, we centralize object creation in one place.&lt;/p&gt;

&lt;h2&gt;
  
  
  My Use Case
&lt;/h2&gt;

&lt;p&gt;In my project, I support multiple platforms like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Telegram&lt;/li&gt;
&lt;li&gt;Twitter&lt;/li&gt;
&lt;li&gt;Instagram&lt;/li&gt;
&lt;li&gt;Reddit&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each platform has its own service class.&lt;/p&gt;

&lt;p&gt;Instead of doing this:&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="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;platform&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;telegram&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;service&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;TelegramService&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="n"&gt;platform&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;twitter&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;service&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;TwitterService&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I used a factory:&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="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;get_service&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;platform_name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;credentials&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;REGISTRY&lt;/span&gt; &lt;span class="o"&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;telegram&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;TelegramService&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;twitter&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;TwitterService&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;instagram&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;InstagramService&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="n"&gt;service_class&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;REGISTRY&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;platform_name&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;lower&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;service_class&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;credentials&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;service_class&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Why this is better?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Cleaner code&lt;/li&gt;
&lt;li&gt;Easy to maintain&lt;/li&gt;
&lt;li&gt;Easy to add new platforms&lt;/li&gt;
&lt;li&gt;No repeated logic&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Final understanding
&lt;/h2&gt;

&lt;p&gt;Factory = dynamically create the correct service object based on platform&lt;/p&gt;




&lt;h1&gt;
  
  
  🔐 2. Encryption vs Hashing (AES Explained)
&lt;/h1&gt;

&lt;p&gt;This was another important concept I learned today.&lt;/p&gt;

&lt;h2&gt;
  
  
  Hashing
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;One-way process&lt;/li&gt;
&lt;li&gt;Cannot reverse&lt;/li&gt;
&lt;li&gt;Used for passwords&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;password -&amp;gt; hashed value
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We never get the original password back.&lt;/p&gt;




&lt;h2&gt;
  
  
  Encryption (AES)
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Two-way process&lt;/li&gt;
&lt;li&gt;Can encrypt and decrypt&lt;/li&gt;
&lt;li&gt;Used for sensitive data like API keys&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why I used AES?
&lt;/h2&gt;

&lt;p&gt;In my project, I store credentials like tokens and API keys.&lt;/p&gt;

&lt;p&gt;These values need to be used later, so I cannot use hashing.&lt;/p&gt;

&lt;p&gt;That’s why I used encryption.&lt;/p&gt;




&lt;h2&gt;
  
  
  What is AES?
&lt;/h2&gt;

&lt;p&gt;AES is a symmetric encryption algorithm.&lt;/p&gt;

&lt;p&gt;That means:&lt;/p&gt;

&lt;p&gt;Same key is used for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Encryption&lt;/li&gt;
&lt;li&gt;Decryption&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Simple Flow
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Original Data -&amp;gt; Encrypt using key -&amp;gt; Encrypted Data
Encrypted Data -&amp;gt; Decrypt using same key -&amp;gt; Original Data
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Key Point
&lt;/h2&gt;

&lt;p&gt;If the key is lost, data cannot be recovered.&lt;/p&gt;




&lt;h1&gt;
  
  
  🗄️ 3. PostgreSQL Database Design
&lt;/h1&gt;

&lt;p&gt;Today I also designed my database using PostgreSQL.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is DDL?
&lt;/h2&gt;

&lt;p&gt;DDL stands for Data Definition Language.&lt;/p&gt;

&lt;p&gt;It is used to define database structure.&lt;/p&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;CREATE TABLE&lt;/li&gt;
&lt;li&gt;ALTER TABLE&lt;/li&gt;
&lt;li&gt;DROP TABLE&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  My Database Structure
&lt;/h2&gt;

&lt;p&gt;I designed a clean and scalable structure with multiple tables.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. Users Table
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;users&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="nb"&gt;SERIAL&lt;/span&gt; &lt;span class="k"&gt;PRIMARY&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;username&lt;/span&gt; &lt;span class="nb"&gt;VARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="n"&gt;email&lt;/span&gt; &lt;span class="nb"&gt;VARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;150&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;UNIQUE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;password&lt;/span&gt; &lt;span class="nb"&gt;TEXT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;created_at&lt;/span&gt; &lt;span class="nb"&gt;TIMESTAMP&lt;/span&gt; &lt;span class="k"&gt;DEFAULT&lt;/span&gt; &lt;span class="k"&gt;CURRENT_TIMESTAMP&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Stores user data&lt;/li&gt;
&lt;li&gt;Password is hashed&lt;/li&gt;
&lt;li&gt;Email is unique&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  2. Platforms Table
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;platforms&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="nb"&gt;SERIAL&lt;/span&gt; &lt;span class="k"&gt;PRIMARY&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="nb"&gt;VARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;UNIQUE&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Stores platform names&lt;/li&gt;
&lt;li&gt;Easy to scale (add new platform without changing code)&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  3. User Credentials Table
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;user_platform_keys&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="nb"&gt;SERIAL&lt;/span&gt; &lt;span class="k"&gt;PRIMARY&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;user_id&lt;/span&gt; &lt;span class="nb"&gt;INT&lt;/span&gt; &lt;span class="k"&gt;REFERENCES&lt;/span&gt; &lt;span class="n"&gt;users&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="k"&gt;DELETE&lt;/span&gt; &lt;span class="k"&gt;CASCADE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;platform_id&lt;/span&gt; &lt;span class="nb"&gt;INT&lt;/span&gt; &lt;span class="k"&gt;REFERENCES&lt;/span&gt; &lt;span class="n"&gt;platforms&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="n"&gt;encrypted_data&lt;/span&gt; &lt;span class="nb"&gt;TEXT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;created_at&lt;/span&gt; &lt;span class="nb"&gt;TIMESTAMP&lt;/span&gt; &lt;span class="k"&gt;DEFAULT&lt;/span&gt; &lt;span class="k"&gt;CURRENT_TIMESTAMP&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="k"&gt;UNIQUE&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;user_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;platform_id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Stores API keys (encrypted)&lt;/li&gt;
&lt;li&gt;Prevents duplicate platform connection&lt;/li&gt;
&lt;li&gt;Deletes data if user is deleted&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  4. Posts Table
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;posts&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="nb"&gt;SERIAL&lt;/span&gt; &lt;span class="k"&gt;PRIMARY&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;user_id&lt;/span&gt; &lt;span class="nb"&gt;INT&lt;/span&gt; &lt;span class="k"&gt;REFERENCES&lt;/span&gt; &lt;span class="n"&gt;users&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="n"&gt;content&lt;/span&gt; &lt;span class="nb"&gt;TEXT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;status&lt;/span&gt; &lt;span class="nb"&gt;VARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;CHECK&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;status&lt;/span&gt; &lt;span class="k"&gt;IN&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'pending'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'processing'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'sent'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'failed'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'partial'&lt;/span&gt;&lt;span class="p"&gt;)),&lt;/span&gt;
    &lt;span class="n"&gt;created_at&lt;/span&gt; &lt;span class="nb"&gt;TIMESTAMP&lt;/span&gt; &lt;span class="k"&gt;DEFAULT&lt;/span&gt; &lt;span class="k"&gt;CURRENT_TIMESTAMP&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Stores user posts&lt;/li&gt;
&lt;li&gt;Status is controlled using CHECK constraint&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  5. Post Logs Table
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;post_logs&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="nb"&gt;SERIAL&lt;/span&gt; &lt;span class="k"&gt;PRIMARY&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;post_id&lt;/span&gt; &lt;span class="nb"&gt;INT&lt;/span&gt; &lt;span class="k"&gt;REFERENCES&lt;/span&gt; &lt;span class="n"&gt;posts&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="k"&gt;DELETE&lt;/span&gt; &lt;span class="k"&gt;CASCADE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;platform_id&lt;/span&gt; &lt;span class="nb"&gt;INT&lt;/span&gt; &lt;span class="k"&gt;REFERENCES&lt;/span&gt; &lt;span class="n"&gt;platforms&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="n"&gt;status&lt;/span&gt; &lt;span class="nb"&gt;VARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="n"&gt;error_message&lt;/span&gt; &lt;span class="nb"&gt;TEXT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;created_at&lt;/span&gt; &lt;span class="nb"&gt;TIMESTAMP&lt;/span&gt; &lt;span class="k"&gt;DEFAULT&lt;/span&gt; &lt;span class="k"&gt;CURRENT_TIMESTAMP&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Why separate logs?
&lt;/h2&gt;

&lt;p&gt;One post can be sent to multiple platforms.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Telegram -&amp;gt; Success&lt;/li&gt;
&lt;li&gt;Twitter -&amp;gt; Failed&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So logs are stored separately to track each platform result clearly.&lt;/p&gt;




&lt;h1&gt;
  
  
  🎯 Final Thoughts
&lt;/h1&gt;

&lt;p&gt;Today I understood how real backend systems are designed.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Factory pattern helps in clean and scalable architecture&lt;/li&gt;
&lt;li&gt;AES encryption helps in securing sensitive data&lt;/li&gt;
&lt;li&gt;PostgreSQL schema design helps in structured and reliable data storage&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This learning helped me move from basic coding to thinking like a backend developer.&lt;/p&gt;




&lt;h1&gt;
  
  
  📌 Key Takeaways
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Don’t mix logic in router — use factory&lt;/li&gt;
&lt;li&gt;Use hashing for passwords, encryption for reusable secrets&lt;/li&gt;
&lt;li&gt;Always design database with scalability and constraints&lt;/li&gt;
&lt;li&gt;Separate logs for better tracking and debugging&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;This was a great learning day for me. More improvements coming soon.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>factory</category>
      <category>encry</category>
      <category>database</category>
    </item>
    <item>
      <title>Fixing My Git Mistakes and Finally Understanding My Router Code</title>
      <dc:creator>Bharath Kumar_30</dc:creator>
      <pubDate>Fri, 20 Mar 2026 16:25:02 +0000</pubDate>
      <link>https://forem.com/bharath_kumar_30_vog/fixing-my-git-mistakes-and-finally-understanding-my-router-code-1bnp</link>
      <guid>https://forem.com/bharath_kumar_30_vog/fixing-my-git-mistakes-and-finally-understanding-my-router-code-1bnp</guid>
      <description>&lt;p&gt;Today was one of those days where I didn’t just write code — I actually &lt;strong&gt;fixed my mistakes and understood what I built&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Cleaning Up My Git Mistakes
&lt;/h2&gt;

&lt;p&gt;I realized I had made some serious beginner mistakes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I committed my &lt;code&gt;.env&lt;/code&gt; file (which contains secrets)&lt;/li&gt;
&lt;li&gt;I pushed my database file to GitHub&lt;/li&gt;
&lt;li&gt;I didn’t have a &lt;code&gt;.gitignore&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;After guidance, I fixed everything properly:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Removed &lt;code&gt;.env&lt;/code&gt; and &lt;code&gt;.db&lt;/code&gt; from the repository&lt;/li&gt;
&lt;li&gt;Created a &lt;code&gt;.gitignore&lt;/code&gt; to avoid future mistakes&lt;/li&gt;
&lt;li&gt;Added &lt;code&gt;.env.example&lt;/code&gt; to show required environment variables without exposing secrets&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This made me understand something important:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A clean and secure repository is as important as working code.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Understanding My Router Code
&lt;/h2&gt;

&lt;p&gt;Earlier, my router files were just “working code” for me.&lt;/p&gt;

&lt;p&gt;Today I actually understood what they do.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is a Router?
&lt;/h3&gt;

&lt;p&gt;In FastAPI, routers handle API requests.&lt;/p&gt;

&lt;p&gt;Example:&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="nd"&gt;@router.post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;/login&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;login&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;User logged in&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;Now I understand:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Router = entry point for requests&lt;/li&gt;
&lt;li&gt;It connects frontend requests to backend logic&lt;/li&gt;
&lt;li&gt;It calls services and database operations&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Real Flow in My Project
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Frontend → Router → Service → Database
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;User clicks something on UI&lt;/li&gt;
&lt;li&gt;Router receives request&lt;/li&gt;
&lt;li&gt;Service handles logic&lt;/li&gt;
&lt;li&gt;Database stores/retrieves data&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  What Changed Today
&lt;/h2&gt;

&lt;p&gt;Before:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Code was running, but I didn’t fully understand it&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I know how requests flow&lt;/li&gt;
&lt;li&gt;I understand how routers connect everything&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Key Learning
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Never commit sensitive files like &lt;code&gt;.env&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Always use &lt;code&gt;.gitignore&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Routers are the backbone of API communication&lt;/li&gt;
&lt;li&gt;Understanding your code matters more than just running it&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Final Thought
&lt;/h2&gt;

&lt;p&gt;Fixing mistakes taught me more than writing new code.&lt;/p&gt;

&lt;p&gt;Every small correction is making me a better developer.&lt;/p&gt;




&lt;h2&gt;
  
  
  Next Step
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Deep dive into services layer&lt;/li&gt;
&lt;li&gt;Improve authentication flow&lt;/li&gt;
&lt;li&gt;Prepare for technical discussion&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;If you’re building projects, take time to clean your repo and understand your code. That’s where real growth happens.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>ai</category>
      <category>programming</category>
      <category>javascript</category>
    </item>
    <item>
      <title>I Used AI to Build My Project… But Then I Had to Actually Understand It</title>
      <dc:creator>Bharath Kumar_30</dc:creator>
      <pubDate>Thu, 19 Mar 2026 18:19:49 +0000</pubDate>
      <link>https://forem.com/bharath_kumar_30_vog/i-used-ai-to-build-my-project-but-then-i-had-to-actually-understand-it-35ji</link>
      <guid>https://forem.com/bharath_kumar_30_vog/i-used-ai-to-build-my-project-but-then-i-had-to-actually-understand-it-35ji</guid>
      <description>&lt;p&gt;When I built my social media automation platform, I used AI tools to generate a lot of the code.&lt;/p&gt;

&lt;p&gt;Everything seemed to work — login, dashboard, APIs. But when I looked deeper, I realized something important:&lt;/p&gt;

&lt;p&gt;I didn’t fully understand what was happening inside my own project.&lt;/p&gt;

&lt;p&gt;So I decided to slow down and learn the core concepts properly: JWT authentication, AES encryption, database design, and debugging.&lt;/p&gt;

&lt;p&gt;Here’s what I learned.&lt;/p&gt;




&lt;h2&gt;
  
  
  Understanding JWT (Authentication)
&lt;/h2&gt;

&lt;p&gt;At first, I thought JWT was just a login token. But it’s more than that.&lt;/p&gt;

&lt;p&gt;A typical flow looks 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;User logs in → password verified → JWT created
→ frontend stores token → sends it in each request
→ backend verifies token → access granted
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;JWT is essentially structured data that is signed using a secret key.&lt;/p&gt;

&lt;h3&gt;
  
  
  Example:
&lt;/h3&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;jose&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;jwt&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;datetime&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;datetime&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;timedelta&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;create_token&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;email&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;jwt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;encode&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;sub&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;email&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;exp&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;datetime&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;utcnow&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nf"&gt;timedelta&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;minutes&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;60&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="n"&gt;SECRET_KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;algorithm&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;HS256&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;Once I understood this, authentication became much clearer.&lt;/p&gt;




&lt;h2&gt;
  
  
  Debugging JWT Using jwt.io
&lt;/h2&gt;

&lt;p&gt;One of the most useful tools I used was jwt.io.&lt;/p&gt;

&lt;p&gt;I pasted my token into the debugger and could immediately see:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The user email&lt;/li&gt;
&lt;li&gt;Expiry time&lt;/li&gt;
&lt;li&gt;Algorithm used&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When I added my secret key, the tool verified the signature.&lt;/p&gt;

&lt;p&gt;This helped me understand that JWT is not encrypted — it is encoded and signed.&lt;/p&gt;




&lt;h2&gt;
  
  
  AES Encryption for Security
&lt;/h2&gt;

&lt;p&gt;My project allows users to connect platforms like LinkedIn and Telegram. That means handling sensitive data such as API keys and tokens.&lt;/p&gt;

&lt;p&gt;Storing these values directly is risky.&lt;/p&gt;

&lt;p&gt;To solve this, I used AES encryption (via Fernet):&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;cryptography.fernet&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Fernet&lt;/span&gt;

&lt;span class="n"&gt;key&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Fernet&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;generate_key&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;f&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Fernet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;encrypted&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;encrypt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;b&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;api_key&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;decrypted&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;decrypt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;encrypted&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This ensures that even if the database is exposed, the data remains protected.&lt;/p&gt;




&lt;h2&gt;
  
  
  Database Design
&lt;/h2&gt;

&lt;p&gt;I chose:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;SQLite for simplicity and lightweight storage&lt;/li&gt;
&lt;li&gt;SQLAlchemy as the ORM for clean, Python-based database interaction&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This allowed me to focus on building features instead of managing database complexity.&lt;/p&gt;




&lt;h2&gt;
  
  
  Understanding the Project Structure
&lt;/h2&gt;

&lt;p&gt;Initially, the folder structure didn’t make much sense.&lt;/p&gt;

&lt;p&gt;Now I see it clearly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Frontend → Router → Service → Database
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each layer has a specific role:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Frontend handles user interaction&lt;/li&gt;
&lt;li&gt;Router handles API endpoints&lt;/li&gt;
&lt;li&gt;Service contains business logic&lt;/li&gt;
&lt;li&gt;Database stores data&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  A Critical Bug I Fixed
&lt;/h2&gt;

&lt;p&gt;At one point, I discovered a major issue.&lt;/p&gt;

&lt;p&gt;No matter who logged in, my Telegram account was being used.&lt;/p&gt;

&lt;p&gt;This meant all users were sharing the same session — a serious security problem.&lt;/p&gt;

&lt;p&gt;I fixed it by:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Assigning each user their own credentials&lt;/li&gt;
&lt;li&gt;Storing those credentials securely (encrypted)&lt;/li&gt;
&lt;li&gt;Removing any global/shared session usage&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  What I Learned
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;JWT is signed data used for authentication&lt;/li&gt;
&lt;li&gt;AES encryption protects sensitive information&lt;/li&gt;
&lt;li&gt;ORM tools simplify database operations&lt;/li&gt;
&lt;li&gt;Debugging is essential to truly understand your system&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Final Thought
&lt;/h2&gt;

&lt;p&gt;AI can help you build faster, but understanding what you build is what actually makes you a developer.&lt;/p&gt;




&lt;h2&gt;
  
  
  What’s Next
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Implementing refresh tokens&lt;/li&gt;
&lt;li&gt;Improving security practices&lt;/li&gt;
&lt;li&gt;Deploying the application&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you're building projects with AI, take the time to break things down and understand them. That’s where real learning happens.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>architecture</category>
      <category>sql</category>
      <category>python</category>
    </item>
    <item>
      <title>From Localhost to Live SaaS: Deploying My FastAPI App with Apache, SSL &amp; JWT Auth</title>
      <dc:creator>Bharath Kumar_30</dc:creator>
      <pubDate>Wed, 18 Mar 2026 18:21:49 +0000</pubDate>
      <link>https://forem.com/bharath_kumar_30_vog/from-localhost-to-live-saas-deploying-my-fastapi-app-with-apache-ssl-jwt-auth-3ogn</link>
      <guid>https://forem.com/bharath_kumar_30_vog/from-localhost-to-live-saas-deploying-my-fastapi-app-with-apache-ssl-jwt-auth-3ogn</guid>
      <description>&lt;p&gt;Hey friends  👋&lt;/p&gt;

&lt;p&gt;Today I’m sharing my &lt;strong&gt;complete real-world deployment journey&lt;/strong&gt; — from building a FastAPI project to making it live with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt; JWT Authentication (Login/Register)&lt;/li&gt;
&lt;li&gt; Landing Page + Dashboard UI&lt;/li&gt;
&lt;li&gt; FastAPI Backend&lt;/li&gt;
&lt;li&gt; Apache Reverse Proxy&lt;/li&gt;
&lt;li&gt; HTTPS (SSL with Certbot)&lt;/li&gt;
&lt;li&gt; VPS Hosting (Linux)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is a &lt;strong&gt;step-by-step, copy-paste friendly guide&lt;/strong&gt; — no confusion, just execution &lt;/p&gt;




&lt;h1&gt;
  
  
  Project Overview
&lt;/h1&gt;

&lt;p&gt;My project includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;✅ Landing page&lt;/li&gt;
&lt;li&gt;✅ User Registration &amp;amp; Login&lt;/li&gt;
&lt;li&gt;✅ JWT Authentication&lt;/li&gt;
&lt;li&gt;✅ Dashboard (after login)&lt;/li&gt;
&lt;li&gt;✅ API-based backend (FastAPI)&lt;/li&gt;
&lt;li&gt;✅ Static + Templates (HTML/CSS/JS)&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Step 1 — Setup Server
&lt;/h1&gt;

&lt;p&gt;Install Python &amp;amp; pip:&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;sudo &lt;/span&gt;apt update
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;python3 python3-pip &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Step 2 — Upload Project
&lt;/h1&gt;

&lt;p&gt;Navigate to your 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; ~/htdocs/soical-media-automation/automation_platform
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Step 3 — Install Dependencies
&lt;/h1&gt;

&lt;p&gt;If you have &lt;code&gt;requirements.txt&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;pip3 &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-r&lt;/span&gt; requirements.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If not:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip3 &lt;span class="nb"&gt;install &lt;/span&gt;fastapi uvicorn python-dotenv
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Step 4 — Run FastAPI App
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;nohup &lt;/span&gt;python3 &lt;span class="nt"&gt;-m&lt;/span&gt; uvicorn app.main:app &lt;span class="nt"&gt;--host&lt;/span&gt; 0.0.0.0 &lt;span class="nt"&gt;--port&lt;/span&gt; 8000 &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; uvicorn.log 2&amp;gt;&amp;amp;1 &amp;amp;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check if running:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ps aux | &lt;span class="nb"&gt;grep &lt;/span&gt;uvicorn
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Step 5 — Setup Apache (Reverse Proxy)
&lt;/h1&gt;

&lt;p&gt;Install Apache:&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;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;apache2 &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Enable required modules:&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;sudo &lt;/span&gt;a2enmod proxy
&lt;span class="nb"&gt;sudo &lt;/span&gt;a2enmod proxy_http
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Step 6 — Apache Config (Single Clean Config)
&lt;/h1&gt;

&lt;p&gt;Open config:&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;sudo &lt;/span&gt;nano /etc/apache2/sites-available/001-automate.conf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Paste:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight apache"&gt;&lt;code&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nl"&gt;VirtualHost&lt;/span&gt;&lt;span class="sr"&gt; *:80&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="nc"&gt;ServerName&lt;/span&gt; automated.soicalmedia.selfmade.one
    &lt;span class="nc"&gt;Redirect&lt;/span&gt; / https://automated.soicalmedia.selfmade.one/
&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nl"&gt;VirtualHost&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;
&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nl"&gt;IfModule&lt;/span&gt;&lt;span class="sr"&gt; mod_ssl.c&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span class="nl"&gt;VirtualHost&lt;/span&gt;&lt;span class="sr"&gt; *:443&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="nc"&gt;ServerName&lt;/span&gt; automated.soicalmedia.selfmade.one

    &lt;span class="nc"&gt;ProxyPreserveHost&lt;/span&gt; &lt;span class="ss"&gt;On&lt;/span&gt;
    &lt;span class="nc"&gt;ProxyPass&lt;/span&gt; / http://127.0.0.1:8000/
    &lt;span class="nc"&gt;ProxyPassReverse&lt;/span&gt; / http://127.0.0.1:8000/

    &lt;span class="nc"&gt;SSLEngine&lt;/span&gt; &lt;span class="ss"&gt;on&lt;/span&gt;
    &lt;span class="nc"&gt;SSLCertificateFile&lt;/span&gt; /etc/letsencrypt/live/automated.soicalmedia.selfmade.one/fullchain.pem
    &lt;span class="nc"&gt;SSLCertificateKeyFile&lt;/span&gt; /etc/letsencrypt/live/automated.soicalmedia.selfmade.one/privkey.pem

    &lt;span class="nc"&gt;Include&lt;/span&gt; /etc/letsencrypt/options-ssl-apache.conf
&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nl"&gt;VirtualHost&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span class="nl"&gt;IfModule&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Step 7 — Clean Apache Sites
&lt;/h1&gt;

&lt;p&gt;Disable default configs:&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;sudo &lt;/span&gt;a2dissite 000-default.conf
&lt;span class="nb"&gt;sudo &lt;/span&gt;a2dissite default-ssl.conf
&lt;span class="nb"&gt;sudo &lt;/span&gt;a2dissite 001-automate-le-ssl.conf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Enable your config:&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;sudo &lt;/span&gt;a2ensite 001-automate.conf
&lt;span class="nb"&gt;sudo &lt;/span&gt;service apache2 restart
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Step 8 — Setup SSL (HTTPS)
&lt;/h1&gt;

&lt;p&gt;Install Certbot:&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;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;certbot python3-certbot-apache &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;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;sudo &lt;/span&gt;certbot &lt;span class="nt"&gt;--apache&lt;/span&gt; &lt;span class="nt"&gt;-d&lt;/span&gt; automated.soicalmedia.selfmade.one
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Choose:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Email → your email&lt;/li&gt;
&lt;li&gt;Agree → Yes&lt;/li&gt;
&lt;li&gt;Redirect → Yes (HTTPS)&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Step 9 — Create init.sh (Auto Run)
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;nano ~/init.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Paste:&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="c"&gt;#!/bin/bash&lt;/span&gt;

&lt;span class="nb"&gt;cd&lt;/span&gt; /home/mr.potter/htdocs/soical-media-automation/automation_platform

&lt;span class="nb"&gt;nohup &lt;/span&gt;python3 &lt;span class="nt"&gt;-m&lt;/span&gt; uvicorn app.main:app &lt;span class="nt"&gt;--host&lt;/span&gt; 0.0.0.0 &lt;span class="nt"&gt;--port&lt;/span&gt; 8000 &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; uvicorn.log 2&amp;gt;&amp;amp;1 &amp;amp;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;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;chmod&lt;/span&gt; +x init.sh
./init.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Step 10 — JWT Authentication (Concept)
&lt;/h1&gt;

&lt;p&gt;My app includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;User registration&lt;/li&gt;
&lt;li&gt;Login system&lt;/li&gt;
&lt;li&gt;JWT token generation&lt;/li&gt;
&lt;li&gt;Protected dashboard&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example flow:&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;Depends&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;fastapi.security&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;OAuth2PasswordBearer&lt;/span&gt;

&lt;span class="n"&gt;oauth2_scheme&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;OAuth2PasswordBearer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;tokenUrl&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;login&lt;/span&gt;&lt;span class="sh"&gt;"&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;/dashboard&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;dashboard&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;token&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Depends&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;oauth2_scheme&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 dashboard&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;h1&gt;
  
  
  Frontend Structure
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;templates/
    index.html
    login.html
    register.html
    dashboard.html

static/
    css/
    js/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Common Issues I Faced (And Fixes)
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Too Many Redirects
&lt;/h2&gt;

&lt;p&gt;Cause: Multiple Apache configs&lt;br&gt;
 Fix: Use single config only&lt;/p&gt;


&lt;h2&gt;
  
  
  requirements.txt not found
&lt;/h2&gt;

&lt;p&gt;Wrong folder&lt;br&gt;
 Fix: &lt;code&gt;cd&lt;/code&gt; into correct directory&lt;/p&gt;


&lt;h2&gt;
  
  
  Permission denied
&lt;/h2&gt;

&lt;p&gt;Fix:&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;sudo chown &lt;/span&gt;mr.potter:mr.potter filename
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  systemctl not working
&lt;/h2&gt;

&lt;p&gt;Use:&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;sudo &lt;/span&gt;service apache2 restart
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Final Result
&lt;/h1&gt;

&lt;p&gt;✔ Live SaaS App&lt;br&gt;
✔ Secure HTTPS&lt;br&gt;
✔ Login/Register system&lt;br&gt;
✔ Dashboard&lt;br&gt;
✔ API backend&lt;/p&gt;




&lt;h1&gt;
  
  
  Final Thoughts
&lt;/h1&gt;

&lt;p&gt;This wasn’t just deployment — it was:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;DevOps basics&lt;/li&gt;
&lt;li&gt;Backend engineering&lt;/li&gt;
&lt;li&gt;Real production setup&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you’re building something similar — don’t stop at localhost.&lt;br&gt;
Deploy it. Break it. Fix it. Learn it &lt;/p&gt;




&lt;h1&gt;
  
  
  Let’s Connect
&lt;/h1&gt;

&lt;p&gt;If you’re building something cool or stuck in deployment, feel free to reach out &lt;/p&gt;

&lt;p&gt;Happy coding &lt;/p&gt;

</description>
      <category>webdev</category>
      <category>octopusdeploy</category>
      <category>auto</category>
      <category>programming</category>
    </item>
    <item>
      <title>Improving My Automation Website: Making API Setup Easier for Users 🚀</title>
      <dc:creator>Bharath Kumar_30</dc:creator>
      <pubDate>Mon, 16 Mar 2026 18:04:47 +0000</pubDate>
      <link>https://forem.com/bharath_kumar_30_vog/improving-my-automation-website-making-api-setup-easier-for-users-5ek4</link>
      <guid>https://forem.com/bharath_kumar_30_vog/improving-my-automation-website-making-api-setup-easier-for-users-5ek4</guid>
      <description>&lt;p&gt;When I first started building my &lt;strong&gt;social media automation platform&lt;/strong&gt;, I thought the hardest part would be coding the integrations.&lt;/p&gt;

&lt;p&gt;Turns out… the real challenge was something else.&lt;/p&gt;

&lt;p&gt;Helping users &lt;strong&gt;get the API keys from different social media platforms&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;If you've ever tried integrating APIs from platforms like Instagram, Facebook, LinkedIn, or Telegram, you probably know what I'm talking about.&lt;/p&gt;

&lt;p&gt;Nothing is straightforward.&lt;/p&gt;

&lt;p&gt;So today I worked on improving my website so users don’t have to struggle the way I did.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Problem I Faced
&lt;/h2&gt;

&lt;p&gt;My platform allows users to automate posts to different social media platforms.&lt;/p&gt;

&lt;p&gt;But before automation works, users must connect their accounts by adding API credentials like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;API Key&lt;/li&gt;
&lt;li&gt;Client ID&lt;/li&gt;
&lt;li&gt;Client Secret&lt;/li&gt;
&lt;li&gt;Access Token&lt;/li&gt;
&lt;li&gt;Page ID&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The issue?&lt;/p&gt;

&lt;p&gt;Every social media platform has a completely different process.&lt;/p&gt;

&lt;p&gt;Some examples:&lt;/p&gt;

&lt;p&gt;Instagram requires converting to a &lt;strong&gt;Business Account&lt;/strong&gt;.&lt;br&gt;
Facebook requires a &lt;strong&gt;Meta Developer App&lt;/strong&gt;.&lt;br&gt;
LinkedIn needs &lt;strong&gt;OAuth configuration&lt;/strong&gt;.&lt;br&gt;
Telegram requires &lt;strong&gt;API ID and API Hash&lt;/strong&gt;.&lt;br&gt;
Twitter requires &lt;strong&gt;Developer access approval&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;And honestly… the official documentation is not beginner-friendly.&lt;/p&gt;

&lt;p&gt;Even I struggled while figuring it out.&lt;/p&gt;

&lt;p&gt;So I asked myself a question:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Why should my users go through the same confusion?&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  My Solution: A Better Instruction System
&lt;/h2&gt;

&lt;p&gt;Instead of just writing a few steps, I redesigned the instruction pages on my website.&lt;/p&gt;

&lt;p&gt;Now each platform page includes a &lt;strong&gt;two-level instruction system&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  1️⃣ Quick Setup Steps
&lt;/h3&gt;

&lt;p&gt;Users first see simple beginner-friendly steps like this:&lt;/p&gt;

&lt;p&gt;Step 1&lt;br&gt;
Go to the official developer portal.&lt;/p&gt;

&lt;p&gt;Step 2&lt;br&gt;
Create a developer application.&lt;/p&gt;

&lt;p&gt;Step 3&lt;br&gt;
Generate API credentials.&lt;/p&gt;

&lt;p&gt;Step 4&lt;br&gt;
Copy the API keys.&lt;/p&gt;

&lt;p&gt;Step 5&lt;br&gt;
Paste them into my platform.&lt;/p&gt;

&lt;p&gt;This helps users quickly understand the overall process.&lt;/p&gt;




&lt;h3&gt;
  
  
  2️⃣ “Learn More” Detailed Guide
&lt;/h3&gt;

&lt;p&gt;But some users need deeper instructions.&lt;/p&gt;

&lt;p&gt;So I added a &lt;strong&gt;Learn More section&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;When the user clicks &lt;strong&gt;Learn More&lt;/strong&gt;, the page expands and shows detailed instructions including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Step-by-step walkthrough&lt;/li&gt;
&lt;li&gt;Official developer links&lt;/li&gt;
&lt;li&gt;Screenshot placeholders&lt;/li&gt;
&lt;li&gt;Common mistakes&lt;/li&gt;
&lt;li&gt;Troubleshooting tips&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This way beginners are not overwhelmed, but advanced users can still see the full guide.&lt;/p&gt;




&lt;h2&gt;
  
  
  Example: Instagram Integration
&lt;/h2&gt;

&lt;p&gt;Instagram is one of the most confusing platforms to integrate.&lt;/p&gt;

&lt;p&gt;To get the API working, users must:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Convert their Instagram account to a Business account&lt;/li&gt;
&lt;li&gt;Connect Instagram to a Facebook Page&lt;/li&gt;
&lt;li&gt;Create a Meta Developer App&lt;/li&gt;
&lt;li&gt;Enable Instagram Graph API&lt;/li&gt;
&lt;li&gt;Generate an Access Token&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Many people don’t realize this until they try it.&lt;/p&gt;

&lt;p&gt;So now my website clearly explains this step-by-step.&lt;/p&gt;




&lt;h2&gt;
  
  
  Adding Troubleshooting Sections
&lt;/h2&gt;

&lt;p&gt;Another improvement I made was adding &lt;strong&gt;Common Errors sections&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Because when working with APIs, something always goes wrong.&lt;/p&gt;

&lt;p&gt;Some examples:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Error:&lt;/strong&gt; App still in development mode&lt;br&gt;
&lt;strong&gt;Solution:&lt;/strong&gt; Switch the app to Live mode in the Meta Developer dashboard.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Error:&lt;/strong&gt; Missing permissions&lt;br&gt;
&lt;strong&gt;Solution:&lt;/strong&gt; Add the required permissions like &lt;code&gt;pages_manage_posts&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Error:&lt;/strong&gt; Access token expired&lt;br&gt;
&lt;strong&gt;Solution:&lt;/strong&gt; Generate a long-lived access token.&lt;/p&gt;

&lt;p&gt;These small explanations can save users hours of frustration.&lt;/p&gt;




&lt;h2&gt;
  
  
  Video Tutorials
&lt;/h2&gt;

&lt;p&gt;Some people prefer watching instead of reading.&lt;/p&gt;

&lt;p&gt;So each platform page also includes a &lt;strong&gt;video tutorial section&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Users can watch the full setup guide if they want visual instructions.&lt;/p&gt;




&lt;h2&gt;
  
  
  Making the UX More Friendly
&lt;/h2&gt;

&lt;p&gt;Another thing I added is a simple &lt;strong&gt;integration progress indicator&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;It shows users exactly where they are in the process.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;p&gt;Step 1 — Get API Key&lt;br&gt;
Step 2 — Add Credentials&lt;br&gt;
Step 3 — Test Connection&lt;br&gt;
Step 4 — Connected ✅&lt;/p&gt;

&lt;p&gt;This small feature makes the experience much clearer.&lt;/p&gt;




&lt;h2&gt;
  
  
  What I Learned From This
&lt;/h2&gt;

&lt;p&gt;Building automation tools is not just about writing backend code.&lt;/p&gt;

&lt;p&gt;It's also about &lt;strong&gt;making complex systems understandable for users&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;A good product doesn’t just work.&lt;/p&gt;

&lt;p&gt;It guides users step by step.&lt;/p&gt;

&lt;p&gt;Sometimes improving &lt;strong&gt;documentation and instructions&lt;/strong&gt; is just as important as improving the software itself.&lt;/p&gt;




&lt;h2&gt;
  
  
  What’s Next for My Platform
&lt;/h2&gt;

&lt;p&gt;Now that the instruction system is improved, my next steps are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Expanding support for more social media platforms&lt;/li&gt;
&lt;li&gt;Adding better UI design for the dashboard&lt;/li&gt;
&lt;li&gt;Improving automation workflows&lt;/li&gt;
&lt;li&gt;Building scheduling features&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;My goal is to create a platform where users can automate social media posting with &lt;strong&gt;just a few clicks&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;No confusion. No frustration.&lt;/p&gt;

&lt;p&gt;Just automation.&lt;/p&gt;




&lt;p&gt;If you’re building developer tools or automation platforms, one thing I learned is this:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Don’t assume users know what you know.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Clear instructions can make or break the entire experience.&lt;/p&gt;

&lt;p&gt;And sometimes the best feature you can build…&lt;/p&gt;

&lt;p&gt;is simply &lt;strong&gt;helping people understand the process.&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>html</category>
      <category>javascript</category>
      <category>programming</category>
    </item>
    <item>
      <title>From Messy Script to Clean OOP: Rewriting a Python Project the Right Way</title>
      <dc:creator>Bharath Kumar_30</dc:creator>
      <pubDate>Wed, 11 Mar 2026 18:16:29 +0000</pubDate>
      <link>https://forem.com/bharath_kumar_30_vog/from-messy-script-to-clean-oop-rewriting-a-python-project-the-right-way-4g1k</link>
      <guid>https://forem.com/bharath_kumar_30_vog/from-messy-script-to-clean-oop-rewriting-a-python-project-the-right-way-4g1k</guid>
      <description>&lt;p&gt;When we start learning Python, most of us write everything in &lt;strong&gt;one file&lt;/strong&gt;.&lt;br&gt;
Functions, variables, logic — everything mixed together.&lt;/p&gt;

&lt;p&gt;It works for small programs. But when the project grows, the code becomes &lt;strong&gt;hard to maintain, difficult to debug, and messy to expand&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;So today I decided to &lt;strong&gt;rewrite my small Python project using Object-Oriented Programming (OOP)&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;In this blog I’ll show you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Why OOP is important&lt;/li&gt;
&lt;li&gt;How to convert a normal script into OOP&lt;/li&gt;
&lt;li&gt;A simple project structure&lt;/li&gt;
&lt;li&gt;Copy-paste ready code for beginners&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This guide is &lt;strong&gt;beginner friendly&lt;/strong&gt;, so you can follow along easily.&lt;/p&gt;


&lt;h1&gt;
  
  
  Why Use OOP?
&lt;/h1&gt;

&lt;p&gt;Object-Oriented Programming helps organize code into &lt;strong&gt;objects and classes&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Instead of writing everything as separate functions, we group related logic into &lt;strong&gt;classes&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Benefits of OOP:&lt;/p&gt;

&lt;p&gt;✔ Cleaner code structure&lt;br&gt;
✔ Easy to maintain&lt;br&gt;
✔ Code reusability&lt;br&gt;
✔ Easier debugging&lt;br&gt;
✔ Scalable for large projects&lt;/p&gt;

&lt;p&gt;Without OOP, projects become messy very quickly.&lt;/p&gt;


&lt;h1&gt;
  
  
  Recommended Project Structure
&lt;/h1&gt;

&lt;p&gt;A clean Python project should be structured 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;project/
│
├── main.py
├── user.py
├── post_manager.py
└── utils.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each file has &lt;strong&gt;one clear responsibility&lt;/strong&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;user.py&lt;/code&gt; → handles user data&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;post_manager.py&lt;/code&gt; → handles posts&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;utils.py&lt;/code&gt; → helper functions&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;main.py&lt;/code&gt; → program entry point&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is a simple structure but it already looks &lt;strong&gt;more professional&lt;/strong&gt;.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 1: Create a User Class
&lt;/h1&gt;

&lt;p&gt;Create a file called &lt;strong&gt;user.py&lt;/strong&gt;&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="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;User&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;username&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;email&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;username&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;username&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;email&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;email&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;display_user&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Username: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;username&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Email: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;email&lt;/span&gt;&lt;span class="si"&gt;}&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;Explanation:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;__init__()&lt;/code&gt; is the &lt;strong&gt;constructor&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;self&lt;/code&gt; refers to the &lt;strong&gt;current object&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;The class stores user information&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now we have a &lt;strong&gt;User object&lt;/strong&gt; that represents a real user.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 2: Create a Post Manager
&lt;/h1&gt;

&lt;p&gt;Now create &lt;strong&gt;post_manager.py&lt;/strong&gt;&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="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;PostManager&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;posts&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;create_post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;posts&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Post created successfully!&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;show_posts&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;All Posts:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;post&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;posts&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;- &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;post&lt;/span&gt;&lt;span class="si"&gt;}&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;This class manages:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Creating posts&lt;/li&gt;
&lt;li&gt;Storing posts&lt;/li&gt;
&lt;li&gt;Displaying posts&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Instead of mixing everything into one script, we keep &lt;strong&gt;post logic inside one class&lt;/strong&gt;.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 3: Utility Functions
&lt;/h1&gt;

&lt;p&gt;Now create &lt;strong&gt;utils.py&lt;/strong&gt;&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="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;show_menu&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;Choose an option:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;1. Create Post&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;2. Show Posts&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;3. Exit&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;Utility files help keep &lt;strong&gt;main.py clean&lt;/strong&gt;.&lt;/p&gt;




&lt;h1&gt;
  
  
  Step 4: Main Application File
&lt;/h1&gt;

&lt;p&gt;Create &lt;strong&gt;main.py&lt;/strong&gt;&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;user&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;User&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;post_manager&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;PostManager&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;utils&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;show_menu&lt;/span&gt;


&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;

    &lt;span class="n"&gt;username&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;input&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Enter username: &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;email&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;input&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Enter email: &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="n"&gt;user&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;User&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;username&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;email&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;manager&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;PostManager&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;User Details&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;display_user&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

    &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;

        &lt;span class="nf"&gt;show_menu&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="n"&gt;choice&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;input&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Select option: &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;choice&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;1&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;

            &lt;span class="n"&gt;content&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;input&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Enter post content: &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="n"&gt;manager&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create_post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

        &lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="n"&gt;choice&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;2&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;

            &lt;span class="n"&gt;manager&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;show_posts&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

        &lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="n"&gt;choice&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;3&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;

            &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Exiting program...&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="k"&gt;break&lt;/span&gt;

        &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;

            &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Invalid option&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;


&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;__name__&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;__main__&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This file connects everything together.&lt;/p&gt;




&lt;h1&gt;
  
  
  How to Run the Project
&lt;/h1&gt;

&lt;p&gt;Open terminal in your project folder and run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python main.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Enter username: Alex
Enter email: alex@email.com

Choose an option:
1. Create Post
2. Show Posts
3. Exit
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Before vs After OOP
&lt;/h1&gt;

&lt;p&gt;Before using OOP:&lt;/p&gt;

&lt;p&gt;❌ Everything in one file&lt;br&gt;
❌ Hard to maintain&lt;br&gt;
❌ Difficult to expand&lt;/p&gt;

&lt;p&gt;After using OOP:&lt;/p&gt;

&lt;p&gt;✔ Clean file structure&lt;br&gt;
✔ Organized code&lt;br&gt;
✔ Easy to extend&lt;br&gt;
✔ Professional design&lt;/p&gt;




&lt;h1&gt;
  
  
  Final Thoughts
&lt;/h1&gt;

&lt;p&gt;Refactoring a simple script into an &lt;strong&gt;Object-Oriented project&lt;/strong&gt; is one of the best habits a developer can build.&lt;/p&gt;

&lt;p&gt;It helps you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Write cleaner code&lt;/li&gt;
&lt;li&gt;Structure projects better&lt;/li&gt;
&lt;li&gt;Think like a software engineer&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Even if your project is small, organizing it using &lt;strong&gt;classes and modules&lt;/strong&gt; makes it easier to maintain in the future.&lt;/p&gt;

&lt;p&gt;Start simple, keep improving your structure, and your Python projects will feel &lt;strong&gt;much more professional&lt;/strong&gt;.&lt;/p&gt;




&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;Turning a messy Python script into a &lt;strong&gt;clean OOP structure&lt;/strong&gt; is a powerful upgrade.&lt;/p&gt;

&lt;p&gt;With just a few classes and files, your project becomes:&lt;/p&gt;

&lt;p&gt;✔ Cleaner&lt;br&gt;
✔ More maintainable&lt;br&gt;
✔ Easier to scale&lt;/p&gt;

&lt;p&gt;If you're learning Python, practicing OOP early will help you build &lt;strong&gt;better real-world projects&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Happy coding 🚀&lt;/p&gt;

</description>
      <category>terraform</category>
      <category>webdev</category>
      <category>oop</category>
      <category>programming</category>
    </item>
    <item>
      <title>Building Static Social Media Connect Pages &amp; Fixing OOP Errors in My Automation Project</title>
      <dc:creator>Bharath Kumar_30</dc:creator>
      <pubDate>Tue, 10 Mar 2026 12:54:39 +0000</pubDate>
      <link>https://forem.com/bharath_kumar_30_vog/building-static-social-media-connect-pages-fixing-oop-errors-in-my-automation-project-54eb</link>
      <guid>https://forem.com/bharath_kumar_30_vog/building-static-social-media-connect-pages-fixing-oop-errors-in-my-automation-project-54eb</guid>
      <description>&lt;p&gt;Today was one of those &lt;em&gt;“small work but big progress”&lt;/em&gt; days in my &lt;strong&gt;Social Media Post Automation System&lt;/strong&gt; project.&lt;/p&gt;

&lt;p&gt;Instead of writing more backend logic, I focused on two important things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Creating &lt;strong&gt;static HTML pages for social media connections&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Fixing &lt;strong&gt;OOP structure issues&lt;/strong&gt; in my automation code&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Simple tasks… but they helped clean up the project architecture a lot.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why Static HTML Pages?
&lt;/h2&gt;

&lt;p&gt;My system connects with multiple platforms:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;LinkedIn&lt;/li&gt;
&lt;li&gt;Facebook&lt;/li&gt;
&lt;li&gt;Instagram&lt;/li&gt;
&lt;li&gt;Telegram&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each platform needs &lt;strong&gt;API credentials and setup steps&lt;/strong&gt;, and during testing I realized something:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Every platform has its own setup process and documentation.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So instead of mixing everything into one messy page, I created &lt;strong&gt;separate static HTML pages for each platform&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Now each page shows:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Step-by-step setup instructions&lt;/li&gt;
&lt;li&gt;Required API credentials&lt;/li&gt;
&lt;li&gt;Input fields for tokens / IDs&lt;/li&gt;
&lt;li&gt;A connect button&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Basically a &lt;strong&gt;mini setup guide inside the project UI&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Example: Instagram Connect Page
&lt;/h2&gt;

&lt;p&gt;For example, the Instagram page explains how to:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Convert the account to &lt;strong&gt;Instagram Business&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Connect it to a &lt;strong&gt;Facebook Page&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Create an app in &lt;strong&gt;Meta Developers&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Enable &lt;strong&gt;Instagram Graph API&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Generate a &lt;strong&gt;Page Access Token&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Find the &lt;strong&gt;Instagram Business ID&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Then users can enter credentials directly in the page.&lt;/p&gt;

&lt;p&gt;Simple, clear, and much easier for testing.&lt;/p&gt;




&lt;h2&gt;
  
  
  Fixing My OOP Structure
&lt;/h2&gt;

&lt;p&gt;Another thing I worked on today was cleaning up my &lt;strong&gt;Object Oriented Programming structure&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Earlier my automation scripts were written like separate programs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;One script for Telegram&lt;/li&gt;
&lt;li&gt;One for Instagram&lt;/li&gt;
&lt;li&gt;One for Facebook&lt;/li&gt;
&lt;li&gt;One for LinkedIn&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That worked, but it wasn't scalable.&lt;/p&gt;

&lt;p&gt;So I started reorganizing everything into &lt;strong&gt;service classes&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Example structure:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;services/
 ├── linkedin_service.py
 ├── facebook_service.py
 ├── instagram_service.py
 └── telegram_service.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each platform now has its own class with functions like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;post()
connect()
validate_credentials()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then a &lt;strong&gt;manager class&lt;/strong&gt; controls everything.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SocialMediaManager
        |
        ├── LinkedInService
        ├── FacebookService
        ├── InstagramService
        └── TelegramService
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now my automation system can simply call:&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="n"&gt;manager&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;post_to_selected_platforms&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Much cleaner.&lt;/p&gt;




&lt;h2&gt;
  
  
  Debugging the OOP Errors
&lt;/h2&gt;

&lt;p&gt;While converting everything into classes, I hit a few classic beginner problems:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Missing class imports&lt;/li&gt;
&lt;li&gt;Async errors with Telegram&lt;/li&gt;
&lt;li&gt;Incorrect method calls&lt;/li&gt;
&lt;li&gt;Variables not being passed correctly&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Nothing dramatic… just the usual &lt;strong&gt;“why is this not working?”&lt;/strong&gt; moments 😅&lt;/p&gt;

&lt;p&gt;After fixing those issues, the system finally started running smoothly again.&lt;/p&gt;

&lt;p&gt;And honestly, debugging like this teaches more than writing the code itself.&lt;/p&gt;




&lt;h2&gt;
  
  
  What I Learned Today
&lt;/h2&gt;

&lt;p&gt;A few small but useful lessons:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Separate UI setup pages&lt;/strong&gt; make integrations easier to manage.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;OOP structure helps organize multi-platform automation.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Debugging errors is normal when restructuring code.&lt;/li&gt;
&lt;li&gt;Even simple HTML pages can improve project usability.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Sometimes progress isn't about writing hundreds of lines of code.&lt;/p&gt;

&lt;p&gt;Sometimes it's just &lt;strong&gt;cleaning things up so the system makes sense.&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  What’s Next?
&lt;/h2&gt;

&lt;p&gt;Next steps for the project:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Integrate all platforms into &lt;strong&gt;one posting dashboard&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Allow selecting platforms before publishing&lt;/li&gt;
&lt;li&gt;Improve UI design&lt;/li&gt;
&lt;li&gt;Deploy the automation system&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Slowly but surely, the automation platform is coming together.&lt;/p&gt;

&lt;p&gt;And yes… still powered by &lt;strong&gt;a lot of coffee and debugging sessions. ☕&lt;/strong&gt;&lt;/p&gt;




&lt;p&gt;Thanks for reading!&lt;br&gt;
If you're building automation tools or API integrations, I'd love to hear about your experience too.&lt;/p&gt;

</description>
      <category>html</category>
      <category>staticwebapps</category>
      <category>help</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
