chadnext
ChadNext - Quick Starter Template for your Next project includes Next.js 15 App router, Shadcn UI, LuciaAuth, Prisma, Server Actions, Stripe, Internationalization and more.
Top Related Projects
Beautifully designed components that you can copy and paste into your apps. Accessible. Customizable. Open Source.
The best way to start a full-stack, typesafe Next.js app
An opinionated collection of components, hooks, and utilities for your Next.js project.
🔋 Next.js + Tailwind CSS + TypeScript starter and boilerplate packed with useful development features
🧙♀️ Move Fast and Break Nothing. End-to-end typesafe APIs made easy.
Quick Overview
ChadNext is a modern web application template built with Next.js 13, Tailwind CSS, and TypeScript. It provides a robust starting point for developers looking to create fast, responsive, and feature-rich web applications with a focus on best practices and developer experience.
Pros
- Utilizes the latest Next.js 13 features, including the new App Router
- Incorporates a comprehensive set of pre-configured tools and libraries (e.g., Tailwind CSS, shadcn/ui, Prisma)
- Implements authentication using NextAuth.js with GitHub and Google providers
- Includes a dark mode feature and responsive design out of the box
Cons
- May have a steeper learning curve for developers unfamiliar with Next.js 13 or TypeScript
- The opinionated structure and choice of libraries might not suit all project requirements
- Requires understanding of multiple technologies and concepts (e.g., Prisma, tRPC, Zod)
- Some features may be overkill for simpler projects, potentially leading to unnecessary complexity
Code Examples
Here are a few code examples from the ChadNext project:
- Defining a tRPC router:
import { createTRPCRouter } from "@/server/api/trpc";
import { exampleRouter } from "@/server/api/routers/example";
export const appRouter = createTRPCRouter({
example: exampleRouter,
});
export type AppRouter = typeof appRouter;
- Creating a Prisma schema:
model Example {
id String @id @default(cuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
- Implementing a Next.js API route:
import { type NextApiRequest, type NextApiResponse } from "next";
export default function handler(req: NextApiRequest, res: NextApiResponse) {
res.status(200).json({ message: "Hello from ChadNext API!" });
}
Getting Started
To get started with ChadNext:
-
Clone the repository:
git clone https://github.com/moinulmoin/chadnext.git
-
Install dependencies:
cd chadnext npm install
-
Set up environment variables:
cp .env.example .env
-
Run the development server:
npm run dev
-
Open http://localhost:3000 in your browser to see the application running.
Competitor Comparisons
Beautifully designed components that you can copy and paste into your apps. Accessible. Customizable. Open Source.
Pros of ui
- More comprehensive component library with a wider range of UI elements
- Better documentation and examples for each component
- Larger community and more frequent updates
Cons of ui
- Less opinionated, requiring more setup and configuration
- Not as tightly integrated with Next.js and TypeScript out of the box
- May require more customization for specific project needs
Code Comparison
ui:
import { Button } from "@/components/ui/button"
export function Example() {
return <Button>Click me</Button>
}
chadnext:
import { Button } from "@/components/ui/button"
export default function Example() {
return <Button>Click me</Button>
}
Both repositories provide similar component usage, but chadnext offers a more opinionated structure with default exports. ui focuses on flexibility, allowing developers to choose their preferred export style.
While ui provides a broader range of components, chadnext offers a more streamlined experience for Next.js projects with pre-configured TypeScript support and tailored components.
Ultimately, the choice between these repositories depends on project requirements, desired level of customization, and development preferences.
The best way to start a full-stack, typesafe Next.js app
Pros of create-t3-app
- More comprehensive and opinionated stack, including ORM and authentication
- Stronger focus on type safety with end-to-end typesafe APIs
- Larger community and ecosystem support
Cons of create-t3-app
- Steeper learning curve due to more complex stack
- Less flexibility in choosing individual technologies
- Potentially overkill for smaller projects
Code Comparison
create-t3-app:
import { createTRPCRouter, publicProcedure } from "~/server/api/trpc";
export const exampleRouter = createTRPCRouter({
hello: publicProcedure.query(() => {
return { greeting: "Hello from tRPC!" };
}),
});
chadnext:
import { NextResponse } from "next/server";
export async function GET() {
return NextResponse.json({ message: "Hello from API!" });
}
The code snippets show different approaches to API creation. create-t3-app uses tRPC for type-safe APIs, while chadnext uses Next.js API routes directly.
An opinionated collection of components, hooks, and utilities for your Next.js project.
Pros of Precedent
- Includes authentication and database integration with Supabase
- Features a more comprehensive set of UI components and layouts
- Offers built-in analytics tracking with Vercel Analytics
Cons of Precedent
- Less focus on TypeScript best practices and type safety
- Doesn't include Tailwind CSS class sorting or prettier-plugin-tailwindcss
- Lacks some modern Next.js 13 features like the app directory
Code Comparison
Precedent:
export default function Home() {
return (
<Layout>
<motion.div
className="max-w-xl px-5 xl:px-0"
initial="hidden"
whileInView="show"
animate="show"
viewport={{ once: true }}
variants={{
hidden: {},
show: {
transition: {
staggerChildren: 0.15,
},
},
}}
>
// ... more code
</motion.div>
</Layout>
);
}
ChadNext:
export default function Home() {
return (
<main className="container mx-auto flex min-h-screen flex-col items-center justify-center">
<h1 className="text-3xl font-bold">Welcome to ChadNext</h1>
<p className="mt-3 text-xl">
The most minimal starter for Next.js with TypeScript and Tailwind CSS
</p>
</main>
);
}
🔋 Next.js + Tailwind CSS + TypeScript starter and boilerplate packed with useful development features
Pros of ts-nextjs-tailwind-starter
- More comprehensive documentation and setup instructions
- Includes additional tools like Absolute Import, Seo.tsx, and custom 404 pages
- Provides a more structured project layout with separate components and lib folders
Cons of ts-nextjs-tailwind-starter
- Less focus on UI components compared to chadnext
- Doesn't include as many pre-built UI elements or animations
- May require more initial setup and customization for complex projects
Code Comparison
ts-nextjs-tailwind-starter:
import * as React from 'react';
import { RiAlarmWarningFill } from 'react-icons/ri';
import Layout from '@/components/layout/Layout';
import ArrowLink from '@/components/links/ArrowLink';
import Seo from '@/components/Seo';
chadnext:
import { Button } from "@/components/ui/button"
import { Input } from "@/components/ui/input"
import { Label } from "@/components/ui/label"
import { Icons } from "@/components/icons"
import { cn } from "@/lib/utils"
The code comparison shows that ts-nextjs-tailwind-starter uses more custom components and layout structures, while chadnext focuses on UI components and utility functions. ts-nextjs-tailwind-starter imports components from specific folders, indicating a more organized structure, whereas chadnext imports from general UI and utility folders.
🧙♀️ Move Fast and Break Nothing. End-to-end typesafe APIs made easy.
Pros of tRPC
- More mature and widely adopted project with a larger community
- Provides end-to-end typesafe APIs without code generation
- Supports multiple frameworks and can be used with various backend technologies
Cons of tRPC
- Steeper learning curve for developers new to TypeScript or RPC concepts
- Requires more setup and configuration compared to ChadNext's all-in-one approach
- May be overkill for smaller projects or those not requiring complex API interactions
Code Comparison
tRPC example:
import { initTRPC } from '@trpc/server';
const t = initTRPC.create();
const appRouter = t.router({
hello: t.procedure.query(() => 'Hello, tRPC!'),
});
ChadNext example:
import { NextApiRequest, NextApiResponse } from 'next';
export default function handler(req: NextApiRequest, res: NextApiResponse) {
res.status(200).json({ message: 'Hello, ChadNext!' });
}
While tRPC offers more robust type-safety and scalability, ChadNext provides a simpler setup for quick prototyping and smaller applications. tRPC is better suited for larger, more complex projects requiring strong typing and API consistency, whereas ChadNext excels in rapid development and ease of use for Next.js-based applications.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
ChadNext â¨
ChadNext is a quick starter template for Next.js projects, designed to streamline development by providing essential features out of the box. ð
Motivation ð
ChadNext addresses common pain points, making it easier to:
- Prototype and test ideas swiftly
- Access a beautifully designed UI library
- Implement simple authentication
- Interact with databases effortlessly
- Deploy with ease
Save time and effort, and build performant apps with an excellent developer experience.
Getting Started ð
- Clone the repo.
- Install dependencies:
pnpm install
- Copy
.env.example
file to.env
file. then follow the instructions inside. - Run
pnpm prisma db push
- Start the dev server:
pnpm dev
Or
Contributing ð¤
- Fork the repo.
- Create a branch.
- Make changes and commit.
- Push and create a pull request.
License ð
Author âï¸
Moinul Moin (@immoinulmoin)
Top Related Projects
Beautifully designed components that you can copy and paste into your apps. Accessible. Customizable. Open Source.
The best way to start a full-stack, typesafe Next.js app
An opinionated collection of components, hooks, and utilities for your Next.js project.
🔋 Next.js + Tailwind CSS + TypeScript starter and boilerplate packed with useful development features
🧙♀️ Move Fast and Break Nothing. End-to-end typesafe APIs made easy.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot