Next.jsReactStarter

Christophers-Next-MUI-Template — Next.js Starter Template

By christopherrobin

An authentication starter built on the Next.js App Router, integrating Material UI, Prisma + PostgreSQL, and NextAuth, with Jest and Playwright test configurations included.

Explore the design

Compare the page layouts and mobile experience. Open any screenshot for a closer look.

2 previews
Desktop homepage1 / 2
Desktop captureTop of page

Actual screenshot captured by the server browser.

All pages & views 2

Screenshots show visual appearance; interactive behavior may differ.

Recorded 2026-10-06View source

What stands out

A quick read of the recorded project description.

01

Combines Next.js App Router with React and TypeScript strict mode

02

Material UI dark theme with Geist font integrated into MUI typography

03

NextAuth.js email/password authentication with JWT sessions

04

Prisma + PostgreSQL data layer with migration scripts

05

react-hook-form + Zod shared client and server validation schema

06

Jest unit/component tests and Playwright end-to-end tests

Template Details

This is an authentication starter template for full-stack applications. It uses the Next.js App Router to organize pages, adopts Material UI for the UI layer with a custom dark theme, uses the Geist font integrated into the MUI theme, connects to PostgreSQL via Prisma for the data layer, and handles authentication with NextAuth.js using email and password sign-in with JWT sessions. Form validation uses react-hook-form and Zod, with the same schema shared between client and server.

