<?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 Donald Walters on Medium]]></title>
        <description><![CDATA[Stories by Donald Walters on Medium]]></description>
        <link>https://medium.com/@donald.walters?source=rss-c36812a46901------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*xD8qodVHO7uo31vn.</url>
            <title>Stories by Donald Walters on Medium</title>
            <link>https://medium.com/@donald.walters?source=rss-c36812a46901------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 02:26:00 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@donald.walters/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[Add an Online Leaderboard to Your Phaser Game Without Writing a Backend]]></title>
            <link>https://medium.com/@donald.walters/add-an-online-leaderboard-to-your-phaser-game-without-writing-a-backend-86e35dac4346?source=rss-c36812a46901------2</link>
            <guid isPermaLink="false">https://medium.com/p/86e35dac4346</guid>
            <category><![CDATA[indie-game-development]]></category>
            <category><![CDATA[phaserjs]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[game-development]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Donald Walters]]></dc:creator>
            <pubDate>Mon, 30 Nov 2026 00:45:04 GMT</pubDate>
            <atom:updated>2026-11-30T00:47:11.306Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*103VQ5bgaJmjefoLo7tRcA.png" /></figure><h4>A global high-score table, anonymous players and a game-over scene, in about ten minutes</h4><p>A leaderboard is one of the cheapest ways to make a small game feel alive. Players come back to beat a name, not a number.</p><p>Most browser games still ship without one. An online high-score table normally means a server, a database, an API and a plan for fake scores, which is a lot of infrastructure for one screen. Game jam entries almost always skip it.</p><p>This tutorial adds one to a Phaser game using <a href="https://oneleader.cloud/">OneLeader</a>, a hosted leaderboard API. The game talks to it directly from the browser, so there’s no backend to run. By the end, the game-over scene will:</p><ul><li>save the player’s score</li><li>tell them their all-time rank</li><li>show the top 10, with their own row highlighted</li><li>keep the game working if the leaderboard can’t be reached</li></ul><p>The code works with Phaser 3 and Phaser 4.</p><h3>How it works</h3><p>Players don’t need an account. The first time someone finishes a run, the game creates an <strong>anonymous player</strong> and keeps its session in localStorage, so the same browser is the same player next time.</p><p>Scores go to a <strong>metric</strong> (here, highscore), and a metric decides how scores combine. With max, each player keeps their best run. A <strong>leaderboard</strong> ranks players on a metric. You can keep one forever (&quot;all time&quot;) or have it restart every day, month or year.</p><h3>1. Set up the leaderboard</h3><p>In the <a href="https://dash.oneleader.cloud/">OneLeader dashboard</a> (sign in with GitHub or Google):</p><ol><li><strong>Create an app</strong> for your game. The free plan covers 10,000 scores a month.</li><li>Under <strong>API keys</strong>, create a <strong>publishable</strong> key. It starts with lb_pk_ and is safe to ship in client code.</li><li>Under <strong>Allowed origins</strong>, add the address your dev server runs on and the address you’ll publish to, such as your itch.io page or your own domain. Requests from any other origin are refused.</li><li>Under <strong>Metrics</strong>, create highscore with the aggregation max.</li><li>Under <strong>Leaderboards</strong>, create alltime on highscore, ranked highest first.</li></ol><h3>2. Install the SDK</h3><p>In your Phaser project:</p><pre>npm i @oneleader/sdk</pre><h3>3. Add a leaderboard module</h3><p>Keep the network code out of your scenes. Save this as src/leaderboard.ts and paste in your publishable key:</p><pre>import { createClient, OneLeaderError, type Rankings } from &quot;@oneleader/sdk&quot;;<br><br>const SESSION = &quot;oneleader-session&quot;;<br>const saved = localStorage.getItem(SESSION);<br>const client = createClient({ publishableKey: &quot;lb_pk_...&quot;, session: saved ? JSON.parse(saved) : undefined });<br><br>// The leaderboard is a bonus: offline, over quota or rate limited, the game carries on without it.<br>const unavailable = (e: unknown) =&gt; e instanceof OneLeaderError || e instanceof TypeError;<br><br>/** First run only: start an anonymous player and ask for the name shown on the board. */<br>async function ready() {<br>  if (localStorage.getItem(SESSION)) return;<br>  localStorage.setItem(SESSION, JSON.stringify(await client.startSession()));<br>  const name = prompt(&quot;Your name for the leaderboard?&quot;)?.trim();<br>  if (name) await client.setDisplayName(name).catch(() =&gt; {}); // a rejected name (e.g. too long) leaves the player &quot;Anonymous&quot;<br>}<br><br>/** Records a finished run. Returns the player&#39;s all-time rank (by their best score), or null if it couldn&#39;t be saved. */<br>export async function submitRun(score: number): Promise&lt;number | null&gt; {<br>  try {<br>    await ready();<br>    const receipt = await client.submitScore(&quot;highscore&quot;, score);<br>    return receipt.leaderboards.find((b) =&gt; b.key === &quot;alltime&quot;)?.rank ?? null;<br>  } catch (e) {<br>    if (unavailable(e)) return null;<br>    throw e;<br>  }<br>}<br><br>/** The top 10, plus the player&#39;s own row in `user` even when they&#39;re further down. */<br>export async function topTen(): Promise&lt;Rankings | null&gt; {<br>  try {<br>    return await client.getLeaderboard(&quot;alltime&quot;, { limit: 10 });<br>  } catch (e) {<br>    if (unavailable(e)) return null;<br>    throw e;<br>  }<br>}</pre><p>Two things to notice:</p><ul><li><strong>Failures return </strong><strong>null instead of throwing.</strong> If the player is offline, the app is over its monthly quota, or requests are being rate limited, the game simply carries on without the board. A leaderboard should never be the reason a game breaks.</li><li><strong>The name prompt uses the browser’s </strong><strong>prompt().</strong> It&#39;s enough to get started. Replace it later with a name-entry screen that fits your game, and call setDisplayName from there.</li></ul><h3>4. Show it on game over</h3><p>Add a GameOver scene to the scene list in your game config. Start it from your game scene when a run ends:</p><pre>this.scene.start(&quot;GameOver&quot;, { score: this.score });</pre><p>The scene draws straight away, then fills in the rank and the table when they arrive:</p><pre>import Phaser from &quot;phaser&quot;;<br>import { submitRun, topTen } from &quot;./leaderboard&quot;;<br><br>export class GameOver extends Phaser.Scene {<br>  constructor() {<br>    super(&quot;GameOver&quot;);<br>  }<br><br>// Start it from your game scene with: this.scene.start(&quot;GameOver&quot;, { score });<br>  create({ score }: { score: number }) {<br>    const x = this.scale.width / 2;<br>    this.add.text(x, 60, `Score: ${score}`, { fontSize: &quot;32px&quot; }).setOrigin(0.5);<br>    const status = this.add.text(x, 105, &quot;Saving your score…&quot;, { fontSize: &quot;18px&quot; }).setOrigin(0.5);<br>    this.add.text(x, this.scale.height - 40, &quot;Press SPACE to play again&quot;, { fontSize: &quot;16px&quot; }).setOrigin(0.5);<br>    this.input.keyboard?.once(&quot;keydown-SPACE&quot;, () =&gt; this.scene.start(&quot;Game&quot;));<br>    this.showBoard(score, status, x);<br>  }<br> <br> private async showBoard(score: number, status: Phaser.GameObjects.Text, x: number) {<br>    let left = false;<br>    this.events.once(&quot;shutdown&quot;, () =&gt; (left = true));<br>    const rank = await submitRun(score);<br>    const board = await topTen();<br>    if (left) return; // the player restarted before the board loaded<br>    status.setText(rank ? `Your best is #${rank} all time` : &quot;Leaderboard unavailable right now&quot;);<br>    board?.rankings.forEach((row, i) =&gt; {<br>      const me = row.player_id === board.user?.player_id;<br>      this.add<br>        .text(x, 150 + i * 28, `${row.rank}. ${row.display_name ?? &quot;Anonymous&quot;}   ${row.value}`, { fontSize: &quot;18px&quot;, color: me ? &quot;#30b0c7&quot; : &quot;#ffffff&quot; })<br>        .setOrigin(0.5);<br>    });<br>  }<br>}</pre><p>The left flag matters more than it looks. Impatient players hit &quot;play again&quot; before the network answers. Without the check, the old game-over scene would try to draw onto a scene that has already shut down.</p><p>Phaser draws display names as canvas text, not HTML, so whatever a player types as their name can’t inject markup into your page.</p><h3>5. Try it</h3><p>Run the game and finish a run. You should see yourself at #1. Open the game in a private window to play as a second player.</p><p>If the status line says the leaderboard is unavailable, check the browser console:</p><ul><li><strong>403:</strong> the page’s origin isn’t in <strong>Allowed origins</strong>.</li><li><strong>404:</strong> the metric or leaderboard key doesn’t match what you created in the dashboard.</li></ul><h3>What about cheating?</h3><p>A browser game can’t completely stop a determined player from sending a fake score, because the code and the key are on the player’s machine. This approach limits the damage:</p><ul><li><strong>min/max bounds per metric</strong>, so impossible scores are rejected</li><li><strong>per-player rate limits</strong></li><li><strong>allowed origins</strong>, so other sites can’t use your key from a browser</li><li><strong>bans</strong>, which remove a player from every board</li></ul><p>That’s enough for most jam and casual games. If your game has its own server, submit scores from there with a secret key instead. The responses are the same either way.</p><h3>Where to go next</h3><ul><li><strong>Daily or monthly boards:</strong> create another leaderboard on highscore with a repeating schedule. Every score counts on every board that uses the metric, so there&#39;s no extra code.</li><li><strong>Speed runs and puzzle times:</strong> use the aggregation min and rank lowest first.</li><li><strong>Full reference:</strong> the <a href="https://oneleader.cloud/quickstart">quickstart</a> and the <a href="https://oneleader.cloud/docs">API reference</a> cover every call and error code.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=86e35dac4346" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Supabase + RTK Query + Typescript like an absolute Chad!]]></title>
            <link>https://medium.com/@donald.walters/supabase-rtk-query-typescript-like-an-absolute-chad-6f477a32b0cc?source=rss-c36812a46901------2</link>
            <guid isPermaLink="false">https://medium.com/p/6f477a32b0cc</guid>
            <category><![CDATA[supabase]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[expo]]></category>
            <category><![CDATA[redux-toolkit]]></category>
            <category><![CDATA[typescript]]></category>
            <dc:creator><![CDATA[Donald Walters]]></dc:creator>
            <pubDate>Fri, 15 Nov 2024 19:20:06 GMT</pubDate>
            <atom:updated>2024-11-15T19:20:06.398Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*kNRqDtSY8yJ7V2wYkYfCrw.jpeg" /></figure><p>“<em>Why make life hard for yourself. Work smart and keep things simple and efficient.</em>”</p><p>I have always been a big fan of <a href="https://www.supabase.com/"><em>supabase</em></a> and tend to gravitate towards it mostly when creating my SaaS applications. Whilst I am no longer a big fan of React (for several reasons which are beyond the scope of this post), I use it a lot for personal and professional projects. As such, I get ask a lot about how to best approach the integration of the two. So, this is how I go about it. Maybe there are better ways, we will find out.</p><p>Nope, I am not going into a long article of what supabase and RTK Query are. Google is your friend! 😊 (At least in this case)</p><p><strong>Installation</strong></p><pre>bun add @reduxjs/toolkit react-redux @supabase/supabase-js</pre><p>I tend to use <a href="https://bun.sh/"><em>Bun</em></a> or <a href="https://pnpm.io/"><em>Pnpm</em></a> but that doesn’t matter. Use whatever floats your boat.</p><p>Ok, now to the real stuff.</p><p>For me, I always use Typescript in my projects so as to benefit from the type safety. So with that said, I want my supabase integration to also be the same. Luckily Supabase docs gives us a way to generate the types for our databases.</p><pre>bunx supabase gen types --lang=typescript --project-id &quot;xxxxx&quot; --schema public &gt; database.types.ts</pre><p>The generated types in my view can be a big pile of 💩 especially when using them in my apps. This makes it easier to make changes if we change the name of a table or something like that in the future. So, I typically extract the types that I am actually going to use in another file.</p><pre>import { Tables } from &#39;@/api/database.types&#39;;<br><br>export type Todo = Tables&lt;&#39;todos&#39;&gt;;</pre><p>With this I can now annotate my functions and variables properly. Like,</p><pre>const todo: Todo = ...<br>function createTodo(todo: Todo) { ... }</pre><p>instead of ❌</p><pre>const todo: Table&lt;&#39;todos&#39;&gt; = ...<br>function createTodo(todo: Table&lt;&#39;todos&#39;&gt;) { ... }</pre><p>What about connecting to supabase? I have a separate file somewhere (libs?) where I create the typical supabase client. In the case below this was for a mobile app using expo. You can use whatever storage mechanism you wish.</p><pre>import { createClient } from &#39;@supabase/supabase-js&#39;;<br><br><br>export const supabase = createClient&lt;Database&gt;(supabaseUrl, supabaseAnonKey, {<br>  auth: {<br>    storage: new LargeSecureStore(),<br>    autoRefreshToken: true,<br>    persistSession: true,<br>    detectSessionInUrl: false,<br>  },<br>});</pre><p>Now that we got that out of the way, let’s get to the actual point of this article.</p><p>From here we are pretty much setup with supabase and react. We can immediately start using it. Typically we would use it like the following.</p><pre>const [todos, setTodos] = useState&lt;Todos[]&gt;([]);<br>const [loading, setLoading] = useState&lt;boolean&gt;(false);<br>const [page, setPage] = useState&lt;number&gt;(0);<br>const [limit, setLimit] = useState&lt;number&gt;(10);<br><br>useEffect(() =&gt; {<br>  setLoading(false);<br>  (async () =&gt; {<br>      const start = page &lt; 0 ? 0 : page * limit;<br>      const end = start + limit - 1;<br>      const { data, error } = await supabase.from(&#39;todos&#39;)<br>                                      .select()<br>                                      .range(start, end);<br>     setTodos(data);<br>     setLoading(false);<br>   })();<br>}, [page, limit]);</pre><p>This is so verbose! 🤢 Then we have to do this everywhere we want to do a query to supabase.</p><p>In comes RTK to the rescue!</p><p>The aim here is to reduce the amount of code and streamline how we query supabase in the components.</p><p><strong>Integration with RTK Query.</strong></p><p>As it relates to the integration of supabase, most of what I have done comes from the RTK <a href="https://redux-toolkit.js.org/rtk-query/usage/customizing-queries#using-a-third-party-sdk">website</a>.</p><pre>import { createApi, fakeBaseQuery } from &#39;@reduxjs/toolkit/query/react&#39;<br><br>export const supabaseAPI = createApi({<br>  reducerPath: &#39;supabaseAPI&#39;,<br>  baseQuery: fakeBaseQuery(),<br>  tagTypes: [&#39;Todo&#39;],<br>  endpoints: (builder) =&gt; ({<br>    getAllTodos: builder.query&lt;GetAllTodosResponse, GetAllTodosArgs&gt;({<br>      queryFn: async ({ page = 0, limit = 10 }) =&gt; {<br>        const start = page &lt; 0 ? 0 : page * limit;<br>        const end = start + limit - 1;<br><br>        const { data, error } = await supabase.from(&#39;todos&#39;)<br>                                      .select()<br>                                      .range(start, end);<br><br>        if (error) {<br>          return { error };<br>        }<br><br>        return { data: { todos: data ?? [], page: page + 1, limit } };<br>      },<br>    }),<br>    createTodo: builder.mutation&lt;CreateTodoResponse, CreateTodoArgs&gt;({<br>      queryFn: async (todo) =&gt; {<br>        const { data, error } = await supabase.from(&#39;todos&#39;)<br>                                    .insert(todo)<br>                                    .select(&#39;id&#39;)<br>                                    .single();<br><br>        if (error) {<br>          return { error };<br>        }<br><br>        return { data };<br>      },<br>    }),<br>  }),<br>});<br><br>export type GetAllTodosArgs = {<br>  page?: number;<br>  limit?: number;<br>}<br><br>export type GetAllTodosResponse = {<br>  todos: Todo[];<br>  page?: number;<br>  limit?: number;<br>}<br><br>export type CreateTodoArgs = {<br>  comment: string;<br>  completed: boolean;<br>}<br><br>export type CreateTodoResponse = { id: string }<br><br>export const {<br>  useGetAllTodosQuery,<br>  useCreateTodoMutation<br>} = supabaseAPI;</pre><p>Awesome!🚀</p><p>But wait! 😧 Typescript is working some magic. Some of you may be getting some typescript errors with the use of fakeBaseQuery() not find the proper types. Also, the errors being returned from RTK not matching up with supabase. Don’t worry, I got you!</p><p>I can’t recall where I came across this (but my credit goes out to whoever). Substitute the fakeBaseQuery() with the custom baseQuery below. You can can customize it as you see fit</p><pre>const _NEVER = /* @__PURE__ */ Symbol();<br>export type NEVER = typeof _NEVER;<br><br>export type SupabaseQueryArgs = {<br>  path: &#39;auth&#39; | &#39;data&#39;;<br>  method: string;<br>  body?: Record&lt;string, any&gt;;<br>  params?: Record&lt;string, any&gt;;<br>};<br><br>type SupabaseError = PostgrestError | AuthError;<br><br>export const supabaseBaseQuery: BaseQueryFn&lt;SupabaseQueryArgs, unknown, SupabaseError&gt; = async ({<br>  path,<br>  method,<br>  body,<br>  params,<br>}) =&gt; {<br>  try {<br>    let result;<br><br>    if (path === &#39;auth&#39;) {<br>      if (!(method in supabase.auth)) {<br>        throw new Error(`Unsupported auth method: ${method}`);<br>      }<br>      result = await (supabase.auth[method as keyof typeof supabase.auth] as Function)(body);<br>    } else if (path === &#39;data&#39;) {<br>      const [table, action] = method.split(&#39;.&#39;);<br>      if (!(table in supabase) || !(action in supabase[table as keyof typeof supabase])) {<br>        throw new Error(`Unsupported data method: ${method}`);<br>      }<br>      result = await (<br>        supabase[table as keyof typeof supabase][action as keyof (typeof supabase)[keyof typeof supabase]] as Function<br>      )(params);<br>    } else {<br>      throw new Error(`Unsupported path: ${path}`);<br>    }<br><br>    if (result.error) {<br>      return { error: result.error };<br>    }<br><br>    return { data: result.data };<br>  } catch (error) {<br>    return { error: error as SupabaseError };<br>  }<br>};</pre><p>Finally!</p><p>We are now able use these in out components without having to use useState and useEffect to be able to interact with supabase.</p><pre>const { data, error } = useGetAllTodos({ page:0 , limit: 20 });<br>const [createTodo] = useCreateTodoMutation();</pre><p>Now we are able to use the RTK queries as a normal with the typical properties of isLoading, etc</p><p>I hope this was useful for those who are looking to do a similar. Let me know your thoughts in the comments. I am always open to learning and revising how I do stuff.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6f477a32b0cc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Laravel vs. Next.js: A Balanced Perspective ‍♂️]]></title>
            <link>https://medium.com/@donald.walters/laravel-vs-next-js-a-balanced-perspective-%EF%B8%8F-4c554d182f64?source=rss-c36812a46901------2</link>
            <guid isPermaLink="false">https://medium.com/p/4c554d182f64</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[laravel]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[app-development]]></category>
            <dc:creator><![CDATA[Donald Walters]]></dc:creator>
            <pubDate>Fri, 30 Aug 2024 18:14:15 GMT</pubDate>
            <atom:updated>2024-08-30T18:14:15.033Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/713/1*YtMH4VGzPrcyIqEUn-lhgA.png" /></figure><p>I have, for the most part, in my career, abided by the following two mottos:</p><ol><li>Use the right tool for the job and don’t be locked into a specific product/framework/language.</li><li>Like in wine tasting, the best tasting wine is the one that tastes the best to you.</li></ol><p>These principles have guided my decisions through numerous projects, helping me avoid the pitfalls of technological dogma and focus on what truly matters — delivering quality solutions.</p><p>Recently, I found myself listening to a discussion between two developers, each passionately championing their preferred technologies: <a href="https://laravel.com/">Laravel</a> (PHP) and <a href="https://nextjs.org/">Next.js</a> (JavaScript). 🤬 Both made compelling arguments for their respective sides, and whilst I usually avoid these endless (sometimes pointless 🥱) debates, I felt compelled to share my perspective, especially since these two frameworks represent different philosophies in web development.</p><h3>Laravel: The All-in-One PHP Framework</h3><p>Laravel has long been a favorite among PHP developers for its elegance, simplicity, and comprehensive toolset. It offers a full-stack framework that includes everything from routing and middleware to ORM (Eloquent) and authentication. For developers who prefer a structured, opinionated approach, Laravel provides a robust and cohesive environment that can handle most tasks out of the box.</p><p><strong>Why Laravel Stands Out:</strong></p><ul><li><strong>Developer Experience:</strong> Laravel is designed with the developer in mind. Its syntax is clean and expressive, making it easier to write code that is both readable and maintainable. The framework’s strong documentation and active community also mean that developers are rarely left in the dark.</li><li><strong>Built-in Features:</strong> Laravel comes with a plethora of built-in features that reduce the need for third-party packages. From user authentication to task scheduling and queues, Laravel handles many common web development tasks with ease.</li><li><strong>MVC Architecture:</strong> Laravel’s MVC (Model-View-Controller) architecture encourages a clean separation of concerns, which can lead to more organized and scalable codebases.</li></ul><p>However, Laravel’s all-in-one approach can also be seen as a double-edged sword. The framework’s opinions, while beneficial in many cases, might not be suitable for developers who prefer more flexibility or are working on projects with unique requirements.</p><h3>Next.js: The Versatile React Framework</h3><p>Next.js, on the other hand, is a more recent addition to the web development landscape, building on the popularity of React.js. It’s a minimalistic framework that provides the essentials needed to build both server-rendered and static web applications. Next.js is often praised for its performance, flexibility, and ease of integration with other JavaScript libraries and tools.</p><p><strong>Why Next.js Shines:</strong></p><ul><li><strong>Flexibility:</strong> Next.js doesn’t lock you into a specific way of doing things. Whether you want to build a server-rendered application, a static site, or even a hybrid approach, Next.js gives you the tools to do so with minimal overhead.</li><li><strong>Performance:</strong> Next.js is optimized for performance out of the box. Features like automatic static optimization, dynamic imports, and server-side rendering (SSR) contribute to faster load times and better user experiences.</li><li><strong>Integration with React:</strong> For developers already familiar with React, Next.js feels like a natural extension. It allows you to leverage React’s component-based architecture while adding server-side capabilities that are often necessary for modern web applications.</li></ul><p>That said, Next.js’s flexibility can also be a challenge. Developers who are new to React or JavaScript in general might find the learning curve steep, and the lack of a structured environment can lead to inconsistencies in larger projects.</p><h3>Commonalities (for what it’s worth…)</h3><p>Despite their differences, Laravel and Next.js share several key strengths that make them both excellent choices for web development:</p><h4>1. Developer Experience</h4><p>Both frameworks emphasize a positive developer experience. Laravel offers a clean, expressive syntax with built-in tools that streamline development, while Next.js provides seamless integration with React, offering flexibility in building both simple and complex applications.</p><h4>2. Strong Community and Ecosystem</h4><p>Laravel and Next.js both benefit from active communities and rich ecosystems. Laravel’s ecosystem includes tools like Forge and Vapor, while Next.js is backed by Vercel and integrates with a wide range of React libraries. This support ensures developers have access to extensive resources and third-party packages.</p><h4>3. Scalability</h4><p>Both frameworks are built to scale. Laravel’s backend features, like caching and queueing, support large applications, while Next.js leverages server-side rendering and static generation to handle varying levels of traffic, easily integrating with serverless platforms for effortless scaling.</p><h4>4. Security</h4><p>Security is a priority in both frameworks. Laravel includes built-in protections against common vulnerabilities like XSS and CSRF, while Next.js, through React’s secure-by-default approach and server-side rendering, allows developers to implement custom security measures.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/808/1*ACVQGeJw-gSCi0AvLNIc8w.png" /></figure><h3>So, which one should you choose?</h3><p>As with many things in technology, the answer depends on the specific needs of your project and your personal preferences.</p><p>If you’re building a traditional web application with a need for a robust backend, Laravel might be the better choice. Its all-in-one nature can speed up development, especially if you need features like authentication, ORM, and task scheduling. Laravel is also a great choice if you’re working with a team of developers who are already familiar with PHP. Also, just to through this in there, you can use React with a Laravel setup.</p><p>On the other hand, if you’re focused on building a highly interactive frontend, or if your project involves a lot of dynamic content that benefits from server-side rendering, Next.js is likely the better fit. It’s particularly powerful if you’re already comfortable with React and want the flexibility to mix and match other JavaScript libraries.</p><h3>Final Thoughts</h3><p>At the end of the day, the best framework is the one that aligns with your project’s requirements and your team’s expertise. Laravel and Next.js are both excellent tools, each with its own strengths and trade-offs. Rather than getting caught up in the debate over which is superior, I encourage developers to approach each project with an open mind and a focus on finding the right tool for the job.</p><p>Remember, like in wine tasting, the best choice is the one that tastes good to you and suits the palate of your project. Whether you choose Laravel or Next.js, make sure it’s a decision based on the unique needs of your work, not just popular opinion. 🥂</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4c554d182f64" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>