taxonomy
An open source application built using the new router, server components and everything new in Next.js 13.
Top Related Projects
The React Framework
A utility-first CSS framework for rapid UI development.
⚡️ Simple, Modular & Accessible UI Components for your React Applications
Material UI: Comprehensive React component library that implements Google's Material Design. Free forever.
Storybook is the industry standard workshop for building, documenting, and testing UI components in isolation
Radix Primitives is an open-source UI component library for building high-quality, accessible design systems and web apps. Maintained by @workos.
Quick Overview
Taxonomy is an open source application built using Next.js 13 and shadcn/ui. It serves as a comprehensive example of how to create a fully functional blog platform with features like authentication, API routes, and a rich text editor. The project showcases best practices for building modern web applications using the latest technologies.
Pros
- Demonstrates the use of cutting-edge technologies like Next.js 13 and shadcn/ui
- Provides a complete, production-ready blog application as a reference
- Includes advanced features such as authentication and a rich text editor
- Well-structured and maintainable codebase, serving as a learning resource
Cons
- May be overwhelming for beginners due to its complexity
- Requires familiarity with multiple technologies to fully understand the project
- Some features might be overkill for simpler blog implementations
- Frequent updates to underlying technologies may require maintenance
Code Examples
- Using the Card component from shadcn/ui:
import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "@/components/ui/card"
export function ExampleCard() {
return (
<Card>
<CardHeader>
<CardTitle>Card Title</CardTitle>
<CardDescription>Card Description</CardDescription>
</CardHeader>
<CardContent>
<p>Card Content</p>
</CardContent>
<CardFooter>
<p>Card Footer</p>
</CardFooter>
</Card>
)
}
- Implementing an API route in Next.js 13:
import { NextResponse } from "next/server"
import type { NextRequest } from "next/server"
export async function GET(request: NextRequest) {
const { searchParams } = new URL(request.url)
const id = searchParams.get("id")
const res = await fetch(`https://api.example.com/post/${id}`)
const data = await res.json()
return NextResponse.json({ data })
}
- Using the Editor component for rich text editing:
import { Editor } from "@/components/editor"
export function PostEditor() {
return (
<Editor
placeholder="Write your post content here..."
onUpdate={(editor) => {
console.log(editor.getHTML())
}}
/>
)
}
Getting Started
To get started with the Taxonomy project:
-
Clone the repository:
git clone https://github.com/shadcn-ui/taxonomy.git
-
Install dependencies:
cd taxonomy npm install
-
Set up environment variables:
cp .env.example .env.local
Edit
.env.local
with your own values. -
Run the development server:
npm run dev
-
Open http://localhost:3000 in your browser to see the application running.
Competitor Comparisons
The React Framework
Pros of Next.js
- Comprehensive full-stack React framework with built-in routing and server-side rendering
- Large ecosystem and community support, with extensive documentation and resources
- Seamless integration with Vercel for easy deployment and scaling
Cons of Next.js
- Steeper learning curve for developers new to React or server-side rendering concepts
- More complex setup and configuration compared to simpler UI libraries
- Potential performance overhead for smaller projects that don't require all features
Code Comparison
Next.js (pages router):
// pages/index.js
export default function Home() {
return <h1>Welcome to Next.js!</h1>
}
Taxonomy (React component):
// components/Header.tsx
export function Header() {
return <h1>Welcome to Taxonomy!</h1>
}
While Next.js provides a full-stack framework with built-in routing and server-side rendering capabilities, Taxonomy focuses on providing a set of accessible and customizable UI components. Next.js is better suited for large-scale applications requiring server-side rendering and complex routing, while Taxonomy is ideal for projects that need a quick start with pre-built, accessible UI components. The code comparison shows the simplicity of creating a basic component in both projects, with Next.js using its file-based routing system and Taxonomy utilizing standard React components.
A utility-first CSS framework for rapid UI development.
Pros of Tailwind CSS
- Highly customizable and flexible utility-first CSS framework
- Large and active community with extensive documentation and resources
- Seamless integration with various frontend frameworks and build tools
Cons of Tailwind CSS
- Steeper learning curve for developers new to utility-first CSS
- Can lead to verbose HTML markup with multiple utility classes
- Requires additional configuration for optimal performance in large projects
Code Comparison
Tailwind CSS:
<div class="bg-blue-500 text-white p-4 rounded-lg shadow-md">
<h2 class="text-2xl font-bold mb-2">Hello, Tailwind!</h2>
<p class="text-sm">This is a sample Tailwind component.</p>
</div>
Taxonomy:
import { Card, CardHeader, CardContent } from "@/components/ui/card"
<Card>
<CardHeader>Hello, Taxonomy!</CardHeader>
<CardContent>This is a sample Taxonomy component.</CardContent>
</Card>
Summary
While Tailwind CSS offers a highly flexible utility-first approach with extensive customization options, Taxonomy provides a more opinionated and component-based structure. Tailwind CSS has a larger community and ecosystem, but Taxonomy offers a potentially faster development experience for those familiar with its pre-built components. The choice between the two depends on project requirements, team preferences, and development style.
⚡️ Simple, Modular & Accessible UI Components for your React Applications
Pros of Chakra UI
- More mature and widely adopted, with a larger community and ecosystem
- Offers a comprehensive set of pre-built components out of the box
- Provides built-in dark mode support and color mode switching
Cons of Chakra UI
- Larger bundle size due to its comprehensive nature
- Steeper learning curve for customization and theming
- Less flexibility in terms of styling compared to Taxonomy's utility-first approach
Code Comparison
Chakra UI:
import { Box, Button } from "@chakra-ui/react"
function Example() {
return (
<Box bg="gray.100" p={4}>
<Button colorScheme="blue">Click me</Button>
</Box>
)
}
Taxonomy:
function Example() {
return (
<div className="bg-gray-100 p-4">
<button className="bg-blue-500 text-white px-4 py-2 rounded">
Click me
</button>
</div>
)
}
Taxonomy uses utility classes for styling, while Chakra UI relies on its own component props and theme system. Chakra UI provides more abstraction, whereas Taxonomy offers more direct control over styles through utility classes.
Material UI: Comprehensive React component library that implements Google's Material Design. Free forever.
Pros of Material-UI
- Extensive component library with a wide range of pre-built UI elements
- Strong community support and regular updates
- Comprehensive documentation and examples
Cons of Material-UI
- Larger bundle size due to the extensive component library
- Steeper learning curve for customization and theming
- More opinionated design system, which may limit flexibility
Code Comparison
Material-UI:
import { Button } from '@mui/material';
function MyComponent() {
return <Button variant="contained">Click me</Button>;
}
Taxonomy:
import { Button } from '@/components/ui/button';
function MyComponent() {
return <Button>Click me</Button>;
}
Key Differences
- Material-UI offers a more comprehensive set of components out-of-the-box
- Taxonomy focuses on providing a minimal, customizable foundation
- Material-UI uses a more complex theming system, while Taxonomy relies on Tailwind CSS for styling
- Taxonomy encourages copying and modifying components, whereas Material-UI is designed for direct use
Use Cases
- Material-UI: Ideal for large-scale applications requiring a consistent design system
- Taxonomy: Better suited for projects needing high customization and a lightweight foundation
Storybook is the industry standard workshop for building, documenting, and testing UI components in isolation
Pros of Storybook
- Extensive ecosystem with a wide range of addons and integrations
- Supports multiple frameworks and libraries (React, Vue, Angular, etc.)
- Robust documentation and large community support
Cons of Storybook
- Steeper learning curve and more complex setup
- Can be overkill for smaller projects or simpler UI components
- Potentially slower build times due to its comprehensive nature
Code Comparison
Taxonomy (Next.js component):
export function Component() {
return (
<div className="flex items-center space-x-2">
<Button>Click me</Button>
<p>Simple component</p>
</div>
)
}
Storybook (Story file):
export default {
title: 'Example/Button',
component: Button,
};
const Template = (args) => <Button {...args} />;
export const Primary = Template.bind({});
Primary.args = {
primary: true,
label: 'Button',
};
Summary
Taxonomy is a lightweight, Next.js-focused UI component library, while Storybook is a comprehensive tool for developing and documenting UI components across various frameworks. Taxonomy offers simplicity and ease of use for Next.js projects, whereas Storybook provides a more robust, framework-agnostic solution with extensive features and customization options.
Radix Primitives is an open-source UI component library for building high-quality, accessible design systems and web apps. Maintained by @workos.
Pros of Primitives
- Offers a comprehensive set of unstyled, accessible UI components
- Provides greater flexibility and customization options
- Maintained by a dedicated team at WorkOS
Cons of Primitives
- Requires more setup and configuration to get started
- Steeper learning curve for beginners
- Less opinionated, which may lead to inconsistent designs across projects
Code Comparison
Primitives:
import * as Dialog from '@radix-ui/react-dialog';
<Dialog.Root>
<Dialog.Trigger>Open</Dialog.Trigger>
<Dialog.Content>
<Dialog.Title>Dialog Title</Dialog.Title>
<Dialog.Description>Dialog content goes here</Dialog.Description>
</Dialog.Content>
</Dialog.Root>
Taxonomy:
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, DialogTrigger } from "@/components/ui/dialog"
<Dialog>
<DialogTrigger>Open</DialogTrigger>
<DialogContent>
<DialogHeader>
<DialogTitle>Dialog Title</DialogTitle>
<DialogDescription>Dialog content goes here</DialogDescription>
</DialogHeader>
</DialogContent>
</Dialog>
Taxonomy builds upon Primitives, offering pre-styled components with a consistent design language. It provides a quicker setup and easier implementation for developers who prefer a more opinionated approach. However, it may be less flexible for highly custom designs compared to Primitives.
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
Taxonomy
An open source application built using the new router, server components and everything new in Next.js 13.
Warning This app is a work in progress. I'm building this in public. You can follow the progress on Twitter @shadcn. See the roadmap below.
About this project
This project as an experiment to see how a modern app (with features like authentication, subscriptions, API routes, static pages for docs ...etc) would work in Next.js 13 and server components.
This is not a starter template.
A few people have asked me to turn this into a starter. I think we could do that once the new features are out of beta.
Note on Performance
Warning This app is using the unstable releases for Next.js 13 and React 18. The new router and app dir is still in beta and not production-ready. Expect some performance hits when testing the dashboard. If you see something broken, you can ping me @shadcn.
Features
- New
/app
dir, - Routing, Layouts, Nested Layouts and Layout Groups
- Data Fetching, Caching and Mutation
- Loading UI
- Route handlers
- Metadata files
- Server and Client Components
- API Routes and Middlewares
- Authentication using NextAuth.js
- ORM using Prisma
- Database on PlanetScale
- UI Components built using Radix UI
- Documentation and blog using MDX and Contentlayer
- Subscriptions using Stripe
- Styled using Tailwind CSS
- Validations using Zod
- Written in TypeScript
Roadmap
-
Add MDX support for basic pages -
Build marketing pages -
Subscriptions using Stripe -
Responsive styles -
Add OG image for blog using @vercel/og - Dark mode
Known Issues
A list of things not working right now:
GitHub authentication (use email)Prisma: Error: ENOENT: no such file or directory, open '/var/task/.next/server/chunks/schema.prisma'Next.js 13: Client side navigation does not update head- Cannot use opengraph-image.tsx inside catch-all routes
Why not tRPC, Turborepo or X?
I might add this later. For now, I want to see how far we can get using Next.js only.
If you have some suggestions, feel free to create an issue.
Running Locally
- Install dependencies using pnpm:
pnpm install
- Copy
.env.example
to.env.local
and update the variables.
cp .env.example .env.local
- Start the development server:
pnpm dev
License
Licensed under the MIT license.
Top Related Projects
The React Framework
A utility-first CSS framework for rapid UI development.
⚡️ Simple, Modular & Accessible UI Components for your React Applications
Material UI: Comprehensive React component library that implements Google's Material Design. Free forever.
Storybook is the industry standard workshop for building, documenting, and testing UI components in isolation
Radix Primitives is an open-source UI component library for building high-quality, accessible design systems and web apps. Maintained by @workos.
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