The template includes registration, sign-in, and a protected dashboard page, and controls route access via Next.js middleware (src/proxy.ts): /dashboard/* requires authentication, and unauthenticated users are redirected to /sign-in with a callbackUrl; /sign-in and /sign-up redirect authenticated users to /dashboard; the home page is open to all visitors.

For testing, it provides both unit and component tests with Jest + Testing Library, and end-to-end tests with Playwright. Unit test files are stored alongside the source code. The project uses ESLint and Prettier for code quality and provides scripts for development, build, database migration, and formatting.

Before use, you need Node.js 24+ and a PostgreSQL database, and you must configure three environment variables: DATABASE_PUBLIC_URL, NEXTAUTH_SECRET, and NEXTAUTH_URL. The repository is MIT licensed, but third-party assets such as demo images, fonts, and icons, as well as external services like databases and hosting, require separate license and cost verification.

Next.jsReactStarter

Is it right for your project?

Use Cases

  • Quickly building a full-stack application prototype with registration and login
  • Customizing the interface starting from a Material UI dark theme
  • Needing a reference implementation combining Prisma + PostgreSQL with NextAuth
  • Projects wanting both unit tests and end-to-end tests configured
  • Needing an example of middleware-based route protection and login redirection

Suitable For

  • Developers familiar with Next.js App Router and TypeScript
  • Full-stack projects needing an authentication and database starter template
  • Teams preferring the Material UI component library
  • Developers who want a project with built-in test configuration

Getting started & customization

Use these recorded setup notes alongside the repository instructions for your chosen version.

  1. 1

    Requires Node.js 24+; the repository provides .nvmrc, so you can run nvm use

  2. 2

    Requires an available PostgreSQL database

  3. 3

    Copy .env.local.example to .env.local and fill in DATABASE_PUBLIC_URL, NEXTAUTH_SECRET, and NEXTAUTH_URL

  4. 4

    Install dependencies with yarn install, run migrations with yarn prisma migrate deploy

  5. 5

    Start the development server with yarn dev, accessible by default at http://localhost:3000

Read repository instructions

License & source material

Usage conditions & limitations

Free to use · keep license notice

This entry covers the free version under the MIT license in the public repository; the free scope applies to that version's code and does not imply that external services or third-party assets are free.

Must comply with when using

  • You may use, modify, commercialize, and distribute this version's code for free.
  • When distributing copies or substantial portions of the code, retain the original author's copyright notice and the full MIT license notice.
  • The code is provided as is; warranties and limitations of liability are governed by the original license and applicable law.

Additional costs & items to verify

  • Demo images, fonts, icons, and other third-party assets must be checked under their respective licenses and cannot be judged solely by the code's MIT license.
  • External services such as domains, hosting, databases, payments, or AI may incur additional charges.
  • Using this template requires Node.js 24 or higher; environments below this version cannot run as documented.
  • The project depends on a PostgreSQL database, and you must provide a working PostgreSQL instance to run it.
  • You must configure the DATABASE_PUBLIC_URL environment variable, providing a PostgreSQL connection string.
  • You must configure the NEXTAUTH_SECRET environment variable for NextAuth.js session encryption.
  • You must configure the NEXTAUTH_URL environment variable, specifying the site's canonical URL.
View Original Text Basis

Permission is hereby granted, free of charge

Original License Text

- Node.js 24+ (a `.nvmrc` is provided — run `nvm use`)

Original README

- PostgreSQL database

Original README

- `DATABASE_PUBLIC_URL` — PostgreSQL connection string

Original README

- `NEXTAUTH_SECRET` — Secret for NextAuth.js (generate with `openssl rand -base64 32`)

Original README

- `NEXTAUTH_URL` — Canonical site URL (e.g. `http://localhost:3000`)

Original README
https://github.com/christopherrobin/Christophers-Next-MUI-Template/blob/main/LICENSEhttps://github.com/christopherrobin/Christophers-Next-MUI-Template/blob/main/README.md

Compiled by DeepSeek based on repository license and README ·2026-10-06. Results only cover the materials read; dependencies, images, fonts, and subsequent term changes are subject to their respective original texts.

Project checks & description sources

Template Information

Source platforms
GitHub
Documentation and maintenance reference score
More documented · 85 / 100
Technologies
Next.js · React
Website type
Starter
How this score is calculated

Our heuristic uses license records (up to 30), a demo link (12), a preview (10), stars (15), recorded maintenance (15), description completeness (8), feature records (5) and classification data (5). It is not a code, security or performance test, or a Google score. A link does not establish tested functionality.

What to verify for this project

Repository update recorded
2026-10-05
Screenshot last checked
2026-10-06

A demo link is listed. Check it with your own content and viewport sizes; its presence does not confirm that forms, authentication or payments work.

The catalog identifies Next.js as the primary stack. Check the actual dependency manifest and lockfile for versions and hosting requirements. These notes use recorded metadata, not a code audit or a deployment test.

Use a selection guide →

How this description was prepared

AI-assisted description based on catalog records and repository material. Repository authors are not automatically the reviewers of this description.

Review declaration: [email protected] · 2026-10-06

Inspect the recorded source material

SHA-256: b67336db88b06dd423858ec55844fc8ed954b3b0d0faf05bccec0e8024b76898

2026-10-06T00:07:53.642Z

Source file / repository
# Christophers-Next-MUI-Template

[![CI](https://github.com/christopherrobin/Christophers-Next-MUI-Template/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/christopherrobin/Christophers-Next-MUI-Template/actions/workflows/ci.yml)
[![Tested with Jest](https://img.shields.io/badge/tested_with-jest-99425B?style=flat-square&logo=jest&logoColor=white)](https://jestjs.io/)
[![E2E with Playwright](https://img.shields.io/badge/e2e_with-playwright-2E7D32?style=flat-square&logo=playwright&logoColor=white)](https://playwright.dev/)
[![Coverage](https://img.shields.io/badge/coverage-90%25_threshold-informational?style=flat-square)](https://github.com/christopherrobin/Christophers-Next-MUI-Template/blob/main/jest.config.ts)
[![ESLint](https://img.shields.io/badge/eslint-flat_config-4B32C3?style=flat-square&logo=eslint&logoColor=white)](https://github.com/christopherrobin/Christophers-Next-MUI-Template/blob/main/eslint.config.mjs)
[![Prettier](https://img.shields.io/badge/code_style-prettier-F7B93E?style=flat-square&logo=prettier&logoColor=black)](https://github.com/christopherrobin/Christophers-Next-MUI-Template/blob/main/.prettierrc)

[![Next.js](https://img.shields.io/badge/Next.js-16-000000?style=for-the-badge&logo=nextdotjs&logoColor=white)](https://nextjs.org/)
[![React](https://img.shields.io/badge/React-19-61DAFB?style=for-the-badge&logo=react&logoColor=black)](https://react.dev/)
[![TypeScript](https://img.shields.io/badge/TypeScript-strict-3178C6?style=for-the-badge&logo=typescript&logoColor=white)](https://www.typescriptlang.org/)
[![Material UI](https://img.shields.io/badge/Material_UI-9-007FFF?style=for-the-badge&logo=mui&logoColor=white)](https://mui.com/)
[![Prisma](https://img.shields.io/badge/Prisma-7-2D3748?style=for-the-badge&logo=prisma&logoColor=white)](https://www.prisma.io/)
[![PostgreSQL](https://img.shields.io/badge/PostgreSQL-4169E1?style=for-the-badge&logo=postgresql&logoColor=white)](https://www.postgresql.org/)
[![NextAuth.js](https://img.shields.io/badge/NextAuth.js-4-000000?style=for-the-badge&logo=auth0&logoColor=white)](https://next-auth.js.org/)

![Howdy Preview](public/welcome.png)

## A modern, minimal authentication starter for developers, built with Next.js, TypeScript, Prisma, and Material UI.

**Howdy!** This starter kit is designed for those who want a clean, extensible foundation for building modern, full-stack web applications with authentication using Next.js 16, TypeScript, Prisma, and Material UI.

## Stack

- **Next.js 16** with App Router (Turbopack default)
- **React 19**, **TypeScript 6** (strict)
- **Prisma 7** with PostgreSQL
- **Material UI 9** with Emotion + `@mui/material-nextjs` AppRouterCacheProvider (custom dark theme at `src/theme.ts`)
- **`@mui/icons-material`** for icons
- **Geist** fonts wired into the MUI theme
- **NextAuth.js 4** for authentication (email & password, JWT sessions)
- **Zod + react-hook-form** for form validation (shared client/server schemas)
- **bcrypt** (via bcryptjs) for secure password hashing

## Tooling & Features

- **ESLint** and **Prettier** for code quality
- **Unit & Component Testing** with Jest & Testing Library
- **End-to-End (E2E) Testing** with Playwright
- User registration and login flows
- Protected dashboard for authenticated users

## Getting Started

Clone and set up the project in minutes:

### Prerequisites

- Node.js 24+ (a `.nvmrc` is provided — run `nvm use`)
- PostgreSQL database

### Installation

1. Clone the repository:
   ```bash
   git clone https://github.com/christopherrobin/Christophers-Next-MUI-Template
   cd Christophers-Next-MUI-Template
   ```
2. Install dependencies:
   ```bash
   yarn install
   ```
3. Configure environment variables:
   - Copy `.env.local.example` to `.env.local` and fill in your database and secret values.
4. Run Prisma migrations:
   ```bash
   yarn prisma migrate deploy
   ```
5. Start the development server:
   ```bash
   yarn dev
   ```

Visit [http://localhost:3000](http://localhost:3000) to view the app.

## Project Structure

- `src/theme.ts` — Centralized MUI theme (dark palette, Geist typography, component overrides)
- `src/app/` — Next.js App Router pages (home, sign-up, sign-in, dashboard, `not-found.tsx`)
- `src/components/` — Reusable UI components (Spinner, Providers)
- `src/lib/` — Prisma client, NextAuth config, env validation (`env.ts`), API helpers (`api-utils.ts`), shared Zod schemas (`schemas.ts`)
- `src/proxy.ts` — Next 16 middleware (route protection and auth redirects)
- `prisma/` — Prisma schema and migrations
- `public/` — Static assets and icons
- `e2e/` — End-to-end tests

Unit/component tests are co-located next to source files (e.g. `Spinner.tsx` + `Spinner.test.tsx`).

## Customization

Extend or modify any part to fit your project:

- Add new pages or API routes in `src/app/`
- Create custom UI components in `src/components/`
- Adjust authentication logic in `src/lib/auth.ts`
- Update styles via MUI config or CSS

## Scripts

- `yarn dev` — Start development server
- `yarn build` — Build for production
- `yarn start` — Start production server
- `yarn prisma:migrate` — Deploy database migrations
- `yarn lint` / `yarn lint:fix` — Lint code
- `yarn format` / `yarn format:fix` — Format code
- `yarn run nuke` — Remove node_modules, reinstall dependencies, and rebuild
- `yarn run clean` — Lint, format, and prettify all code

## Environment Variables

- `DATABASE_PUBLIC_URL` — PostgreSQL connection string
- `NEXTAUTH_SECRET` — Secret for NextAuth.js (generate with `openssl rand -base64 32`)
- `NEXTAUTH_URL` — Canonical site URL (e.g. `http://localhost:3000`)

## Authentication & Routing

The included `src/proxy.ts` (Next 16's renamed middleware) enforces:

- `/dashboard/*` requires authentication (unauth users are redirected to `/sign-in?callbackUrl=...`)
- `/sign-in` and `/sign-up` redirect authenticated users to `/dashboard`
- `/` is public for everyone

## Forms & Validation

Sign-in and sign-up forms use **react-hook-form + Zod** via `zodResolver`, with MUI's `<Controller>` pattern wrapping `<TextField>`. Schemas live in `src/lib/schemas.ts` and are used by both the client form and the server-side `safeParse` in `/api/sign-up/route.ts` — one source of truth, type-inferred via `z.infer`. Forms set `noValidate` so RHF owns validation (not native HTML5).

## Theming

The MUI theme lives at `src/theme.ts` (dark mode, primary `#20cb91`). Geist Sans is wired in via:

```ts
typography: { fontFamily: 'var(--font-geist-sans)', ... }
```

The font itself is loaded with `next/font/google` in `src/app/layout.tsx`. Without the `src/theme.ts` wiring, MUI components fall back to Roboto regardless of body styles.

## Testing

This project supports two main testing methods:

- **Unit & Component Testing** (Jest + Testing Library):
  - Run all tests: `yarn test`
  - Run a specific test file: `yarn test src/components/Spinner.test.tsx`
  - Tests are co-located next to the components they cover (e.g. `Spinner.tsx` + `Spinner.test.tsx`).
  - Uses [@testing-library/react](https://testing-library.com/docs/react-testing-library/intro/) and [@testing-library/user-event](https://testing-library.com/docs/ecosystem-user-event/) for React component interaction and assertions.

- **End-to-End (E2E) Testing** (Playwright):
  - Run all E2E tests: `yarn test:e2e`
  - Specs live in the `e2e/` directory.
  - Uses [Playwright](https://playwright.dev/) for browser-based end-to-end testing.

## License

This project is open source and available under the [MIT License](LICENSE).
Report a correction

Explore similar templates

Compare previews and descriptions within the same stack and category.