Using Nextjs 15.3 best practices, scaffold out the next-js boilerplate using self-hosted…
- User
Using Nextjs 15.3 best practices, scaffold out the next-js boilerplate using self-hosted authentication
- 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:
-
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 -
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
CredentialsProviderto simulate a real sign-in system, allowing you to add users manually[1]. -
Add Users: To add users for testing, navigate to the
/datafolder and edit theusers.tsfile. 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]. -
Run the Development Server: Start the development server with:
npm run devYour 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.
-