Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Next.js 13.4 #117

Merged
merged 9 commits into from
Jun 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
6 changes: 0 additions & 6 deletions .babelrc

This file was deleted.

18 changes: 0 additions & 18 deletions .editorconfig

This file was deleted.

33 changes: 33 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# -----------------------------------------------------------------------------
# App
# -----------------------------------------------------------------------------
NEXT_PUBLIC_APP_URL=http://localhost:3000

# -----------------------------------------------------------------------------
# Authentication (NextAuth.js)
# -----------------------------------------------------------------------------
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=

GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=

# -----------------------------------------------------------------------------
# Database (MySQL - PlanetScale)
# -----------------------------------------------------------------------------
DATABASE_URL="mysql://root:root@localhost:3306/taxonomy?schema=public"

# -----------------------------------------------------------------------------
# Email (Postmark)
# -----------------------------------------------------------------------------
SMTP_FROM=
POSTMARK_API_TOKEN=
POSTMARK_SIGN_IN_TEMPLATE=
POSTMARK_ACTIVATION_TEMPLATE=

# -----------------------------------------------------------------------------
# Subscriptions (Stripe)
# -----------------------------------------------------------------------------
STRIPE_API_KEY=
STRIPE_WEBHOOK_SECRET=
STRIPE_PRO_MONTHLY_PLAN_ID=
69 changes: 0 additions & 69 deletions .eslintrc

This file was deleted.

11 changes: 0 additions & 11 deletions .github/dependabot.yml

This file was deleted.

16 changes: 7 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,18 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# local env files
.env*.local
.env
.env.local
.env.development.local
.env.test.local
.env.production.local

# vercel
.vercel

# package lock
package-lock.json
# typescript
*.tsbuildinfo
next-env.d.ts

# PWA
public/sw.js
public/workbox-*.js
.vscode
.contentlayer
1 change: 0 additions & 1 deletion .husky/.gitignore

This file was deleted.

4 changes: 0 additions & 4 deletions .husky/pre-commit

This file was deleted.

4 changes: 0 additions & 4 deletions .husky/prepare-commit-msg

This file was deleted.

7 changes: 0 additions & 7 deletions .lintstagedrc.json

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE → LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 Zac Zajdel
Copyright (c) 2022 shadcn

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
127 changes: 70 additions & 57 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,77 +1,90 @@
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
# Taxonomy

## Features
An open source application built using the new router, server components and
everything new in Next.js 13.

- [React.js 18](https://reactjs.org/blog/2022/03/29/react-v18.html)
- [Next.js 13](https://nextjs.org/blog/next-12)
- [Typescript 4](https://www.typescriptlang.org/)
- [Tailwind CSS 3](https://tailwindcss.com/docs/)
- [Eslint 7](https://eslint.org/docs/user-guide/getting-started)
- [Prettier 2](https://prettier.io/docs/en/index.html)
- [Husky 7](https://typicode.github.io/husky/#/)
- [Lint Staged 13](https://github.com/okonet/lint-staged)
> **Warning** This app is a work in progress. I'm building this in public. You
> can follow the progress on Twitter [@shadcn](https://twitter.com/shadcn). See
> the roadmap below.
## Usage
## About this project

This project using node >= 16.14.2 & yarn
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.

### Installation
**This is not a starter template.**

```bash
git clone https://github.com/Zac-Zajdel/PrismaNext.git
```
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.

```bash
yarn install
```
## Note on Performance

## Setup Prisma
> **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](https://twitter.com/shadcn).
Create a `.env` file and setup DATABASE_URL variable for example:
## Features

```bash
DATABASE_URL="mysql://root:password@localhost:3306/next"
- 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

- [x] ~Add MDX support for basic pages~
- [x] ~Build marketing pages~
- [x] ~Subscriptions using Stripe~
- [x] ~Responsive styles~
- [x] ~Add OG image for blog using @vercel/og~
- [x] Dark mode

## Known Issues

A list of things not working right now:

1. ~GitHub authentication (use email)~
2. ~[Prisma: Error: ENOENT: no such file or directory, open '/var/task/.next/server/chunks/schema.prisma'](https://github.com/prisma/prisma/issues/16117)~
3. ~[Next.js 13: Client side navigation does not update head](https://github.com/vercel/next.js/issues/42414)~
4. [Cannot use opengraph-image.tsx inside catch-all routes](https://github.com/vercel/next.js/issues/48162)

## Running Locally

1. Install dependencies using yarn:

```sh
yarn install
```

Run the following command to create generate Schema & Migration & Seed Table
2. Copy `.env.example` to `.env.local` and update the variables.

```bash
yarn prisma migrate dev --name init
```sh
cp .env.example .env.local
```

#### Development
3. Start the development server:

```bash
```sh
yarn dev
```

Reset your database to generate your own migration:

```bash
yarn prisma migrate reset
```

If you change the seeder file, you can easily run the seeder with the following:

```bash
yarn prisma db seed
```
## License

#### Production

```bash
npm run build or yarn build
yarn start
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file.

[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/user](http://localhost:3000/api/user). This endpoint can be edited in `pages/api/user.ts`.

The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.

```
```
Licensed under the
[MIT license](https://github.com/shadcn/taxonomy/blob/main/LICENSE.md).
7 changes: 7 additions & 0 deletions app/(auth)/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
interface AuthLayoutProps {
children: React.ReactNode
}

export default function AuthLayout({ children }: AuthLayoutProps) {
return <div className="min-h-screen">{children}</div>
}
Loading