<?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"><channel><title><![CDATA[Stari's blog]]></title><description><![CDATA[Hey! I am Gergo, a CS Student and a Frontend Engineer from Budapest, Hungary. I am writing about everything that excites me in the world of Frontend, AI, Career]]></description><link>https://blog.staridev.hu</link><generator>RSS for Node</generator><lastBuildDate>Fri, 08 May 2026 11:59:24 GMT</lastBuildDate><atom:link href="https://blog.staridev.hu/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[[How To] Authentication with IdentityServer4 and NextAuth v4 (Next.js App Router)]]></title><description><![CDATA[Introduction
I recently worked on a project where I was responsible for the entire frontend, and authentication was handled through IdentityServer4. Initially, it was quite challenging because I had never integrated IdentityServer4 with the Next.js A...]]></description><link>https://blog.staridev.hu/how-to-authentication-with-identityserver4-and-nextauth-v4-nextjs-app-router</link><guid isPermaLink="true">https://blog.staridev.hu/how-to-authentication-with-identityserver4-and-nextauth-v4-nextjs-app-router</guid><category><![CDATA[Next.js]]></category><category><![CDATA[nextauth.js]]></category><category><![CDATA[IdentityServer4]]></category><category><![CDATA[authentication]]></category><dc:creator><![CDATA[Gergo Starosta]]></dc:creator><pubDate>Thu, 17 Oct 2024 17:25:50 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1729090868875/7e740c6b-295f-444d-9af0-836cafc77d8e.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1 id="heading-introduction">Introduction</h1>
<p>I recently worked on a project where I was responsible for the entire frontend, and authentication was handled through IdentityServer4. Initially, it was quite challenging because I had never integrated IdentityServer4 with the Next.js App Router before. In the past, I had used Next-Auth for a few projects with OAuth integrations (such as GitHub, Google, and credentials), and it worked well. Fortunately, Next-Auth also provides support for IdentityServer4 through a dedicated provider.</p>
<p>During the process of setting up authentication, I encountered several problems and issues. Finding up-to-date resources was difficult, and most blog posts only covered parts of the solution, with some information being inaccurate.</p>
<p>If you’re in a similar situation and want to learn how to seamlessly integrate authentication between the Next.js App Router and IdentityServer4, this guide is for you.</p>
<h1 id="heading-prerequisites">Prerequisites</h1>
<h2 id="heading-nextjs">Next.js</h2>
<p>We will need a project with the version of Next 13.2 or above.</p>
<p>This is because Vercel introduced the App Router in Next 13. I was using Next 14 throughout the project, but it doesn't really matter. If you are new to Next 14 (latest stable version) I recommend checking one of my <a target="_blank" href="https://blog.staridev.hu/how-to-authentication-with-identityserver4-and-nextauth-v4-nextjs-app-router">previous blog post</a>, where I go through the features that Next 14 introduced.</p>
<h2 id="heading-identityserver4">IdentityServer4</h2>
<p>IdentityServer is an authentication server that implements OpenID Connect (OIDC) and OAuth 2.0 standards for <a target="_blank" href="http://ASP.NET">ASP.NET</a> Core.</p>
<p>Our company had developed our own IdentityServer in the past couple of years, and many projects of ours still uses it. So for us, it was an easy choice as our backends are mainly written in .NET.</p>
<div data-node-type="callout">
<div data-node-type="callout-emoji">💡</div>
<div data-node-type="callout-text">IdentityServer4 has been deprecated and is superceded by Duende IdentityServer6.</div>
</div>

<h1 id="heading-setup-the-environment-variables">Setup the environment variables</h1>
<p>Just grab any existing Next project or create a new with:</p>
<pre><code class="lang-bash">npx create-next-app@latest
</code></pre>
<p>To make things work, we have to define our environment variables, without exposing them. Exactly for this purposes we need to create a <code>.env.local</code> file (if you want, you can use a .env file, note that in Next the <code>.env.local</code> will override the contents of the .env file). Both files should be in the root of your project at the same level as <code>app/</code></p>
<p>These variables will hold the values of information that is needed to connect to the IdentityServer.</p>
<pre><code class="lang-javascript">.env.local

NEXTAUTH_URL = <span class="hljs-string">"https://localhost:3000/api/auth"</span>
IdentityServer4_CLIENT_ID = <span class="hljs-string">"your_client_id"</span>
IdentityServer4_CLIENT_SECRET = <span class="hljs-string">"your_client_secret"</span>
IdentityServer4_ISSUER = <span class="hljs-string">"your_identity_server_issuer"</span>
IdentityServer4_SCOPE = <span class="hljs-string">"your_identity_server_scopes"</span>
NEXTAUTH_SECRET =<span class="hljs-string">"your_unique_secret"</span>
</code></pre>
<p>Let's talk through all of these.</p>
<p>First you have to define the <code>NEXT_AUTH_URL.</code> This will point next-auth where it should listen for every request (signin, signout etc.). The mentioned value is default and probably will work just fine for you.</p>
<div data-node-type="callout">
<div data-node-type="callout-emoji">📢</div>
<div data-node-type="callout-text">As you can see I wrote <code>https://</code> instead of <code>http://</code> although it is used in Next as default to expose your app. We will get back to this later</div>
</div>

