<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Mahinur Rahman</title>
    <description>The latest articles on DEV Community by Mahinur Rahman (@mahinur05).</description>
    <link>https://dev.to/mahinur05</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%2F1168749%2F2baa3a8c-f66f-4751-99c8-3fd51f4c5c4c.jpeg</url>
      <title>DEV Community: Mahinur Rahman</title>
      <link>https://dev.to/mahinur05</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mahinur05"/>
    <language>en</language>
    <item>
      <title>Did you ever feel the need of money management but filling forms isn't making sense? Visit Accountant AI</title>
      <dc:creator>Mahinur Rahman</dc:creator>
      <pubDate>Thu, 31 Jul 2025 19:49:13 +0000</pubDate>
      <link>https://dev.to/mahinur05/did-you-ever-feel-the-need-of-money-management-but-filling-forms-isnt-making-sense-visit-2n8k</link>
      <guid>https://dev.to/mahinur05/did-you-ever-feel-the-need-of-money-management-but-filling-forms-isnt-making-sense-visit-2n8k</guid>
      <description>&lt;p&gt;&lt;strong&gt;What makes Accountant AI different than other expense tracker?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We reduced the need of &lt;del&gt;form fill-up&lt;/del&gt;. Just prompt us like - &lt;em&gt;i have 3 subscription of netflix, vercel and gpt costing 20, 50 and 10 dollars and i have to pay them on the 5th of the month.&lt;/em&gt; Boom you will get 3 different recurring transaction with all the details -&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Title&lt;/li&gt;
&lt;li&gt;Description&lt;/li&gt;
&lt;li&gt;Amount&lt;/li&gt;
&lt;li&gt;Currency&lt;/li&gt;
&lt;li&gt;Recurring or not&lt;/li&gt;
&lt;li&gt;Due or not&lt;/li&gt;
&lt;li&gt;Paid or not&lt;/li&gt;
&lt;li&gt;Transaction date&lt;/li&gt;
&lt;li&gt;Recurring date&lt;/li&gt;
&lt;li&gt;Paid date&lt;/li&gt;
&lt;li&gt;Even file link related to this transaction (&lt;em&gt;if you convert Receipt Image, PDF or CSV&lt;/em&gt;)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Some powerful features:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;File conversion:&lt;/strong&gt; You can upload bank statement or receipt of your payment/income or maybe some random csv for your previous data you kept records - we can make them butter smooth by formatting in transactions!&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;2. AI Assistant:&lt;/strong&gt; It knows all your transaction, just ask him anything you want! Even relevant files can be created by the assistant.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Transaction list:&lt;/strong&gt; Even though your AI assistant knows everything you can just check manually from a table with high level filtering.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Projects:&lt;/strong&gt; You can create projects based on your needs! For example, you are a &lt;strong&gt;small business owner&lt;/strong&gt;, you can create a project with your store name and keep records of your products, buy-sell list here.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Statistics &amp;amp; Analytics:&lt;/strong&gt; This one is very cool for showing &lt;strong&gt;calendar wise transaction data&lt;/strong&gt;. You can navigate from months to month and click on the cell to check your daily income expense list. You also have some fancy useful graph where data can be exported too!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Due &amp;amp; Recurring:&lt;/strong&gt; Here you will see all your due transaction and recurring transactions. You can get a summary of all your data + &lt;strong&gt;reminder&lt;/strong&gt; for your any due or recurring transactions. Every month it will &lt;strong&gt;reset the recurring payment&lt;/strong&gt; so that you don't need to update it again.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Interested? Give it a try...&lt;/strong&gt; &lt;a href="https://www.getaccountantai.com/" rel="noopener noreferrer"&gt;&lt;strong&gt;Accountant AI&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>🚀 Deploying Node.js Application with PM2, NGINX, and SSL Configuration 🚀</title>
      <dc:creator>Mahinur Rahman</dc:creator>
      <pubDate>Mon, 07 Oct 2024 15:43:09 +0000</pubDate>
      <link>https://dev.to/mahinur05/deploying-nodejs-application-with-pm2-nginx-and-ssl-configuration-26cm</link>
      <guid>https://dev.to/mahinur05/deploying-nodejs-application-with-pm2-nginx-and-ssl-configuration-26cm</guid>
      <description>&lt;p&gt;Today, I deployed a new Node.js app on AWS using a smooth setup process with Node.js, PM2, NGINX, and Certbot for SSL(no need to touch cpanel). Only 5 steps to deploy your app in AWS. Here’s the step-by-step guide that can save time for you!&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install Node.js &amp;amp; NPM:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt-get update
