Full Project Setup (Vite):
Steps:
Ref: Vite Official
npm create vite@latest
Steps:
npm create vite@latest
Write project-name
Javascript + SWC
cd project-name
npm i
npm run dev
npm install react-router-dom
Steps:
-
To enable this option you’ll need to edit your .htaccess file adding the follow:
RewriteEngine onRewriteCond %{HTTP:Authorization} ^ (.) RewriteRule ^(.) - [E=HTTP_AUTHORIZATION:%1]
-
Add this line in wp-config.php file
define('JWT_AUTH_SECRET_KEY', 'your-top-secret-key');
Key Generator: You can use a string from here: https://api.wordpress.org/secret-key/1.1/salt/
- Configurate CORs Support:
To enable the CORs Support edit your wp-config.php file
define('JWT_AUTH_CORS_ENABLE', true);
Access jwt routes/ endpoints:
https://vitewp.com/wp-json/jwt-auth/v1
Ref: https://tailwindcss.com/docs/guides/vite#react
npm install -D tailwindcss postcss autoprefixer
npx tailwindcss init -p
Note:
Make sure that these two files are created:
Created Tailwind CSS config file: tailwind.config.js
Created PostCSS config file: postcss.config.js
Add this in tailwind.config.js
/** @type {import('tailwindcss').Config} */
export default {
content: [
"./index.html",
"./src/**/*.{js,ts,jsx,tsx}",
],
theme: {
extend: {},
},
plugins: [],
}
Add these lines in index.css
@tailwind base;
@tailwind components;
@tailwind utilities;
For Tailwind typography:
Ref: https://tailwindcss.com/docs/typography-plugin
npm install -D @tailwindcss/typography
Add this in tailwind.config.js
import twTypography from "./node_modules/@tailwindcss/typography";
Add dependency for typography:
(https://docs.google.com/document/d/1T_CbwAOwBtlsJwz-HIfJ5zsYIFKwZbSQGxlMmejNgEA/edit?usp=sharing)
Ref: https://daisyui.com/docs/install/
npm i -D daisyui@latest
Steps:
- Add this lines in tailwind.config.js
import daisyUI from "./node_modules/daisyui";
- Add it as dependency:
Ref: https://react-hook-form.com/get-started
npm install react-hook-form
Ref: https://axios-http.com/docs/intro
npm install axios
Ref: https://www.npmjs.com/package/vite-plugin-require
Install and use to achieve painless support require
npm i vite-plugin-require
Import and add it as dependency:
import vitePluginRequire from "vite-plugin-require";
export default defineConfig({
plugins: [react(), vitePluginRequire.default()],
})
Ref: https://www.npmjs.com/package/env-cmd
A simple node program for executing commands using an environment from an env file.
npm install env-cmd
or
npm install -g env-cmd