<p>The following four variables should reflect your settings in your IdentityServer4. These will tell next-auth where to go, and will help you authenticate to the IdentityServer. These variables can be set at the dashboard or directly in the database of your IdentityServer. This step depends on the service's provider, so it may vary. In our case we had to run a few scripts, to populate the database with the correct data. This step is crucial, if there is a mismatch between the server and client config, the connection will not build out.</p>
<p>When setting up your IdentityServer, make sure that the callback/redirect URL is <code>https://example.com/api/auth/callback/identity-server4</code></p>
<p>The last thing we have to define is the <code>NEXT_AUTH_SECRET.</code> This random value will help next-auth to encrypt tokens during the authentication process. You can use any online tool to generate this, or the following command line command:</p>
<pre><code class="lang-plaintext">openssl rand -base64 32
</code></pre>
<h1 id="heading-changes-to-the-packagejson">Changes to the package.json</h1>
<p>IdentityServer4 requires every request to use SSL, so instead of the default <code>http://</code> we need to expose our app as <code>https://</code>.</p>
<p>It can happen, that you can communicate with your IdentityServer using simple http, but it is not recommended for production environments. Without https you may run into the following error:</p>
<pre><code class="lang-plaintext">localhost sent an invalid response.
ERR_SSL_PROTOCOL_ERROR
</code></pre>
<p>To use https in our Next project, we have to modify one line at the scripts section in the <code>package.json</code> file:</p>
<pre><code class="lang-plaintext">package.json

"scripts": {
    - "dev": "next dev",
    + "dev": "next dev --experimental-https",
    "build": "next build",
    "start": "next start",
    "lint": "next lint"
  },
</code></pre>
<p>With this flag, we can run our app at <code>https://localhost:3000</code>. As you can see, this is still experimental and Next.js will warn you after every <code>npm run dev</code> with the following:</p>
<pre><code class="lang-plaintext">Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification.
</code></pre>
<p>You can read more about this here: <a target="_blank" href="https://vercel.com/guides/access-nextjs-localhost-https-certificate-self-signed">https://vercel.com/guides/access-nextjs-localhost-https-certificate-self-signed</a></p>
<p>This small change will solve the problem and raise a new one, but no worries, we will fix it in a minute.</p>
<h1 id="heading-self-signing-certificates">Self-signing certificates</h1>
<p>We just setup our project to use <code>https</code>, instead of <code>http</code>, but by doing so we may face a new error:</p>
<pre><code class="lang-plaintext">https://next-auth.js.org/errors#signin_oauth_error self-signed certificate {
  error: {
    message: 'self-signed certificate',
    stack: 'Error: self-signed certificate\n' +
      '    at TLSSocket.onConnectSecure (node:_tls_wrap:1685:34)\n' +
      '    at TLSSocket.emit (node:events:519:28)\n' +
      '    at TLSSocket._finishInit (node:_tls_wrap:1085:8)\n' +
      '    at ssl.onhandshakedone (node:_tls_wrap:871:12)\n' +
      '    at TLSWrap.callbackTrampoline (node:internal/async_hooks:130:17)',
    name: 'Error'
  },
  providerId: 'identity-server4',
  message: 'self-signed certificate'
}
</code></pre>
<p>This is because our certificate is self-signed. After running the modified <code>npm run dev</code> script, you may notice that a new folder is created in the root of the project called <code>certificates.</code> This folder will contain the <code>localhost-key.pem</code> and <code>localhost.pem</code> files. These keys are automatically generated Next.js and will be used in local development.</p>
<p>To surpess this error in development, we need to add one more line to our freshly created <code>.env.local</code> file:</p>
<pre><code class="lang-plaintext">.env.local

NEXTAUTH_URL = https://localhost:3000/api/auth
IdentityServer4_CLIENT_ID = your_identity_server_client_id
IdentityServer4_CLIENT_SECRET = your_identity_server_client_secret
IdentityServer4_ISSUER = your_identity_server_issuer
IdentityServer4_SCOPE = "your_identity_server_scopes"
NEXTAUTH_SECRET ="your_unique_secret"

+ NODE_TLS_REJECT_UNAUTHORIZED = 0
</code></pre>
<p>In production if you are using Vercel or any other hosting service, they will handle the signing for you automatically. Self-signing certificates is not recommended in production, it leaves you with many security vulnerabilities.</p>
<h1 id="heading-lets-setup-next-auth">Let's setup next-auth</h1>
<p>NextAuth is an open-source library for implementing authentication in Next.js projects. They provide easy to setup solutions for integrating the credentials provider (email + password) and OAuth. They have gone through a small "rebranding" and restructuring, so next-auth v5 is now called Auth.js. We will use next-auth, version 4 to be precise.</p>
<p>The NextAuth documentation can be found here: <a target="_blank" href="https://next-auth.js.org/">https://next-auth.js.org/</a>. While the new Auth.js docs are here: <a target="_blank" href="https://authjs.dev/">https://authjs.dev/</a>.</p>
<p>To setup next-auth, first we need to download the required dependencies. Just run the following command in your terminal:</p>
<pre><code class="lang-plaintext">npm install next-auth
</code></pre>
<p>The next step is to integrate the <code>SessionProvider</code> so we can use the things NextAuth provides throughout the app.</p>
<p>When using the app router in Next, there is a <code>app/layout.tsx</code> file that defines the <code>RootLayout</code> of the project. This is a server-component, therefore we can't use the provided <code>SessionProvider</code> here directly, because it uses <code>React.Context</code> under the hood.</p>
<p>Because of how Server Components work, we can nest Client Components in them, but not the other way around.</p>
<div data-node-type="callout">
<div data-node-type="callout-emoji">📢</div>
<div data-node-type="callout-text">If this Server / Client component thing is all new to you, I highly recommend you to check out this video: <a target="_blank" href="https://youtu.be/VIwWgV3Lc6s?si=2T8E7R1aHM5aad9h">https://youtu.be/VIwWgV3Lc6s?si=2T8E7R1aHM5aad9h</a> by Theo - t3.gg. He will explain everything you need to know.</div>
</div>

<p>So in order to use the <code>SessionProvider</code>, we have to create a custom provider, which is a Client component. You can create this file anywhere you want, the personal preference of mine is to put these type of things in the <code>lib</code> folder, in the root of the project.</p>
<pre><code class="lang-plaintext">lib/Providers.tsx

'use client';

import { ReactNode } from 'react';
import { SessionProvider } from 'next-auth/react';


export default function NextAuthProvider({
    children,
}: {
    children: ReactNode;
}) {
    return (
        &lt;SessionProvider&gt;
            {children}
        &lt;/SessionProvider&gt;
    );
}
</code></pre>
<p>This won't do much, just wrap the NextAuth <code>SessionProvider</code> in a new client component.</p>
<p>Now we can use this in our <code>RootLayout</code>:</p>
<pre><code class="lang-plaintext">app/layout.tsx


import "./globals.css";
import type { Metadata } from "next";
+ import NextAuthProvider from "@/lib/Providers";

export const metadata: Metadata = {
  title: "How to setup IdentityServer4 with Next app router using next-auth",
  description: "If this blog post was helpful, please leave a like.",
};

export default async function RootLayout({
  children,
}: Readonly&lt;{
  children: React.ReactNode;
}&gt;) {

  return (
    &lt;html lang="en"&gt;
      &lt;body&gt;
        + &lt;NextAuthProvider&gt;
            {children}
        + &lt;/NextAuthProvider&gt;
      &lt;/body&gt;
    &lt;/html&gt;
  );
}
</code></pre>
<p>By doing this, we will access every feature of <code>next-auth</code> in every segment of our app. Obviously this file may vary and have more content, I just cleared it for simplicity.</p>
<hr />
<p>Next we can define our auth configurations. To do that, create a file to store the config. I named it <code>authOptions.ts</code> and put it in the <code>lib/</code> folder. (You can name and put this file anywhere you want, it is up to you)</p>
<pre><code class="lang-plaintext">lib/authOptions.ts


import IdentityServer4Provider from 'next-auth/providers/identity-server4';
import { NextAuthOptions } from 'next-auth';

export const authOptions: NextAuthOptions = {

  secret: process.env.NEXTAUTH_SECRET,
  providers: [
    IdentityServer4Provider({
      id: 'identity-server4', // keep it as is, not placeholder value
      name: 'IdentityServer4', // keep it as is, not placeholder value
      issuer: process.env.IdentityServer4_ISSUER,
      clientId: process.env.IdentityServer4_CLIENT_ID,
      clientSecret: process.env.IdentityServer4_CLIENT_SECRET,
      authorization: { params: { scope: process.env.IdentityServer4_SCOPE } },
      wellKnown: `${process.env.IdentityServer4_ISSUER}/.well-known/openid-configuration`,
    }),
  ],

  callbacks: {
  // You can modify any callback of next-auth here, like jwt, session etc..
  },

  pages: {
    signIn: '/login',
  },
  session: { strategy: 'jwt' },
};
</code></pre>
<p>Basically we give the information that is needed to connect to the IdentityServer as parameters.</p>
<p>NextAuth should recognize and find the <code>wellKnown</code> (aka. discovery document), but for some reason it didn’t work for me, so provided it manually.</p>
<p>In the providers array, we can define many different providers such as Apple, Twitter and so on. We will only setup IdentityServer4 here. To learn more about the different providers, visit <a target="_blank" href="https://next-auth.js.org/providers/">https://next-auth.js.org/providers/</a>.</p>
<p>In the callback object you can override built-in callbacks such as <code>jwt</code>, <code>session</code> etc.. This is quite helpful if we want to destructure or modify the values stored in them. To learn more about callbacks visit <a target="_blank" href="https://next-auth.js.org/configuration/callbacks">https://next-auth.js.org/configuration/callbacks</a>.</p>
<p>Also we add the secret, the session strategy and the signin page's route. More on that later.</p>
<p>The last thing we have to do is to create a <code>route.ts</code> file in the <code>app/api/auth/[...nextauth]</code> folder. This is crucial, following this is mandatory.</p>
<pre><code class="lang-plaintext">app/api/auth/[...nextauth]/route.ts


