This is a Next.js project
Step 0 (If not yet installed )
npm i
Step 1: Run, Barry, Run!
npm run dev
Step 2: Party Hard! (in local)
npm i -D @typescript-eslint/parser @typescript-eslint/eslint-plugin
npm i -D prettier eslint-config-prettier eslint-plugin-prettier eslint-plugin-import-helpers
{
"extends": [
"next/core-web-vitals",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
"prettier"
],
"plugins": ["@typescript-eslint", "eslint-plugin-import-helpers"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2021,
"sourceType": "module"
},
"rules": {
"import-helpers/order-imports": [
"warn",
{
"newlinesBetween": "always",
"groups": [
["/^next/", "module"],
"/^@/styles/",
"/^@/components/",
"/^@/lib/",
["parent", "sibling", "index"]
],
"alphabetize": {
"order": "asc",
"ignoreCase": true
}
}
]
}
}
{
"semi": true,
"singleQuote": true,
"trailingComma": "all",
"printWidth": 120,
"tabWidth": 2
}
.next
next-env.d.ts
node_module
public
yarn.lock
package-lock.json
"scripts":{
"eslint:format": "eslint --fix .",
"prettier:format": "prettier --write .",
"prettier:check": "prettier --check .",
}
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
-
Create the env variables on vercel
-
Link the local code with vercel
npx vercel link
- Pull the env file
npx vercel env pull ./.env.local
npm install mongoose --save
| https://mongoosejs.com/docs/nextjs.html
Create
npm install mongoose --save
Read
npm install mongoose --save
Update
npm install mongoose --save
Delete
npm install mongoose --save
| https://zod.dev/?id=basic-usage
Example:
npm install mongoose --save
| npm install react-hook-form
Example: