Skip to content
TheChatArchiveThe Chat Archive
gpt-4o-mini-search-preview· OpenAIHugging Face LMArena Search Arena 24K

Using Nextjs 15.3 best practices, scaffold out the next-js boilerplate using self-hosted…

  1. User

    Using Nextjs 15.3 best practices, scaffold out the next-js boilerplate using self-hosted authentication

  2. Assistant

    To scaffold a Next.js 15.3 application with self-hosted authentication, you can utilize the Next.js Starter Kit, which offers a comprehensive setup including authentication, a collaborative whiteboard app, and a document dashboard[1].

    Steps to Set Up the Next.js Starter Kit:

    1. Install the Starter Kit: Run the following command to create a new Next.js application using the Liveblocks Starter Kit:

      npx create-liveblocks-app@latest --next
      
    2. Configure Authentication: During the setup, you'll be prompted to choose an authentication method. For self-hosted authentication, select the "Demo authentication" option. This method uses a CredentialsProvider to simulate a real sign-in system, allowing you to add users manually[1].

    3. Add Users: To add users for testing, navigate to the /data folder and edit the users.ts file. Add user details in the following format:

      {
        id: "[EMAIL_ADDRESS]",
        name: "User Name",
        avatar: "https://example.com/avatar.png",
        groupIds: ["group1", "group2"],
      }
      

      Replace "[EMAIL_ADDRESS]" with the user's email address, and adjust other fields as necessary[1].

    4. Run the Development Server: Start the development server with:

      npm run dev
      

      Your application will be accessible at http://localhost:3000.

    By following these steps, you'll have a Next.js 15.3 application with self-hosted authentication, ready for further development and customization.