import NextAuth from 'next-auth';  
import { authOptions } from '@/lib/authOptions';  

const handler = NextAuth(authOptions);  
export { handler as GET, handler as POST };
</code></pre>
<p>There is not much happening here, we expose the Route handler with the configuration we previously created. All requests to <code>/api/auth/*</code> (<code>signIn</code>, <code>callback</code>, <code>signOut</code>, etc.) will automatically be handled by NextAuth.js.</p>
<hr />
<p>And now the setup of <code>next-auth</code> is done. But to try it out and create a "prod-like" experience we will do the following:</p>
<ul>
<li><p>We will create a login page. This is not rocket science, just let the user arrive at the gate of the app. There will be only one button here, that will fire the sign-in and if the IdentityServer4 is setup well, this will redirect the user there.</p>
</li>
<li><p>We will create a sign-out button.</p>
</li>
<li><p>We will create a middleware, to make the whole experience smooth and robust.</p>
<ul>
<li><p>If the user is not authenticated, can not access any route in the app except <code>/login</code>.</p>
</li>
<li><p>If the user is authenticated by the IdentityServer, we will open the gates and the user can access the app.</p>
</li>
<li><p>While being signed in, the user can’t go back to the login page.</p>
</li>
<li><p>If there is a sign out, we will redirect the user to the login page.</p>
</li>
</ul>
</li>
</ul>
<p>Enough talking, get back to code.</p>
<h1 id="heading-creating-a-production-like-experience">Creating a production like experience</h1>
<p>To achieve the previously described functionality, first we have to code our login page. We can do this by creating a new folder in the <code>app/</code> directory called <code>login</code>. In this folder create the following <code>page.tsx</code>:</p>
<pre><code class="lang-plaintext">app/login/page.tsx


import { getServerSession } from 'next-auth/next'
import { redirect } from 'next/navigation'
import { authOptions } from '@/lib/authOptions'

export default async function LoginPage() {

    const session = await getServerSession(authOptions)

    if (session) {
        redirect('/')  
    }

    return (
        &lt;div className="w-full h-full flex items-center justify-center"&gt;
           &lt;LoginButton /&gt;
        &lt;/div&gt;
    )
}
</code></pre>
<p>The first impression of you could be that this design is dog-water, and you are right. I just try to get rid of every single distraction and keep it simple.</p>
<p>In this file we get the session with the <code>getServerSession</code> function. But why Server session? Great question! You may noticed that this page is an <code>async</code> function. We can only define <code>async</code> functional components if we are in a Server Component. In Next app router, by default every component is a server component, so we don't have to write use <code>"use server";</code> at the top of the file. Until we want to add interactivity to a component, we can keep it as <code>"use server";</code> If we want to add interactivity (buttons for example) we need to switch to the <code>"use client";</code> directive manually, otherwise we will run into an error.</p>
<p>Back to the explanation. We need to pass the auth options to the <code>getServerSession</code> function and if the user is authenticated (it is a not null nor an empty session) we will redirect the user to the app.</p>
<p>This page will have only one button, but to get the session on the server and have the interactivity of a button, we have to create a new Client component, called <code>LoginButton.tsx</code>:</p>
<pre><code class="lang-plaintext">components/LoginButton.tsx


'use client' // we have interactivity (the user can click the button)

import { signIn } from 'next-auth/react'


export default function LoginButton() {

    return (
        &lt;button onClick={() =&gt; signIn('identity-server4')}&gt;
            Sign in with IdentityServer4
        &lt;/button&gt;
    )
}
</code></pre>
<div data-node-type="callout">
<div data-node-type="callout-emoji">💡</div>
<div data-node-type="callout-text">It is a good practice to keep as much as we can on the server side of our authentication flow, simply because of security purposes. This is why we outsource the LoginButton to a new file, although the component is small and doesn't do a lot.</div>
</div>

<p>With this button placed in the Login page, we are almost there. Please style all the pages and components, it breaks my heart to not style all these things here.</p>
<p>Next up is to create our middleware to handle the redirection of users depending on there sessions existence. With a middleware we can protect our app from unauthenticated users. Create a <code>middleware.ts</code> file in the root of your project:</p>
<pre><code class="lang-plaintext">middleware.ts

import { withAuth } from 'next-auth/middleware'
import { NextResponse } from 'next/server'


export default withAuth(
 function middleware(req) {

    const isAuth = !!req.nextauth.token
    const isAuthPage = req.nextUrl.pathname.startsWith('/login')

    if (isAuthPage) {
      if (isAuth) {
        return NextResponse.redirect(new URL('/', req.url))
      }

      return null
    }

    if (!isAuth) {
      return NextResponse.redirect(new URL('/login', req.url))
    }
  },
  {
    callbacks: {
      authorized: () =&gt; true
    },
  }
)

export const config = {
  matcher: ['/((?!api|_next/static|_next/image|favicon.ico).*)'],
}
</code></pre>
<p>This middleware uses the provided <code>next-auth</code> <code>withAuth</code> middleware. If the user in on the <code>/login</code> page and authenticated, we will redirect to <code>/</code>. If the user is not authenticated, we will redirect to the <code>/login</code> page. By doing this, unauthenticated users won't be able to access the app.</p>
<p>One thing that was a bit odd when I first used a middleware, was the matcher. The middleware will run on every single route by default, but we can exclude routes using the matcher attribute in the config object. We will be just fine with this matcher for now (and for most Next.js projects), you can read more about the <code>withAuth</code> middleware here: <a target="_blank" href="https://next-auth.js.org/configuration/nextjs#middleware">https://next-auth.js.org/configuration/nextjs#middleware</a>.</p>
<p>The last thing we need to do, is to create a sign out button. Good news is that, this will be the easiest part of the whole setup. All we need is to create a simple <code>handleSignOut</code> function and call it on any buttons <code>onClick</code> event. Something like this:</p>
<pre><code class="lang-plaintext">'use client';

const YourComponent = () =&gt; {

  const handleSignOut = async () =&gt; {
    await signOut({ redirect: false });
    router.push('/login');
  };

  return (
      ...
     &lt;button onClick={handleSignOut}&gt;Log out&lt;/button&gt;
     ...
  );

}
</code></pre>
<p>Aaand that's it. 🎉 We are done configuring authentication using Next.js (next-auth) and IdentityServer4.</p>
<h1 id="heading-call-to-action">Call to action</h1>
<p>Thank you for reading all the way down here! If you have any questions or found a bug, please feel free to reach out at any given platform.</p>
<p>If you found this post helpful, please consider a like and/or a follow.</p>
<p>Cheers! 👋👋</p>
]]></content:encoded></item><item><title><![CDATA[A Frontend Intern's Diary: First 9 Months in Tech]]></title><description><![CDATA[As 2023 came to an end, I took a moment to reflect on the most significant change in my life this year: starting my career as a Frontend Developer. Landing what I consider the coolest job has been an adventure, complete with rays of imposter syndrome...]]></description><link>https://blog.staridev.hu/a-frontend-interns-diary-first-9-months-in-tech</link><guid isPermaLink="true">https://blog.staridev.hu/a-frontend-interns-diary-first-9-months-in-tech</guid><category><![CDATA[jobsearch]]></category><category><![CDATA[Career]]></category><category><![CDATA[Beginner Developers]]></category><category><![CDATA[Frontend Development]]></category><category><![CDATA[newbie]]></category><category><![CDATA[Junior developer ]]></category><category><![CDATA[career advice]]></category><category><![CDATA[frontend]]></category><dc:creator><![CDATA[Gergo Starosta]]></dc:creator><pubDate>Sat, 30 Dec 2023 15:26:16 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1703701952953/732fb567-7656-4301-b3c9-47e01bee8749.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>As 2023 came to an end, I took a moment to reflect on the most significant change in my life this year: starting my career as a Frontend Developer. Landing what I consider the coolest job has been an adventure, complete with rays of imposter syndrome—a common experience as we all strive to learn quickly and prove ourselves. Whether you're in the midst of your first job hunt, eyeing an internship, or just starting out and struggling with the new challenges, you're in the right place!</p>
<p>I hope this blog will guide you through a possible path in this field and help alleviate some of the anxiety by sharing the lessons I've learned. Let's dive in!</p>
<h2 id="heading-my-situation">My situation</h2>
<p>The term intern means someone in the industry who is still in his university / college studies, but wants to step into the market. Despite how things go in other countries, in Hungary there are no 3-6-12 months long internships, most jobs have indefinite time-frames, although usually there is a trial period.</p>
<p>One pivotal step in my job search was joining my university's student cooperative. They were instrumental in crafting my CV and connecting me with companies offering exciting job opportunities. The major advantage of these cooperatives is their extensive network with companies, enabling them to match your skills and aspirations with the right employers. If you have the chance to join one, don’t hesitate – it’s a decision you won’t regret.</p>
<h2 id="heading-its-okay-to-get-rejected">It's okay to get rejected</h2>
<p>In my job hunt, I applied to around 20 positions, receiving responses from only nine. Out of these, I faced five rejections, and four progressed to interviews, with only one leading to an offer.</p>
<p>The key lesson? Don't get overly excited or disheartened by non-responses or rejections. It's a natural part of the journey. Each application is a learning opportunity – refine your CV, enhance your LinkedIn presence, and work on projects that can boost your resume. With your new experiences you will have a better chance. Repeat these things and you will land your first job.</p>
<p>Remember, as a student, your experience may be limited. Employers take a risk in hiring you, but they also invest in your potential. Stand out by showcasing unique skills. In my case, it was a keen interest in UI design. I've had only one website in my portfolio (if I can even call it a portfolio😅), but I worked on many designs and got really familiar with Figma and design principles. Don't get me wrong, you don't have to be a good designer, you can have a thinking of a Business Analyst or have amazing coding knowledge, maybe you understand databases better than others. Find your thing and highlight it.</p>
<h2 id="heading-the-interview-process">The interview process</h2>
<p>Most interviews begin with a brief 15-20 minute phone call with an HR representative, screening for basic fit. Be prepared to discuss your interests, academic program, career aspirations, and your journey into IT. Just be honest, and I promise nothing will go wrong.</p>
<p>After this initial call, you'll likely schedule a more in-depth interview with a team member, often a technical lead or potential supervisor. This is your chance to shine, discussing university and personal projects. Be ready to address questions on your communication skills and problem-solving abilities.</p>
<p>The following interview stages vary by company. You might engage in language tests or problem-solving exercises. Remember, interviewers are not your enemies; they're assessing your potential as a team member. One unique technical assessment I faced involved a take-home task in React. My advice: Don’t hesitate to request more time if needed, especially for challenging tasks. It’s about accuracy in estimation and delivering the best solution. Approach the task as if you were already part of the team – ask questions, use Git, and write clean, well-documented code.</p>
<h2 id="heading-first-few-weeks-as-a-developer">First Few Weeks as a Developer</h2>
<p>On my first week on the job, I was immediately involved in a Daily Standup Meeting. It was a whirlwind of new information and concepts to grasp. Terms like Redis, Migration, Microservices, PoC (Proof of Concept), and Sprint Planning were all new to me, and I focused on absorbing as much as I could.</p>
<p>The initial days were spent setting up my development environment and understanding how task management and development operate on a larger scale. I learned a great deal about Agile methodology, a stark contrast to my university classes. It was an eye-opening experience to interact with databases and development processes in a real-world setting. I was overwhelmed and wasn't sure if I belong here. I just felt dumb.</p>
<p>To help you out, here is a little vocabulary related to how developer teams work, so you won't struggle as much as I did:</p>
<p>1. Agile Methodology: A project management and software development approach based on iterative development, where requirements and solutions evolve through collaborative effort.</p>
<p>2. Scrum: A framework within Agile that involves short sprints of work to achieve a defined goal, with frequent reassessments and adaptations of plans.</p>
<p>3. Sprint: A time-boxed period, usually 2-4 weeks, during which a specific set of work must be completed and made ready for review.</p>
<p>4. Standup Meeting: A daily brief meeting in Agile teams to discuss progress, upcoming work, and potential obstacles.</p>
<p>5. User Stories: Simple descriptions of a feature told from the perspective of the user or customer.</p>
<p>6. Backlog: A list of features, changes, fixes, and more that serve as the team's to-do list.</p>
<p>7. Iteration: A short time frame where Agile teams complete work from the backlog.</p>
<p>8. Continuous Integration (CI): A software development practice where developers frequently merge their code changes into a central repository, followed by automated builds and tests.</p>
<p>9. Retrospective: A meeting held at the end of a sprint where the team reflects on the past sprint and identifies improvements for the next sprint.</p>
<p>These terms are just a few you'll likely encounter in the beginning of your developer journey. While I couldn't include everything, here's a crucial piece of advice: there are no stupid questions. Asking questions is the quickest path to learning, and rest assured, you won't be annoying to anyone. Your primary role is to learn, and it's in the team's interest to help you grow. I am lucky that my direct supervisor became my mentor and he took me under his wings. Having a mentor in your team will not only boost your learning, but will help you through the hardest parts. I can't stress enough how important this part is.</p>
<h2 id="heading-navigating-the-codebase-and-fighting-the-imposter-syndrome">Navigating the Codebase and fighting the Imposter Syndrome</h2>
<p>The following weeks were dedicated to familiarizing myself with the codebase. It was daunting at first, encountering something so vast and complex, with millions of lines of code. This experience brought back feelings of imposter syndrome. But I reminded myself to stay calm, approach the code methodically, and understand it bit by bit. The process was truly fascinating – seeing how a project is structured and learning about best practices opened my eyes to the intricacies of large-scale software development.</p>
<p>As each day passed, my confidence steadily grew. I engaged in numerous conversations with my colleagues, gradually getting to know them better. It's no exaggeration to say that I've found the best team in the world. We operate not just with remarkable efficiency, but also share a familial bond. My hope is for everyone to find a team where they experience this same sense of belonging and support.</p>
<h2 id="heading-months-of-steady-improvement">Months of steady improvement</h2>
<p>Gradually, I've been assigned more complex tasks, marking a significant transition in my journey. Initially, these challenges seemed daunting, pushing me out of my comfort zone. But, with the support and guidance of my team, I tackled each task with increasing confidence. It’s a rewarding experience to see how my contributions now play a pivotal role in our projects.</p>
<p>Additionally, I consider myself fortunate to be involved in a diverse array of projects, which has significantly accelerated my learning curve. My work spans from AI-related projects to tasks where I assume the role of a Business Analyst. This variety not only enriches my skill set but also provides a broader perspective on how technology can be applied in different scenarios.</p>
<p>I began my journey as a newcomer to React, armed with a solid foundation in CSS and JavaScript. Since then, my toolkit has expanded significantly, now including TypeScript, Next.js, Webpack, Azure AI, Tailwind CSS, Framer Motion, among other technologies. These past nine months have been an incredible ride, full of learning and development. As I look forward, I'm filled with anticipation for the opportunities,projects and challenges that 2024 will bring.</p>
<p>The essence of being a developer is embodied in daily learning and adaptability. It's not just my personal experience; it's a fundamental aspect of the job. We're constantly solving problems and crafting new solutions, which keeps the work both challenging and deeply rewarding.</p>
<h2 id="heading-call-to-action">Call to action</h2>
<p>Hi, I am Gergo, but everybody calls me StariGeri — I am a Frontend Developer Intern as well as a Computer Science student and I am sharing many things around these topics.</p>
<p>If any of this sounds interesting to you subscribe to my newsletter, so you won't miss anything in the future. Also if you have some thoughts you’d like to share, a topic suggestion or you found a mistake, do not hesitate to reach out to me via LinkedIn or Instagram.</p>
]]></content:encoded></item><item><title><![CDATA[Next.js 14: All you need to know]]></title><description><![CDATA[Hey there! Did you miss this year's Next.js Keynote or want to get a summary of what you've heard? No worries, I got you covered.

Next.js is a Framework built on React and they are determined to bring the power of full-stack to the frontend. They've...]]></description><link>https://blog.staridev.hu/nextjs-14-all-you-need-to-know</link><guid isPermaLink="true">https://blog.staridev.hu/nextjs-14-all-you-need-to-know</guid><category><![CDATA[Next.js]]></category><category><![CDATA[Frontend Development]]></category><category><![CDATA[React]]></category><category><![CDATA[First Blog]]></category><category><![CDATA[nextjs 14]]></category><dc:creator><![CDATA[Gergo Starosta]]></dc:creator><pubDate>Fri, 27 Oct 2023 23:48:18 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1698443085645/23a9b4e0-f5d3-4111-8e48-dee214d6592c.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Hey there! Did you miss this year's <a target="_blank" href="https://nextjs.org/conf">Next.js Keynote</a> or want to get a summary of what you've heard? No worries, I got you covered.</p>
<hr />
<p><a target="_blank" href="https://nextjs.org/">Next.js</a> is a Framework built on React and they are determined to bring the power of full-stack to the frontend. They've been extremely innovative and have been chosen by Notion, Twitch, DoorDash and TikTok just to mention a few. Next.js 13 introduced the <code>app/ directory</code>, <code>next/font</code> and <code>next/image</code> as well as many other things. This year we have been gifted again and to be honest, there's never been a better time to be a Frontend developer.</p>
<h2 id="heading-nextjs-is-almost-turbocharged">Next.js is (almost) "Turbocharged"</h2>
<p>With Next.js 13, Vercel introduced the alpha version of <a target="_blank" href="https://turbo.build/pack">Turbopack</a>. Turbopack is an incremental bundler optimized for JavaScript and TypeScript, written in Rust. After merging the knowledge of Vercel and a few ex-Webpack engineers, a new contender arose on the horizon of bundlers.</p>
<p>Vercel is heavily invested in creating a better experience for developers and as a result, Turbopack is closer to stable than ever before. They are passing +5000 tests of <code>next dev</code>. According to the Framework giant, they witnessed a <strong>53%</strong> faster local server startup and almost a <strong>95%</strong> faster code update using <code>next dev --turbo</code>. The best part is; that the larger your project, the bigger improvements you'll run into.</p>
<p>Once Turbopack passes all the required tests, it will be tagged as stable. You can follow the process here: <a target="_blank" href="https://areweturboyet.com/">https://areweturboyet.com/</a>.</p>
<h2 id="heading-server-actions-is-now-stable">Server Actions is now stable</h2>
<p>There is no need to create API Routes manually or write event handlers. With Server Actions, you can define functions that run on the server but can be called directly from a component.</p>
<p>For example, a simple create function can be done in a single file:</p>
<pre><code class="lang-typescript"><span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">Page</span>(<span class="hljs-params"></span>) </span>{
  <span class="hljs-keyword">async</span> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">create</span>(<span class="hljs-params">formData: FormData</span>) </span>{
    <span class="hljs-string">'use server'</span>; <span class="hljs-comment">// the use server directive is a must</span>
    <span class="hljs-keyword">const</span> id = <span class="hljs-keyword">await</span> createItem(formData);
  }

  <span class="hljs-keyword">return</span> (
    &lt;form action={create}&gt;
      &lt;input <span class="hljs-keyword">type</span>=<span class="hljs-string">"text"</span> name=<span class="hljs-string">"name"</span> /&gt;
      &lt;button <span class="hljs-keyword">type</span>=<span class="hljs-string">"submit"</span>&gt;Submit&lt;/button&gt;
    &lt;/form&gt;
  );
}
</code></pre>
<p>With Typescript, using server actions will give you an end-to-end type safety between the client and server. Also, you will get a ton of built-in functions when using the App router. You can redirect through routes with <code>redirect()</code> and read/set cookies with <code>cookies()</code> etc.</p>
<p>This is proof that Vercel's goal is clearly to provide the easiest access to all the full-stack opportunities on the front end. Isn't this cool?</p>
<h2 id="heading-metadata-changes">Metadata changes</h2>
<p>Metadata is just "data about the data", it may sound simple, but metadata plays a huge role in SEO and accessibility. To ensure a smooth user experience, Next.js will remove <code>viewport</code>, <code>colorScheme</code> and <code>themeColor</code> from metadata.</p>
<p>They wouldn't let us empty-handed, so from Next.js 14 you can customize the initial viewport of the page using the <code>viewport</code> object or the <code>generateViewport</code> function.</p>
<blockquote>
<p>Note: both options are only supported in Server Components and only one of them can be exported from the same route.</p>
</blockquote>
<pre><code class="lang-typescript"><span class="hljs-comment">// How to use the Static Viewport object in your layout.tsx / page.tsx</span>
<span class="hljs-keyword">import</span> { Viewport } <span class="hljs-keyword">from</span> <span class="hljs-string">'next'</span>

<span class="hljs-keyword">export</span> <span class="hljs-keyword">const</span> viewport: Viewport = {
  themeColor: <span class="hljs-string">'black'</span>,
}

<span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">Page</span>(<span class="hljs-params"></span>) </span>{}

<span class="hljs-comment">/* How to use the Dynamic generateViewport function 
 in your layout.tsx / page.tsx */</span>
