β¨ We are preparing a new version with Next.js 13 /app router, you can see the progress here: nextβ¨
π€ What is T3 Stack?
The T3 Stack is a web development stack made by Theo focused on simplicity, modularity, and full-stack typesafety. This project is using:
β Bootstrapping: create-t3-app.β Framework: Nextjs 13 + Typescript.- β Auth: Next-Auth.js
β ORM: Prisma.β Database: Planetscale.- β Styling: TailwindCSS + HeadlessUI.
β Typescript Schema Validation: Zod.β End-to-end typesafe API: tRPC.β Safely serialize JavaScript expressions: Superjson.
π¦ Project structure
- prisma
- public
- src
|- components
|- env
|- layout
|- motions
|- pages
|- schema
|- server
|- styles
|- types
|- ui
|- utils
π¨βπ Getting Started
π§ You will need Nodejs +16 (LTS recommended) installed.
- Fork this project:
- Clone the repository:
git clone [email protected]:YOU_USER/slug.git
- Install dependencies:
npm install
# or
pnpm install
# or
yarn install
# or
ultra install
- Create a .env file with the following content:
π§ The environment variables must match the following schema.
# Planetscale DB URL:
DATABASE_URL:
# Github OAuth secrets:
GITHUB_ID:
GITHUB_CLIENT_SECRET:
# Next Auth config:
NEXTAUTH_SECRET:
NEXTAUTH_URL:
π How to get environment variables:
Planetscale database:
- Create a new database.
- Create a dev branch.
- In the dev branch, click on "Connect" and select "Prisma". Now you have the DATABASE_URL.
π§ The environment variable in the dev branch is not the same as main. When you deploy your app to production, in the environment variables change DATABASE_URL to the main variable.
Github OAuth:
- Click here to create new Github OAuth app.
- Go to "Client secrets" and generate new client secret and and paste it into GITHUB_CLIENT_SECRET env.
- Copy the Client ID and paste it into GITHUB_ID env.
Next Auth:
- NEXTAUTH_SECRET:
mykey123
for example. - NEXTAUTH_URL:
http://localhost:3000/
.
- Ready
π₯³ , now run:
# Push your DB to Planetscale:
npx prisma db push
# Run the project:
npm run dev
# (Optional) Run Prisma Studio to see your DB data:
npx prisma studio
π Contributing:
π Deploy on Vercel
π License
- MIT.