sudo apt-get install -y ca-certificates curl gnupg
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
NODE_MAJOR=20
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/nodesource.list &amp;gt; /dev/null
sudo apt-get update
sudo apt-get install nodejs -y
sudo apt install npm -y
npm i -g n
sudo n lts
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Clone Your Repo and Setup PM2:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git clone &amp;lt;your-repo&amp;gt;
cd &amp;lt;your-repo-directory&amp;gt;
git checkout &amp;lt;branch-name&amp;gt;
npm install
sudo npm i -g pm2@latest
pm2 init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Configure PM2 with a Template:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;module.exports = {
  apps: [
    {
      name: 'your-app-name',
      cwd: '/home/ubuntu/my-project',
      script: 'npm',
      args: 'start',
      env: {
        "KEY": "value",
      },
    },
  ],
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Make a subdomain first, then&lt;/li&gt;
&lt;li&gt;Now add A record in your DNS - CPANEL for the public IP where your instance is live (example 3.107.76.239) and set TTL to 300 &lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;Configure NGINX for Reverse Proxy:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt install nginx
sudo nano /etc/nginx/sites-available/default
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Set the domain and point your port in NGINX config:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;server {
    listen 80;
    server_name yourdomain.com;
    location / {
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $host;
        proxy_pass http://127.0.0.1:3000;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Restart NGINX:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl restart nginx

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;SSL Configuration with Certbot (NO TOUCH NEEDED IN CPANEL):
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt install certbot python3-certbot-nginx
sudo certbot --nginx -d yourdomain.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now you have your Node.js app running securely with an SSL-enabled domain 🎉&lt;br&gt;
🔗 DM me if you'd like more tips on server setup, Node.js deployment, or other dev-related topics.&lt;/p&gt;

&lt;h1&gt;
  
  
  Nodejs #AWS #DevOps #PM2 #Nginx #SSL #FullStack #WebDev
&lt;/h1&gt;

</description>
      <category>aws</category>
      <category>ssl</category>
      <category>nginx</category>
      <category>pm2</category>
    </item>
    <item>
      <title>The Power of AGGREGATION in Cron Jobs and Cost-Effectiveness</title>
      <dc:creator>Mahinur Rahman</dc:creator>
      <pubDate>Mon, 23 Sep 2024 14:35:57 +0000</pubDate>
      <link>https://dev.to/mahinur05/the-power-of-aggregation-in-cron-jobs-and-cost-effectiveness-5484</link>
      <guid>https://dev.to/mahinur05/the-power-of-aggregation-in-cron-jobs-and-cost-effectiveness-5484</guid>
      <description>&lt;p&gt;While working on my SaaS product I found, For 10k users, you'd need 10,001 queries daily with regular DB queries to reset credits or free prompt. With smart aggregation, you only need 2 queries, no matter if you have 10k or 100k users!&lt;/p&gt;

&lt;p&gt;Firstly, let me give you some COST REVIEW for MongoDB production database (10k &amp;amp; 1 year): &lt;/p&gt;

&lt;p&gt;Normal way, Daily Queries: 10,001 &lt;br&gt;
Annual Queries: 10,001 x 365 = 3,650,365 queries&lt;br&gt;
Annual Cost: 3,650,365 x $0.001 = 3,650.37 USD&lt;/p&gt;

&lt;p&gt;Aggregation way, Daily Queries: 2&lt;br&gt;
Annual Queries: 2 x 365 = 730 queries&lt;br&gt;
Annual Cost: 730 x $0.001 = 0.73 USD &lt;/p&gt;

&lt;p&gt;Savings: 3,650.37 -  0.73 = 3,649.64 USD (nearly 4 lakh bdt)&lt;/p&gt;

&lt;p&gt;Awesome, now look at traditional approach of query (which make one query for each user )&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const resetLimitsForUsers = async () =&amp;gt; {
  const users = await User.find({ /* conditions to select users */ });

  for (const user of users) {
    if (user.plan.remaining_prompt_count &amp;lt; 3 || user.plan.remaining_page_count &amp;lt; 3) {
      user.plan.remaining_prompt_count = 3;
      user.plan.total_prompt_count = 3;
      // Save updated plan
      await user.plan.save();
    }
  }
};

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here if you have 10,000 users, this results in 10,001 queries (1 for each user, plus the initial query to fetch users) - that was huge..&lt;/p&gt;

&lt;p&gt;Now the hero entry, [ which looks little tough but it saves tons of your money ]&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const resetPlanCounts = () =&amp;gt; {
  cron.schedule('* * * * *', async () =&amp;gt; {
    try {
      const twoMinutesAgo = new Date(Date.now() - 2 * 60 * 1000); // 2 minutes ago

      const usersWithRegisteredPlan = await User.aggregate([
        {
          $match: {
            createdAt: { $lte: twoMinutesAgo },
            plan: { $exists: true }
          }
        },
        {
          $lookup: {
            from: 'plans',
            localField: 'plan',
            foreignField: '_id',
            as: 'planDetails'
          }
        },
        {
          $unwind: '$planDetails'
        },
        {
          $match: {
            'planDetails.name': 'Registered',
            $or: [
              { 'planDetails.remaining_prompt_count': { $lt: 3 } },
              { 'planDetails.remaining_page_count': { $lt: 3 } }
            ]
          }
        },
        {
          $project: {
            planId: '$planDetails._id'
          }
        }
      ]);

      const planIds = usersWithRegisteredPlan.map(user =&amp;gt; user.planId);

      if (planIds.length &amp;gt; 0) {
        const { modifiedCount } = await Plan.updateMany(
          { _id: { $in: planIds } },
          { $set: { remaining_prompt_count: 3, total_prompt_count: 3, remaining_page_count: 3, total_page_count: 3 } }
        );

        console.log(`${modifiedCount} plans reset for "Registered" users.`);
      } else {
        console.log('No plans to reset for today.');
      }
    } catch (error) {
      console.error('Error resetting plan counts:', error);
    }
  });
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's how you can run your cron job [ it runs automatically in a specific time ] for updating all 10k users credits or limit which can save more than 3600 USD in a year. &lt;/p&gt;

&lt;p&gt;AUTHOR, &lt;br&gt;
Name: Mahinur Rahman &lt;br&gt;
Contact: &lt;a href="mailto:dev.mahinur.rahman@gmail.com"&gt;dev.mahinur.rahman@gmail.com&lt;/a&gt;&lt;/p&gt;

</description>
      <category>cornjob</category>
      <category>aggregation</category>
      <category>mongodb</category>
      <category>javascript</category>
    </item>
    <item>
      <title>My experience with OpenAI API</title>
      <dc:creator>Mahinur Rahman</dc:creator>
      <pubDate>Sun, 24 Sep 2023 05:28:25 +0000</pubDate>
      <link>https://dev.to/mahinur05/my-experience-with-openai-api-5b3j</link>
      <guid>https://dev.to/mahinur05/my-experience-with-openai-api-5b3j</guid>
      <description>&lt;p&gt;&lt;strong&gt;Today I’ll share my experience working with openAI API (ChatGPT)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;✨ I have been working with AI based travel planner application✈️. I’m going to share my problem, what difficulties I’ve faced and how I came up with the solutions.&lt;/p&gt;

&lt;p&gt;✨ &lt;strong&gt;Problem&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;Planning a trip based on users interests and other preferences where trip could be of multiple days. &lt;/p&gt;

&lt;p&gt;✨&lt;strong&gt;How OPEN AI helped me:&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;I’ve connected OPEN AI with user preferences to get related places with their personality.&lt;/p&gt;

&lt;p&gt;⭐️ &lt;strong&gt;Challenges&lt;/strong&gt; ⭐️&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Taking all user preferences to GPT to understand user’s personality.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Making prompt so that every time i get same response format.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Had to recover data returned from GPT in my preferred JSON format.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Connect google places API to get users required trip places based on GPT driven result.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Handling GPT error while generating a trip for smooth user experience.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;⭐️ &lt;strong&gt;Solutions&lt;/strong&gt; ⭐️&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;GPT has limited token supply for each prompt. We can’t pass all our data through prompt. It’s better to make another prompt to get desired data before making the final prompt. In our case we had to generate personality for each profiles by providing user preferences and interests to maintain token length small enough in final prompt.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;POMPT Engineering is must for making application smooth. Application needs same response all the time. So making a prompt that gives same response all the time, is must. We had to repeat same keyword sometimes to make GPT understand what we need the most. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;GPT generally replies like human being. But for developer like us who has a little more complex issues need the JSON format mostly. We need key-value pair in order to get out best. Cause parsing text and making JSON is not a good idea. We had specified our JSON format and current version of JSON to get the static output.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Now we have JSON, we need places. For getting places we made queries based on preferences of user and for each query we got some places from PLACES API.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Finally, the worst part of GPT is when traffic is high it breaks down. That’s a big issue until you start a project related to OPEN AI 😄 So all you need to check every time whether there is anything right or not. Making smooth user experience we had to handle them multiple times.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;✨&lt;strong&gt;That’s all from my perspective.&lt;/strong&gt; I believe learning knows no bounds. Feel free to share your thoughts 💭&lt;/p&gt;

</description>
      <category>openapi</category>
      <category>node</category>
      <category>gpt3</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
