<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Dalaxshan Makenthiran on Medium]]></title>
        <description><![CDATA[Stories by Dalaxshan Makenthiran on Medium]]></description>
        <link>https://medium.com/@ujanth1998?source=rss-4cd3e4b24004------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*FnBmyGEmni72R-c6dt8yMA.jpeg</url>
            <title>Stories by Dalaxshan Makenthiran on Medium</title>
            <link>https://medium.com/@ujanth1998?source=rss-4cd3e4b24004------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 02:57:32 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ujanth1998/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to Configure NodeMailer in a NestJS Application ?]]></title>
            <link>https://medium.com/@ujanth1998/how-to-configure-nodemailer-in-a-nestjs-application-b641a8bd285f?source=rss-4cd3e4b24004------2</link>
            <guid isPermaLink="false">https://medium.com/p/b641a8bd285f</guid>
            <category><![CDATA[google-app-password]]></category>
            <category><![CDATA[smtp]]></category>
            <category><![CDATA[nodemailer]]></category>
            <category><![CDATA[nestjs]]></category>
            <category><![CDATA[gmail]]></category>
            <dc:creator><![CDATA[Dalaxshan Makenthiran]]></dc:creator>
            <pubDate>Sun, 28 Jun 2026 17:16:51 GMT</pubDate>
            <atom:updated>2026-07-09T05:56:26.391Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*82fDtVC10WY8t2wQ0C_V0w.png" /></figure><h3>Step 1: Create a NestJS Project</h3><p>The first step is to create a new NestJS application if you do not already have one.</p><pre>nest new nodemailer-be</pre><h3>Step 2: Install Required Dependencies</h3><p>Install the required packages for NodeMailer and email template support.</p><pre>yarn add nodemailer @nestjs-modules/mailer<br>yarn add -D @types/nodemailer <br>yarn add handlebars<br>yarn add -D @types/handlebars</pre><h3>Step 3: Install the Configuration Module</h3><p>Environment variables should be used to securely store sensitive information such as SMTP credentials. The @nestjs/config package allows you to manage environment variables efficiently throughout your application.</p><pre>yarn add @nestjs/config</pre><h3>Step 4: Create Environment Variables</h3><p>Create a .env file in the root directory of your project. This file will contain all email-related configuration values, including SMTP server details and authentication credentials.</p><pre>MAIL_HOST=smtp.gmail.com # SMTP server host address <br>MAIL_PORT=587 # SMTP server port number <br>MAIL_USER=your-email@gmail.com # Email account used to send emails <br>MAIL_PASSWORD=your-app-password # Gmail App Password <br>MAIL_FROM=your-email@gmail.com # Default sender email address</pre><h3>Hint : How to Create an Gmail App Password in a Google Account</h3><p><em>a. Sign in to your Google Account.</em></p><p><em>b. Navigate to </em><strong><em>Security and Sign-In</em></strong><em>.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*k9RwfGtL9viAsmbg.png" /></figure><p>c. <em>Enable 2-Step Verification if it is not already enabled.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/0*_OgWloXwH5l7e2vR.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/972/0*BP8mlhUcpzk4CRQ1.png" /></figure><p><em>d. Select App Passwords.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/0*j-ioRlEKHMnezu4f.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/0*fmIDOigEOspD55ZK.png" /></figure><p><em>e. Enter App Name &amp; Generate App Password.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/0*CCsoMmXTWV_L23Q4.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/972/0*h9Z4I27Jvydv-8L0.png" /></figure><h3>Step 5 : Generate the Mail Service, Controller, and Module Files</h3><p>Use the following command to generate the Mail module, service, and controller files:</p><pre>nest g resource mail</pre><p><strong>Note:</strong> mail is the folder name. You can replace it with your preferred module name if required.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/301/0*1sdXVMMruNOqQs_3.png" /></figure><h3>Step 6: Configure the Mailer Module</h3><p>The Mailer Module is responsible for establishing a connection with the SMTP server and configuring email templates.</p><pre>import { Module } from &#39;@nestjs/common&#39;;<br>import { MailerModule } from &#39;@nestjs-modules/mailer&#39;;<br>import { ConfigModule, ConfigService } from &#39;@nestjs/config&#39;;<br>import { join } from &#39;path&#39;;<br>import { MailService } from &#39;./mail.service&#39;;<br>import { MailController } from &#39;./mail.controller&#39;;<br>import { HandlebarsAdapter } from &#39;@nestjs-modules/mailer/adapters/handlebars.adapter&#39;;<br><br>@Module({<br>  imports: [<br>    MailerModule.forRootAsync({<br>      imports: [ConfigModule],<br>      useFactory: async (config: ConfigService) =&gt; ({<br>        transport: {<br>          host: config.get(&#39;MAIL_HOST&#39;),<br>          port: config.get&lt;number&gt;(&#39;MAIL_PORT&#39;),<br>          secure: false,<br>          auth: {<br>            user: config.get(&#39;MAIL_USER&#39;),<br>            pass: config.get(&#39;MAIL_PASS&#39;),<br>          },<br>        },<br>        defaults: {<br>          from: `&quot;No Reply&quot; &lt;${config.get(&#39;MAIL_FROM&#39;)}&gt;`,<br>        },<br>        template: {<br>          dir: join(__dirname, &#39;templates&#39;),<br>          adapter: new HandlebarsAdapter(),<br>          options: { strict: true },<br>        },<br>      }),<br>      inject: [ConfigService],<br>    }),<br>  ],<br>  providers: [MailService],<br>  controllers: [MailController],<br>  exports: [MailService],<br>})<br>export class MailModule { }</pre><h3>Step 7: Create an Email Service</h3><p>Create a dedicated service to handle all email-related operations, such as sending welcome emails, OTPs, and password reset emails.</p><pre>import { Injectable } from &#39;@nestjs/common&#39;;<br>import { MailerService } from &#39;@nestjs-modules/mailer&#39;;<br><br>@Injectable()<br>export class MailService {<br>  constructor(private readonly mailerService: MailerService) {}<br>  // Welcome Email<br>  async sendWelcomeEmail(to: string, name: string, url: string) {<br>    await this.mailerService.sendMail({<br>      to,<br>      subject: &#39;Welcome to MyApp!&#39;,<br>      template: &#39;welcome&#39;,           <br>      context: { name, url },       <br>    });<br>  }<br>  // Reset Password Email<br>  async sendResetPasswordEmail(to: string, name: string, resetUrl: string) {<br>    await this.mailerService.sendMail({<br>      to,<br>      subject: &#39;Reset Your Password&#39;,<br>      template: &#39;reset-password&#39;,    <br>      context: { name, resetUrl, expiry: &#39;15 minutes&#39; },<br>    });<br>  }<br>  // OTP Email<br>  async sendOtpEmail(to: string, name: string, otp: string) {<br>    await this.mailerService.sendMail({<br>      to,<br>      subject: &#39;Your OTP Code&#39;,<br>      template: &#39;otp&#39;,            <br>      context: { name, otp, expiry: &#39;5 minutes&#39; },<br>    });<br>  }<br>}</pre><h3>Step 7: Create an Email Controller.</h3><p>Create a Mail Controller with an endpoint that triggers email sending.</p><pre>import { Controller, Post, Body } from &#39;@nestjs/common&#39;;<br>import { MailService } from &#39;./mail.service&#39;;<br><br>@Controller(&#39;mail&#39;)<br>export class MailController {<br>  constructor(private readonly mailService: MailService) {}<br>  @Post(&#39;welcome&#39;)<br>  async welcome(@Body() body: { to: string; name: string; url: string }) {<br>    await this.mailService.sendWelcomeEmail(body.to, body.name, body.url);<br>    return { message: &#39;Welcome email sent&#39; };<br>  }<br>  @Post(&#39;reset-password&#39;)<br>  async resetPassword(@Body() body: { to: string; name: string; resetUrl: string }) {<br>    await this.mailService.sendResetPasswordEmail(body.to, body.name, body.resetUrl);<br>    return { message: &#39;Reset password email sent&#39; };<br>  }<br>  @Post(&#39;otp&#39;)<br>  async otp(@Body() body: { to: string; name: string; otp: string }) {<br>    await this.mailService.sendOtpEmail(body.to, body.name, body.otp);<br>    return { message: &#39;OTP email sent&#39; };<br>  }<br>}</pre><h3>Step 8 :Create Email Templates</h3><p>Create the following Handlebars (.hbs) templates:</p><p><strong>a. Welcome Email Template (</strong>welcome.hbs<strong>)</strong></p><pre>&lt;!DOCTYPE html&gt;<br>&lt;html&gt;<br>&lt;head&gt;<br>  &lt;style&gt;<br>    body { font-family: Arial, sans-serif; background: #f4f4f4; margin: 0; padding: 0; }<br>    .container { max-width: 600px; margin: 40px auto; background: #fff; border-radius: 8px; padding: 40px; }<br>    .header { background: #4F46E5; color: white; padding: 20px; border-radius: 8px 8px 0 0; text-align: center; }<br>    .body { padding: 30px 20px; color: #333; }<br>    .button { display: inline-block; padding: 12px 30px; background: #4F46E5; color: white;<br>              text-decoration: none; border-radius: 5px; margin-top: 20px; }<br>    .footer { text-align: center; color: #999; font-size: 12px; margin-top: 30px; }<br>  &lt;/style&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>  &lt;div class=&quot;container&quot;&gt;<br>    &lt;div class=&quot;header&quot;&gt;<br>      &lt;h1&gt;Welcome to MyApp!&lt;/h1&gt;<br>    &lt;/div&gt;<br>    &lt;div class=&quot;body&quot;&gt;<br>      &lt;h2&gt;Hi {{name}},&lt;/h2&gt;<br>      &lt;p&gt;Thanks for signing up! We&#39;re excited to have you on board.&lt;/p&gt;<br>      &lt;p&gt;Click the button below to get started:&lt;/p&gt;<br>      &lt;a href=&quot;{{url}}&quot; class=&quot;button&quot;&gt;Get Started&lt;/a&gt;<br>    &lt;/div&gt;<br>    &lt;div class=&quot;footer&quot;&gt;<br>      &lt;p&gt;© 2025 MyApp. All rights reserved.&lt;/p&gt;<br>    &lt;/div&gt;<br>  &lt;/div&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><p><strong>b. Reset Password Template (</strong>reset-password.hbs<strong>)</strong></p><pre>&lt;!DOCTYPE html&gt;<br>&lt;html&gt;<br>&lt;head&gt;<br>  &lt;style&gt;<br>    body { font-family: Arial, sans-serif; background: #f4f4f4; margin: 0; padding: 0; }<br>    .container { max-width: 600px; margin: 40px auto; background: #fff; border-radius: 8px; padding: 40px; }<br>    .header { background: #DC2626; color: white; padding: 20px; border-radius: 8px 8px 0 0; text-align: center; }<br>    .body { padding: 30px 20px; color: #333; }<br>    .otp-box { font-size: 32px; font-weight: bold; letter-spacing: 8px; color: #4F46E5;<br>               text-align: center; padding: 20px; background: #f0f0ff; border-radius: 8px; margin: 20px 0; }<br>    .button { display: inline-block; padding: 12px 30px; background: #DC2626; color: white;<br>              text-decoration: none; border-radius: 5px; margin-top: 20px; }<br>    .footer { text-align: center; color: #999; font-size: 12px; margin-top: 30px; }<br>    .warning { color: #DC2626; font-size: 13px; margin-top: 15px; }<br>  &lt;/style&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>  &lt;div class=&quot;container&quot;&gt;<br>    &lt;div class=&quot;header&quot;&gt;<br>      &lt;h1&gt;Password Reset Request&lt;/h1&gt;<br>    &lt;/div&gt;<br>    &lt;div class=&quot;body&quot;&gt;<br>      &lt;h2&gt;Hi {{name}},&lt;/h2&gt;<br>      &lt;p&gt;We received a request to reset your password. Click the link below:&lt;/p&gt;<br>      &lt;a href=&quot;{{resetUrl}}&quot; class=&quot;button&quot;&gt;Reset Password&lt;/a&gt;<br>      &lt;p class=&quot;warning&quot;&gt;⚠️ This link expires in &lt;strong&gt;{{expiry}}&lt;/strong&gt;.&lt;/p&gt;<br>      &lt;p&gt;If you didn&#39;t request this, please ignore this email.&lt;/p&gt;<br>    &lt;/div&gt;<br>    &lt;div class=&quot;footer&quot;&gt;<br>      &lt;p&gt;© 2026 Ventrax Solutions. All rights reserved.&lt;/p&gt;<br>    &lt;/div&gt;<br>  &lt;/div&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><p><strong>c. OTP Template (</strong>otp.hbs<strong>)</strong></p><pre>&lt;!DOCTYPE html&gt;<br>&lt;html&gt;<br>&lt;head&gt;<br>  &lt;style&gt;<br>    body { font-family: Arial, sans-serif; background: #f4f4f4; margin: 0; padding: 0; }<br>    .container { max-width: 600px; margin: 40px auto; background: #fff; border-radius: 8px; padding: 40px; }<br>    .header { background: #059669; color: white; padding: 20px; border-radius: 8px 8px 0 0; text-align: center; }<br>    .body { padding: 30px 20px; color: #333; }<br>    .otp-box { font-size: 40px; font-weight: bold; letter-spacing: 10px; color: #059669;<br>               text-align: center; padding: 20px; background: #f0fff4; border-radius: 8px; margin: 20px 0; }<br>    .footer { text-align: center; color: #999; font-size: 12px; margin-top: 30px; }<br>  &lt;/style&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>  &lt;div class=&quot;container&quot;&gt;<br>    &lt;div class=&quot;header&quot;&gt;<br>      &lt;h1&gt;Your OTP Code&lt;/h1&gt;<br>    &lt;/div&gt;<br>    &lt;div class=&quot;body&quot;&gt;<br>      &lt;h2&gt;Hi {{name}},&lt;/h2&gt;<br>      &lt;p&gt;Your one-time password is:&lt;/p&gt;<br>      &lt;div class=&quot;otp-box&quot;&gt;{{otp}}&lt;/div&gt;<br>      &lt;p&gt;This OTP is valid for &lt;strong&gt;{{expiry}}&lt;/strong&gt;. Do not share it with anyone.&lt;/p&gt;<br>    &lt;/div&gt;<br>    &lt;div class=&quot;footer&quot;&gt;<br>      &lt;p&gt;© 2026 Ventrax Solutions. All rights reserved.&lt;/p&gt;<br>    &lt;/div&gt;<br>  &lt;/div&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><h3>Step 9 : Update the nest-cli.json File</h3><p>Update the nest-cli.json file to include the email template assets during the build process.</p><pre>{<br>  &quot;$schema&quot;: &quot;https://json.schemastore.org/nest-cli&quot;,<br>  &quot;collection&quot;: &quot;@nestjs/schematics&quot;,<br>  &quot;sourceRoot&quot;: &quot;src&quot;,<br>  &quot;compilerOptions&quot;: {<br>    &quot;deleteOutDir&quot;: true,<br>    &quot;assets&quot;: [<br>      {<br>        &quot;include&quot;: &quot;mail/templates/**/*&quot;,<br>        &quot;outDir&quot;: &quot;dist&quot;<br>      }<br>    ]<br>  }<br>}</pre><h3>Step 10: Run the Server and Test Email Sending</h3><p>Start the application and test the email functionality.</p><pre>yarn start:dev</pre><h3>Hint : Postman Requests for Each Template</h3><p><strong>a. Welcome Template:</strong></p><pre>//POST http://localhost:3000/mail/welcome<br>{<br>  &quot;to&quot;: &quot;user@gmail.com&quot;,<br>  &quot;name&quot;: &quot;Ujanth&quot;,<br>  &quot;url&quot;: &quot;https://myapp.com/dashboard&quot;<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/630/0*v9AQrxIKUDp3-9uA.png" /></figure><p><strong>b. Reset Password:</strong></p><pre>//POST http://localhost:3000/mail/reset-password<br>{<br>  &quot;to&quot;: &quot;user@gmail.com&quot;,<br>  &quot;name&quot;: &quot;Ujanth&quot;,<br>  &quot;resetUrl&quot;: &quot;https://myapp.com/reset?token=abc123&quot;<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/630/0*XgieUbIgookFgWAo.png" /></figure><p><strong>c. OTP:</strong></p><pre>//POST http://localhost:3000/mail/otp<br>{<br>  &quot;to&quot;: &quot;user@gmail.com&quot;,<br>  &quot;name&quot;: &quot;Ujanth&quot;,<br>  &quot;otp&quot;: &quot;847291&quot;<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/632/0*i2rjPXX5ddUwl0rr.png" /></figure><h3><strong>Github Repository</strong></h3><p><a href="https://github.com/Dalaxshan/Nodemailer-Configuration-BE.git">GitHub - Dalaxshan/Nodemailer-Configuration-BE</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b641a8bd285f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Configure JWT-based Authentication Using Prisma V7+ with NestJS and PostgreSQL(Supabase)]]></title>
            <link>https://medium.com/@ujanth1998/how-to-configure-jwt-based-authentication-using-prisma-v7-with-nestjs-and-postgresql-supabase-a04bd1319fad?source=rss-4cd3e4b24004------2</link>
            <guid isPermaLink="false">https://medium.com/p/a04bd1319fad</guid>
            <category><![CDATA[postgresql]]></category>
            <category><![CDATA[jwt-token]]></category>
            <category><![CDATA[nestjs]]></category>
            <category><![CDATA[prisma]]></category>
            <category><![CDATA[supabase]]></category>
            <dc:creator><![CDATA[Dalaxshan Makenthiran]]></dc:creator>
            <pubDate>Tue, 17 Mar 2026 16:04:47 GMT</pubDate>
            <atom:updated>2026-03-17T16:04:47.122Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FMsHiXeRPBNBHyT2DkjW_Q.png" /></figure><h3>A. SETUP SUPABASE</h3><h4><strong>1. Create a new Supabase project</strong></h4><blockquote>i. Go to <a href="https://supabase.com/">https://supabase.com/dashboard</a></blockquote><blockquote>ii. Click <strong>New Project</strong></blockquote><blockquote>iii. Choose an organization (or create one)</blockquote><blockquote>iv. Give your project a name (e.g. nest-prisma-auth)</blockquote><blockquote>v. Set a strong database password → remember / save it</blockquote><blockquote>vi. Choose a region close to you (e.g. closest to Sri Lanka → probably Singapore or Mumbai)</blockquote><blockquote>vii. Click <strong>Create new project</strong> (wait ~1–2 minutes)</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YFZznytI9Uef8KPNWmfS1Q.png" /></figure><h4>2. <strong>Get your Supabase connection strings</strong></h4><p>i. Go to <strong>Settings</strong> → <strong>Database</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q1IscgAOQ1Cp0Uft1ZZ-uw.png" /></figure><p>ii. Under <strong>Connection string</strong> section click <strong>Connect</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ElVRCy6gi7trmgbp_tl4_A.png" /></figure><p>iii. You’ll see 3 important strings:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-vHs9t9Vd6cIEXQ3pDo43Q.png" /></figure><blockquote><strong>a.</strong> <strong>Direct connection(port 5432) </strong>→ postgresql://postgres:[YOUR-PASSWORD]@db.shnnuvxfdfdhfrnmsdb.supabase.co:5432/postgres</blockquote><blockquote>b. <strong>Transaction pooler mode</strong> (port 6543) → better for <strong>serverless</strong> / many connections (you can use this later if needed)</blockquote><blockquote>c. <strong>Session pooler mode</strong> (port 5432) → use this for <strong>migrations</strong> and normal apps Example: postgresql://postgres.[project-ref]:[YOUR-PASSWORD]@aws-0-[region].pooler.supabase.com:5432/postgres</blockquote><p>→ Choose <strong>Session pooler mode</strong> and copy connection string and replace your password.</p><p><em>Ex:- </em><strong><em>DATABASE_URL :postgresql://postgres.shnnuvxrerernmsdb:Test@12345</em></strong><a href="http://twitter.com/aws"><strong><em>@aws</em></strong></a><strong><em>-1-ap-southeast-1.pooler.supabase.com:5432/postgres</em></strong></p><p>Note :- <em>“If you choose a </em><strong><em>direct connection</em></strong><em>, you need to purchase the IPv4 add-on because the free tier does not support IPv4 networks. If you add a </em><strong><em>direct connection</em></strong><em> without it, you will encounter the issue below.”</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*qsjgDCV6Oym4qKfd6nT24A.png" /></figure><h3><strong>B. SETUP NEST JS PROJECT</strong></h3><figure><img alt="Project Folder Strcture" src="https://cdn-images-1.medium.com/max/313/1*4XtuiqEJy3zUlyGmV9f_zA.png" /><figcaption>Project Folder Strcture</figcaption></figure><h4><strong>1. Create Nest js project (Project Name : prisma-auth)</strong></h4><pre>npm i -g @nestjs/cli <br>nest new prisma-auth<br>cd prisma-auth</pre><h4><strong>2. Install dependencies</strong></h4><pre>npm install @prisma/client @nestjs/jwt @nestjs/passport passport passport-jwt bcrypt<br>npm install -D prisma @types/passport-jwt @types/bcrypt</pre><h4><strong>3. Initialize Prisma</strong></h4><p><strong>a. Initialize Prisma in Your Project</strong></p><pre>npx prisma init</pre><p><strong>Note :</strong> This command creates a <strong>prisma folder</strong> and an <strong>.env file</strong> where database configuration will be stored.</p><p><strong>b. Configure Environment Variables</strong></p><p>Update the .env file with your database connection string and JWT secret key.</p><pre>DATABASE_URL :postgresql://postgres.shnnuasfdfggmsdb:Test@12345@aws-1-ap-southeast-1.pooler.supabase.com:5432/postgres<br>JWT_SECRET=&quot;your_super_secret_key&quot;</pre><p><strong>Note : How to generate JWT_SECRET Key ?</strong></p><p>Open terminal / Powershell paste below code.</p><pre>node -e &quot;console.log(require(&#39;crypto&#39;).randomBytes(64).toString(&#39;hex&#39;))&quot;</pre><p>Copy the generated string and use it as the value for JWT_SECRET in your .env file.</p><p><strong>c. Define the Prisma Schema</strong></p><p>Create the database structure inside prisma/schema.prisma.</p><pre>generator client {<br> provider = &quot;prisma-client&quot;<br> output = &quot;../src/generated/prisma&quot;<br> moduleFormat=&quot;cjs&quot;<br>}<br><br>datasource db {<br> provider = &quot;postgresql&quot;<br>}<br><br>model User {<br> id Int @id @default(autoincrement())<br> name String @unique<br> email String @unique<br> password String<br> createdAt DateTime @default(now())<br>}</pre><p>This schema defines a <strong>User table</strong> that stores user credentials and account details.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/307/1*Qm42w-GdqVQgYsA_csL3GA.png" /></figure><p><strong>d. Run Prisma Migrations</strong></p><p>Run the following commands to apply the schema to the database and generate the Prisma client. This creates the required tables in your PostgreSQL database.</p><pre>npx prisma migrate dev --name init<br>npx prisma generate</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/468/1*JFESJt-p3JAEYsLi4GQdCw.png" /><figcaption>Generated Prisma’ Folder Strcture</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X3nSq_71aA-oM8543tTSSA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/277/1*T9DZ3FrqTofZ5rYKF4gXxQ.png" /><figcaption>Supabase Table Strcture</figcaption></figure><p><strong>e. Install Prisma PostgreSQL Adapter</strong></p><pre> npm install @prisma/adapter-pg</pre><p>This adapter enables Prisma to connect and interact with PostgreSQL efficiently.</p><h3><strong>4. Create Prisma Service (</strong>src/prisma/prisma.service.ts<strong>)</strong></h3><p>The Prisma service connects your <strong>NestJS application</strong> to the database and manages the lifecycle of the Prisma client.</p><p>This service initializes the Prisma client when the application starts and closes the connection when the application shuts down.</p><pre>// Import required decorators and interfaces from NestJS<br>import { Injectable, OnModuleInit, OnModuleDestroy } from &#39;@nestjs/common&#39;;<br><br>// Import the PrismaClient generated by Prisma<br>import { PrismaClient } from &#39;src/generated/prisma/client&#39;;<br><br>// Import Prisma PostgreSQL adapter<br>import { PrismaPg } from &#39;@prisma/adapter-pg&#39;;<br><br>// Mark this class as a provider so it can be injected into other services/controllers<br>@Injectable()<br><br>// PrismaService extends PrismaClient to access all Prisma database methods<br>// It also implements lifecycle hooks to manage database connection<br>export class PrismaService<br>  extends PrismaClient<br>  implements OnModuleInit, OnModuleDestroy<br>{<br>  <br>  // Constructor runs when the service is initialized<br>  constructor() {<br><br>    // Create PostgreSQL adapter using DATABASE_URL from .env<br>    // This adapter allows Prisma to connect to PostgreSQL using the pg driver<br>    const adapter = new PrismaPg({<br>      connectionString: process.env.DATABASE_URL,<br>    });<br><br>    // Call the PrismaClient constructor and pass the adapter configuration<br>    // This initializes Prisma with the PostgreSQL adapter<br>    super({ adapter });<br>  }<br><br>  // This lifecycle hook runs when the NestJS module is initialized<br>  async onModuleInit() {<br>    // Establish database connection when the application starts<br>    await this.$connect();<br>  }<br><br>  // This lifecycle hook runs when the NestJS application is shutting down<br>  async onModuleDestroy() {<br>    // Close the database connection gracefully<br>    await this.$disconnect();<br>  }<br>}</pre><h3>5. Create Prisma Module (src/prisma/prisma.module.ts)</h3><p>The Prisma module makes the Prisma service available throughout the entire application.</p><pre>// Import required decorators from NestJS<br>import { Global, Module } from &#39;@nestjs/common&#39;;<br><br>// Import the PrismaService that manages the Prisma database connection<br>import { PrismaService } from &#39;./prisma.service&#39;;<br><br>// @Global() makes this module available across the entire application<br>// without needing to import it in every module<br>@Global()<br><br>// Define a NestJS module<br>@Module({<br><br>  // providers are services that can be injected into other parts of the application<br>  // PrismaService is responsible for handling database interactions<br>  providers: [PrismaService],<br><br>  // exports allow other modules to use PrismaService<br>  // Since it is exported, any module can inject PrismaService<br>  exports: [PrismaService],<br>})<br><br>// PrismaModule groups and manages Prisma-related functionality<br>export class PrismaModule {}</pre><h3><strong>6. Create Authentication DTOs</strong></h3><p>DTOs (Data Transfer Objects) define the structure and validation rules for incoming request data.</p><p><strong>a. Register DTO (src/auth/dto/register.dto.ts)</strong></p><pre>import { IsEmail, IsString, MinLength } from &#39;class-validator&#39;;<br><br>export class RegisterDto {<br>  @IsString()<br>  name: string;<br><br>  @IsEmail()<br>  email: string;<br><br>  @IsString()<br>  @MinLength(6)<br>  password: string;<br>}</pre><p><strong>b. Login DTO </strong>(<strong>src/auth/dto/login.dto.ts</strong>)</p><pre>import { IsEmail, IsString } from &#39;class-validator&#39;;<br><br>export class LoginDto {<br>  @IsEmail()<br>  email: string;<br><br>  @IsString()<br>  password: string;<br>}</pre><h3><strong>7. Implement JWT Strategy (</strong>src/auth/strategies/jwt.strategy.ts)</h3><p>The JWT strategy validates incoming requests containing JWT tokens.</p><pre>// Import required decorators and classes from NestJS<br>import { Injectable, UnauthorizedException } from &#39;@nestjs/common&#39;;<br><br>// PassportStrategy is used to create a custom authentication strategy<br>import { PassportStrategy } from &#39;@nestjs/passport&#39;;<br><br>// ExtractJwt helps extract the JWT from the request, Strategy is the JWT authentication strategy<br>import { ExtractJwt, Strategy } from &#39;passport-jwt&#39;;<br><br>// ConfigService is used to read environment variables (like JWT_SECRET)<br>import { ConfigService } from &#39;@nestjs/config&#39;;<br><br>// UsersService is used to access user-related database operations<br>import { UsersService } from &#39;../../users/users.service&#39;;<br><br>// Marks this class as a provider so it can be injected into other parts of the application<br>@Injectable()<br><br>// JwtStrategy extends PassportStrategy and uses the JWT strategy<br>export class JwtStrategy extends PassportStrategy(Strategy) {<br><br>  // Inject UsersService and ConfigService into the constructor<br>  constructor(<br>    private usersService: UsersService, // Used to fetch user details from the database<br>    private configService: ConfigService, // Used to access environment configuration variables<br>  ) {<br><br>    // Call the parent constructor with JWT strategy configuration<br>    super({<br>      // Extract JWT from the Authorization header in the request<br>      // Example header: Authorization: Bearer &lt;token&gt;<br>      jwtFromRequest: ExtractJwt.fromAuthHeaderAsBearerToken(),<br><br>      // If false, expired tokens will automatically be rejected<br>      ignoreExpiration: false,<br><br>      // Secret key used to verify the JWT signature<br>      // It is taken from environment variables<br>      // If not found, it falls back to &#39;fallback-secret&#39;<br>      secretOrKey: configService.get&lt;string&gt;(&#39;JWT_SECRET&#39;) || &#39;fallback-secret&#39;,<br>    });<br>  }<br><br>  // This method runs after the JWT is successfully verified<br>  // The payload contains the data that was encoded when the token was created<br>  async validate(payload: { sub: number; email: string }) {<br><br>    // Find the user in the database using the user ID stored in the token<br>    const user = await this.usersService.findById(payload.sub);<br><br>    // If the user does not exist, throw UnauthorizedException<br>    // This prevents access even if the token is valid<br>    if (!user) throw new UnauthorizedException();<br><br>    // Return the user object<br>    // This user object will be attached to request.user in protected routes<br>    return user;<br>  }<br>}</pre><h3><strong>8. Create JWT Authentication Guard (</strong>src/auth/guards/jwt-auth.guard.ts<strong>)</strong></h3><p>The authentication guard protects routes by ensuring that only requests with valid JWT tokens can access them.</p><pre>import { Injectable } from &#39;@nestjs/common&#39;;<br>import { AuthGuard } from &#39;@nestjs/passport&#39;;<br><br>@Injectable()<br>export class JwtAuthGuard extends AuthGuard(&#39;jwt&#39;) {}</pre><h3><strong>9. Build the Authentication Service (</strong>src/auth/auth.service.ts<strong>)</strong></h3><p>The Auth Service handles the core authentication logic including:</p><blockquote><strong>User registration</strong></blockquote><blockquote><strong>Password hashing using bcryptjs.</strong></blockquote><blockquote><strong>Login verification</strong></blockquote><blockquote><strong>JWT token generation</strong></blockquote><pre>import {<br>  Injectable,<br>  ConflictException,<br>  UnauthorizedException,<br>} from &#39;@nestjs/common&#39;;<br>import { JwtService } from &#39;@nestjs/jwt&#39;;<br>import * as bcrypt from &#39;bcryptjs&#39;;<br>import { UsersService } from &#39;../users/users.service&#39;;<br>import { RegisterDto } from &#39;./dto/register.dto&#39;;<br>import { LoginDto } from &#39;./dto/login.dto&#39;;<br><br>@Injectable()<br>export class AuthService {<br>  constructor(<br>    private usersService: UsersService,<br>    private jwtService: JwtService,<br>  ) {}<br><br>  async register(dto: RegisterDto) {<br>    const existing = await this.usersService.findByEmail(dto.email);<br>    if (existing) throw new ConflictException(&#39;Email already in use&#39;);<br><br>    const hashed = await bcrypt.hash(dto.password, 10);<br>    const user = await this.usersService.create({<br>      name: dto.name,<br>      email: dto.email,<br>      password: hashed,<br>    });<br><br>    return this.signToken(user.id, user.email);<br>  }<br><br>  async login(dto: LoginDto) {<br>    const user = await this.usersService.findByEmail(dto.email);<br>    if (!user) throw new UnauthorizedException(&#39;Invalid credentials&#39;);<br><br>    const valid = await bcrypt.compare(dto.password, user.password);<br>    if (!valid) throw new UnauthorizedException(&#39;Invalid credentials&#39;);<br><br>    return this.signToken(user.id, user.email);<br>  }<br><br>  private signToken(userId: number, email: string) {<br>    const payload = { sub: userId, email };<br>    return {<br>      access_token: this.jwtService.sign(payload),<br>    };<br>  }<br>}</pre><p>It securely stores passwords and returns a signed JWT token after successful authentication.</p><h3><strong>10. Create Authentication Controller (</strong>src/auth/auth.controller.ts)</h3><p>The Auth Controller exposes API endpoints for authentication operations.</p><pre>import { Controller, Post, Body, Get, UseGuards, Req } from &#39;@nestjs/common&#39;;<br>import { AuthService } from &#39;./auth.service&#39;;<br>import { RegisterDto } from &#39;./dto/register.dto&#39;;<br>import { LoginDto } from &#39;./dto/login.dto&#39;;<br>import { JwtAuthGuard } from &#39;./guards/jwt-auth.guard&#39;;<br><br>@Controller(&#39;auth&#39;)<br>export class AuthController {<br>  constructor(private authService: AuthService) {}<br><br>  @Post(&#39;register&#39;)<br>  register(@Body() dto: RegisterDto) {<br>    return this.authService.register(dto);<br>  }<br><br>  @Post(&#39;login&#39;)<br>  login(@Body() dto: LoginDto) {<br>    return this.authService.login(dto);<br>  }<br><br>  @UseGuards(JwtAuthGuard)<br>  @Get(&#39;me&#39;)<br>  getMe(@Req() req: any) {<br>    return req.user;<br>  }<br>}</pre><h3><strong>11. Configure the Authentication Module (</strong>src/auth/auth.module.ts)</h3><pre>// Import Module decorator to define a NestJS module<br>import { Module } from &#39;@nestjs/common&#39;;<br><br>// JwtModule is used to generate and verify JWT tokens<br>import { JwtModule } from &#39;@nestjs/jwt&#39;;<br><br>// PassportModule integrates Passport authentication strategies into NestJS<br>import { PassportModule } from &#39;@nestjs/passport&#39;;<br><br>// ConfigModule and ConfigService allow access to environment variables<br>import { ConfigModule, ConfigService } from &#39;@nestjs/config&#39;;<br><br>// AuthService contains the business logic for authentication (login, token generation)<br>import { AuthService } from &#39;./auth.service&#39;;<br><br>// AuthController handles HTTP requests related to authentication<br>import { AuthController } from &#39;./auth.controller&#39;;<br><br>// JwtStrategy is the custom strategy used to validate JWT tokens<br>import { JwtStrategy } from &#39;./strategies/jwt.strategy&#39;;<br><br>// UsersModule is imported to access user-related services (like UsersService)<br>import { UsersModule } from &#39;../users/users.module&#39;;<br><br>@Module({<br>  imports: [<br>    // Import UsersModule so AuthService can access UsersService<br>    UsersModule,<br><br>    // Enables Passport authentication support in this module<br>    PassportModule,<br><br>    // Configure JWT module asynchronously using environment variables<br>    JwtModule.registerAsync({<br><br>      // Import ConfigModule so ConfigService can be used<br>      imports: [ConfigModule],<br><br>      // Inject ConfigService into the factory function<br>      inject: [ConfigService],<br><br>      // Factory function that returns JWT configuration<br>      useFactory: (configService: ConfigService) =&gt; ({<br>        <br>        // Secret key used to sign and verify JWT tokens<br>        // Retrieved from environment variable JWT_SECRET<br>        secret: configService.get&lt;string&gt;(&#39;JWT_SECRET&#39;),<br><br>        // Token expiration time (1 day)<br>        signOptions: { expiresIn: &#39;1d&#39; },<br>      }),<br>    }),<br>  ],<br><br>  // Providers are services or classes that can be injected elsewhere<br>  providers: [<br>    AuthService,  // Handles authentication logic<br>    JwtStrategy,  // JWT authentication strategy<br>  ],<br><br>  // Controllers define API endpoints for this module<br>  controllers: [<br>    AuthController,<br>  ],<br>})<br>export class AuthModule {}</pre><h3><strong>12. Create User Service ( </strong>src/users/users.service.ts)</h3><p>It interacts with the database using Prisma.</p><pre>import { Injectable } from &#39;@nestjs/common&#39;;<br>import { PrismaService } from &#39;../prisma/prisma.service&#39;;<br><br>@Injectable()<br>export class UsersService {<br>  constructor(private prisma: PrismaService) {}<br><br>//Find user by Email<br>  async findByEmail(email: string) {<br>    return this.prisma.user.findUnique({ where: { email } });<br>  }<br><br>//Find user by ID<br>  async findById(id: number) {<br>    return this.prisma.user.findUnique({<br>      where: { id },<br>      select: { id: true, name: true, email: true, createdAt: true },<br>    });<br>  }<br><br>//Create user<br>  async create(data: { name: string; email: string; password: string }) {<br>    return this.prisma.user.create({ data });<br>  }<br>}</pre><h3>13. Configure the Main Application Module (src/app.module.ts)</h3><p>The App Module loads all required modules for the application, including:</p><blockquote><strong>Configuration module</strong></blockquote><blockquote><strong>Prisma module</strong></blockquote><blockquote><strong>Authentication module</strong></blockquote><blockquote><strong>User module</strong></blockquote><pre>// Import Module decorator from NestJS to define a module<br>import { Module } from &#39;@nestjs/common&#39;;<br><br>// ConfigModule is used to load environment variables from .env file<br>import { ConfigModule } from &#39;@nestjs/config&#39;;<br><br>// PrismaModule handles database connection using Prisma ORM<br>import { PrismaModule } from &#39;./prisma/prisma.module&#39;;<br><br>// AuthModule manages authentication features (login, JWT token, guards)<br>import { AuthModule } from &#39;./auth/auth.module&#39;;<br><br>// UsersModule manages user-related operations (create user, find user, etc.)<br>import { UsersModule } from &#39;./users/users.module&#39;;<br><br>// AppController handles basic root API routes<br>import { AppController } from &#39;./app.controller&#39;;<br><br>// AppService contains business logic for the root controller<br>import { AppService } from &#39;./app.service&#39;;<br><br>@Module({<br>  imports: [<br>    // Load environment variables from .env file<br>    // isGlobal: true → makes ConfigService available across the whole application<br>    // envFilePath: &#39;.env&#39; → specifies the environment file location<br>    ConfigModule.forRoot({ isGlobal: true, envFilePath: &#39;.env&#39; }),<br><br>    // Import PrismaModule to make database service available globally<br>    PrismaModule,<br><br>    // Import AuthModule which handles authentication and JWT security<br>    AuthModule,<br><br>    // Import UsersModule which handles user management<br>    UsersModule,<br>  ],<br><br>  // Controllers define API endpoints<br>  controllers: [<br>    AppController,<br>  ],<br><br>  // Providers are services used for business logic<br>  providers: [<br>    AppService,<br>  ],<br>})<br>export class AppModule {}</pre><p><strong>Note: Install the configuration module.</strong></p><pre>npm install @nestjs/config</pre><h3><strong>14. Enable Global Validation (src/main.ts)</strong></h3><p>Enable request validation using NestJS’s ValidationPipe.</p><p>This automatically validates incoming request data based on DTO rules and removes unwanted fields from requests.</p><pre>import { NestFactory } from &#39;@nestjs/core&#39;;<br>import { AppModule } from &#39;./app.module&#39;;<br>import { ValidationPipe } from &#39;@nestjs/common&#39;;<br><br>async function bootstrap() {<br>  const app = await NestFactory.create(AppModule);<br>  app.useGlobalPipes(new ValidationPipe({ whitelist: true }));<br>  process.on(&#39;unhandledRejection&#39;, (reason) =&gt; {<br>    console.error(&#39;Unhandled Rejection:&#39;, reason);<br>  });<br>  await app.listen(3000);<br>}<br>bootstrap();</pre><p><strong>Note :</strong> If you make any changes to the schema.prisma model, you need to reset and migrate the database again.</p><pre>npx prisma migrate reset - force</pre><p>This command <strong>deletes the existing database</strong> schema and <strong>recreates it</strong> using the latest migrations.</p><h3><strong>Testing APIs Using Postman</strong></h3><p><strong>a. Register User API</strong></p><p>POST: <a href="http://localhost:3000/auth/register"><em>http://localhost:3000/auth/register</em></a></p><pre>{<br>  &quot;name&quot;: &quot;Ujanth&quot;,<br>  &quot;email&quot;: &quot;ujanth@gmail.com&quot;,<br>  &quot;password&quot;: &quot;123456&quot;<br>}<br><br>//Expecting output : &quot;access_token&quot;: &quot;your_generated_jwt_token&quot;</pre><p><strong>b. Login User API</strong></p><p>POST: <a href="http://localhost:3000/auth/login"><em>http://localhost:3000/auth/login</em></a></p><pre>{<br>  &quot;email&quot;: &quot;ujanth@gmail.com&quot;,<br>  &quot;password&quot;: &quot;123456&quot;<br>}<br><br>//Expecting output : Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...</pre><p><strong>c. Get Authenticated User</strong></p><p>GET: <a href="http://localhost:3000/auth/me"><em>http://localhost:3000/auth/me</em></a></p><pre>//Expecting output<br>{<br>  &quot;id&quot;: 1,<br>  &quot;name&quot;: &quot;john&quot;,<br>  &quot;email&quot;: &quot;john@example.com&quot;,<br>  &quot;createdAt&quot;: &quot;2026-03-16T10:00:00.000Z&quot;<br>}</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a04bd1319fad" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HOW TO CREATE A NEW AWS ACCOUNT ?]]></title>
            <link>https://medium.com/@ujanth1998/how-to-create-a-new-aws-account-ce76948143e0?source=rss-4cd3e4b24004------2</link>
            <guid isPermaLink="false">https://medium.com/p/ce76948143e0</guid>
            <dc:creator><![CDATA[Dalaxshan Makenthiran]]></dc:creator>
            <pubDate>Fri, 21 Feb 2025 18:08:49 GMT</pubDate>
            <atom:updated>2025-02-21T18:08:49.459Z</atom:updated>
            <content:encoded><![CDATA[<h3>HOW TO CREATE A NEW AWS ACCOUNT ?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/851/1*fNM_aFoU79-gs8alxSL18w.png" /></figure><p>Step 1 : Go to the <a href="https://aws.amazon.com/"><em>AWS Sign-Up Page</em></a> and click <strong>“Create an AWS Account.”</strong></p><p>Step 2 :Enter your <strong>email address</strong> (root user), choose an <strong>AWS account name</strong>, and click <strong>“Verify email.”</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RcjGir7YVWLDNnGFXReclQ.png" /></figure><p>Step 3 : Set a <strong>strong password</strong> for your root user account.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RSOKrR1X6l38vMMXv9qaGA.png" /></figure><p>Step 4 : Provide your <strong>contact details</strong>, including full name, company name (if applicable), and address.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D53NxVLc2oa6gWF6tnWhxA.png" /></figure><p>Step 5 : Enter your <strong>billing details</strong>, including a valid credit or debit card.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iWWzcLih7Ajh53e0-nSpuA.png" /></figure><p>Step 6 : Add your <strong>mobile number</strong>, enter the received <strong>verification code</strong>, and complete identity verification.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BrJNdJryXyC4qdPrdSI-Ng.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JeibCazmLBBF2QhPGqieBg.png" /></figure><p>Step 7 : Choose a <strong>support plan</strong> (Basic Free, Developer, or Business Support).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I-_s6fLwSAo2Q_SugRS4ZA.png" /></figure><p>Step 8 : Verify your <strong>credit/debit card information</strong> (AWS may place a <strong>temporary $1 authorization hold</strong> for verification).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Tft4N9JvzE0IEBTVKA0BDQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OzSF3liAWGk33Mmspq_IHw.png" /></figure><p>Step 9 : Once completed, AWS will set up your account, and you can access the <strong>AWS Management Console</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A8GyEOPBEFlMD76c9JLyXw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ce76948143e0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CREATE WORDPRESS WEBSITE IN SUBDOMAIN USING HOSTINGER & CLOUDFLARE]]></title>
            <link>https://medium.com/@ujanth1998/create-wordpress-website-in-subdomain-using-hostinger-cloudflare-a2c61aacb525?source=rss-4cd3e4b24004------2</link>
            <guid isPermaLink="false">https://medium.com/p/a2c61aacb525</guid>
            <dc:creator><![CDATA[Dalaxshan Makenthiran]]></dc:creator>
            <pubDate>Mon, 17 Feb 2025 19:58:06 GMT</pubDate>
            <atom:updated>2025-02-17T19:58:06.196Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qhIHd_ESAkZdAPepPkBMuA.png" /></figure><p>Step 1 : Log in your Hostinger account.(<a href="https://auth.hostinger.com/login"><em>Link</em></a>)</p><p>Step 2: Select your primary domain.(domain.com)</p><p>Step 3 : Navigate your subdomain. (Main menu &gt; websites &gt; main domain &gt; Domains &gt; subdomains)</p><p>Step 4 : Create preferred subdomain. (technox.domain.com)and create subfolder(technox).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qMH9_We4Jax4GykgfG9_XQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1009/1*7T-6PTgycTUxitR5-FVW2w.png" /></figure><p>Step 5: Verify the Subdomain Folder in File Manager (Main menu &gt; websites &gt; main domain &gt; Files &gt; File manager)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5ZjJOEMIKHrpcZnvz68JSA.png" /></figure><p>Step 6: Install new WordPress website. (Main menu &gt; websites &gt; main domain &gt; WordPress &gt; overview)</p><p>Step 7 : Fill below details</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/726/1*vbvPJywqlq5gx5pw7A_PTw.png" /></figure><p>a. Website credential : Website title, administrator email, username, and password (This username and password using to login to the WordPress admin dashboard).</p><p>b. Advanced : select your subdomain installation path.(technox.domain.com)</p><p>Step 8 : Now the WordPress has installed.</p><p>Step 9 : Login to the Cloudflare account. (<a href="https://dash.cloudflare.com/login"><em>Link</em></a>)</p><p>Step 10 : Go to account home and select the main domain. (domain.com)</p><p>Step 11 : Add a New A Record for the Subdomain</p><ol><li>Navigate to <strong>DNS</strong> settings.</li></ol><p>2. Click <strong>Add Record</strong> and fill in the following details:</p><ul><li><strong>Type</strong>: A</li><li><strong>Name</strong>: technox (your subdomain)</li><li><strong>IPv4 Address</strong>: X.X.X.X (Hostinger IP or your server IP)</li><li><strong>Proxy Status</strong>: <strong>Enable</strong> (Orange cloud) for Cloudflare protection</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*trnDxzWXR-ONA3WNekK-rg.png" /></figure><p>3. Click <strong>Save</strong> or <strong>Add Record</strong>.</p><p>Step 12 : Verify Your Subdomain in a Browser. If the WordPress installation was successful, the default WordPress welcome page should load.</p><p>Step 14 : Access the WordPress Admin Dashboard (https://technox.domain.com/wp-admin)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xtSvEQQexzPJDPZ2z3UmmA.png" /></figure><p>Enter the <strong>username and password</strong> you set during installation.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a2c61aacb525" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Configure AWS EC2 Public IP in Cloudflare Name Server ?]]></title>
            <link>https://medium.com/@ujanth1998/how-to-configure-aws-ec2-public-ip-in-cloudflare-name-server-13134b9c6699?source=rss-4cd3e4b24004------2</link>
            <guid isPermaLink="false">https://medium.com/p/13134b9c6699</guid>
            <dc:creator><![CDATA[Dalaxshan Makenthiran]]></dc:creator>
            <pubDate>Sun, 16 Feb 2025 15:28:32 GMT</pubDate>
            <atom:updated>2025-02-16T15:39:51.874Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>How to Integrate AWS EC2 Public IP in Cloudflare Name Server ?</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*niFG2yZPtRMnrTOw4MC1jw.png" /></figure><p><strong>Step 1: Log in to AWS and Access the EC2 Instance</strong></p><ul><li>Visit the <a href="https://aws.amazon.com/console/"><em>AWS Management Console</em></a>.</li><li>Navigate to <strong>EC2 Dashboard</strong> and select the instance you want to configure.</li></ul><p><strong>Step 2: Locate the EC2 Public IP Address</strong></p><ul><li>In the instance details, look for the <strong>Public IPv4 address</strong> under the instance’s description.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/847/1*UaE0C06vdpggeBpIDvNLng.png" /></figure><p><strong>Step 3: Access Cloudflare DNS Records</strong></p><ul><li>Go to <a href="https://www.cloudflare.com/"><em>Cloudflare Dashboard</em></a> and log in to your account.</li><li>Select the domain you wish to configure.</li></ul><p><strong>Step 4: Create a New A Record</strong></p><ol><li>In the <strong>DNS</strong> settings, click <strong>Add Record</strong>.</li><li>Enter the following details:</li></ol><ul><li><strong>Type:</strong> A</li><li><strong>Name:</strong> Enter your domain name (e.g., websitename.com).<br> If you want to configure a subdomain (like <a href="http://www.websitename.com),/">www.websitename.com),</a> enter that instead.</li><li><strong>IPv4 Address:</strong> Enter the EC2 public IPv4 address (e.g., 122.11.x.x).</li><li><strong>Proxy Status:</strong> Enable it (Orange cloud) to route traffic through Cloudflare for better security and performance.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/842/1*A4A_kFiqoFIvO6fwnN95Mg.png" /></figure><p>3. Click <strong>Save</strong>.</p><p><strong>Step 5: Allow Propagation Time</strong></p><ul><li>DNS changes may take a few minutes to a few hours to propagate fully. You can monitor propagation using online tools like <a href="https://www.whatsmydns.net/"><em>WhatsMyDNS</em></a><em>.</em></li></ul><p><strong>Step 6: Verify the Configuration</strong></p><ul><li>Open your browser and navigate to your website at <a href="https://websitename.com./">https://websitename.com.</a></li><li>Ensure the website loads correctly.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=13134b9c6699" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>