<span class="hljs-keyword">export</span> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">generateViewport</span>(<span class="hljs-params">{ params }</span>) </span>{
  <span class="hljs-keyword">return</span> {
    themeColor: <span class="hljs-string">'...'</span>,
  }
}
</code></pre>
<h2 id="heading-nextjs-teaches-nextjs">Next.js teaches Next.js</h2>
<p>Probably the biggest blessing to us WebDevs, is that now we can learn directly from the creators of Next.js. The course is entirely free of charge, and I'm not surprised by the exceptional comprehensiveness and depth of the curriculum they've assembled.</p>
<p>A few things you can and will learn at <a target="_blank" href="https://nextjs.org/learn">Next Learn</a>:</p>
<ul>
<li><p>App Router</p>
</li>
<li><p>Styling</p>
</li>
<li><p>Setting up your Database</p>
</li>
<li><p>Fetching data with Server Components</p>
</li>
<li><p>Adding search and pagination</p>
</li>
<li><p>Accessibility</p>
</li>
<li><p>Authentication</p>
</li>
<li><p>and more!</p>
</li>
</ul>
<hr />
<p>Well, that is it for this year's Next.js conf. If you would like to dig deeper into the things I mentioned, I recommend you check out the <a target="_blank" href="https://nextjs.org/blog/next-14#nextjs-compiler-turbocharged">official release</a> note or watch back the <a target="_blank" href="https://nextjs.org/conf">keynote</a>.</p>
<h2 id="heading-call-to-action"><strong>Call to action</strong></h2>
<p>Hi, I am Gergo, but everybody calls me StariGeri — I am a Frontend Developer Intern as well as a Computer Science student and I am sharing many things around these topics.</p>
<p>If any of this sounds interesting to you subscribe to my newsletter, so you won't miss anything in the future. Also if you have some thoughts you’d like to share, a topic suggestion or you found a mistake, do not hesitate to reach out to me via <a target="_blank" href="https://www.linkedin.com/in/gergo-starosta/">LinkedIn</a> or <a target="_blank" href="https://www.instagram.com/starigeri/">Instagram</a>.</p>
]]></content:encoded></item></channel></rss>