Prompts:
- Would you like to use TypeScript?
Yes - Would you like to use ESLint?
Yes - Would you like to use Tailwind CSS?
Yes - Would you like to use
src/directory?No - Would you like to use App Router? (recommended)
Yes - Would you like to customize the default import alias (@/*)?
No - What import alias would you like configured?
@/*
npx create-next-app@latest . --typescriptSet the current Node.js version.
node -v > .nvmrcStart the development server.
npm run devSupabase CLI. Manage postgres migrations, run Supabase locally, deploy edge functions. Postgres backups. Generating types from your database schema.
npm install supabase --save-devUpdating the Supabase CLI.
npm update supabase --save-devLogin with your Personal Access Token:
npx supabase loginGenerate types without init.
npx supabase gen types typescript --project-id "YOUR_PROJECT_ID" --schema public > types/supabase.tsGenerate types with init.
npx supabase init
npx supabase link --project-ref YOUR_PROJECT_ID
npx supabase gen types typescript --linked > types/supabase.tsEdit package.json:
{
"scripts": {
"gen-types": "supabase gen types --lang=typescript --linked > types/supabase.ts"
}
}Generating Types.
npm run gen-typesWhen creating a database type in supabase.com
Api Docs>Introduction>Generating Types
Install Supabase packages.
npm install @supabase/supabase-js @supabase/ssrSet environment variables. Edit .env.local:
NEXT_PUBLIC_SUPABASE_URL=<your_supabase_project_url>
NEXT_PUBLIC_SUPABASE_ANON_KEY=<your_supabase_anon_key>Install Tailwind CSS.
npm install --save-dev tailwindcss postcss autoprefixer
npx tailwindcss init -pUsing 'clsx' or 'classnames' with 'tailwind-merge'.
npm install tailwindcss-animate class-variance-authority clsx tailwind-mergelib/utils/cn.ts:
import clsx, { ClassValue } from 'clsx';
import { twMerge } from 'tailwind-merge';
export const cn = (...classes: ClassValue[]) => twMerge(clsx(...classes));Beautifully designed components that you can copy and paste into your apps. Accessible.
npx shadcn-ui@latest initAdding dark mode.
npm install next-themesUse the add command to add components and dependencies to your project.
npx shadcn-ui@latest addHides content from the screen in an accessible way.
npm install @radix-ui/react-visually-hiddenAdd icon libraries.
npm install lucide-react @radix-ui/react-icons(Optional) If you are loading the lucide icon component dynamically, edit next.config.js.
module.exports = {
transpilePackages: ['lucide-react'],
}A simple TimePicker for your Shadcn UI project.
A fully-featured tag input component built with shadcn/ui.
npm install emblorInternationalization for react done right. Using the i18next i18n ecosystem.
npm install react-i18next i18next i18next-http-backendCustom trans component rendering for the client side.
import { useTrans } from '@/hooks/i18next'
const { trans } = useTrans()
export default function App() {
return (
<div>
{trans('key', {
components: {
i: <i />,
link1: <Link href="#" />,
},
values: { what: 'world' }
})}
</div>
)
}
// translation.json
// { "key": "hello <i>beautiful</i> <link1>{{what}}</link1>" }The configuration for i18next is i18next.config.ts.
Performant, flexible and extensible forms library for React Hooks.
npm install react-hook-form TypeScript-first schema validation with static type inference.
npm install zod @hookform/resolversUseful for translating zod error messages.
npm install zod-i18n-mapThe official, opinionated, batteries-included toolset for efficient Redux development.
npm install @reduxjs/toolkit react-reduxpersist and rehydrate a redux store.
npm install redux-persistReact Hooks for Data Fetching.
npm install swrZero config PWA plugin for Next.js, with workbox.
npm install next-pwaSend e-mails with Node.JS.
npm install nodemailer
npm install --save-dev @types/nodemailerInstall packages
npm install ckeditor5 @ckeditor/ckeditor5-reactShare target browsers between different front-end tools, like Autoprefixer, Stylelint and babel-preset-env.
npm install browserslistA small, fast and rich-API browser/platform/engine detector for both browser and node.
npm install bowserA collection of essential TypeScript types.
npm install type-festReact hook library, ready to use, written in Typescript.
npm install usehooks-tsA modern JavaScript utility library delivering modularity, performance, & extras.
npm install lodash @types/lodashDay.js 2kB immutable date-time library alternative to Moment.js with the same modern API.
npm install dayjsFlatten/unflatten nested Javascript objects.
npm install flatJsonWebToken implementation for node.js.
npm install jsonwebtoken @types/jsonwebtokenSlugifies a string
npm install slugifySvg react icons of popular icon packs.
npm install react-iconsVector (*.svg) country flag icons in 3:2 aspect ratio.
npm install country-flag-iconsGenerate massive amounts of fake data in the browser and node.js.
npm install @faker-js/faker