This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
- Node.js (version 18.0 or higher)
- npm or Yarn
- A GitHub account
- Visit Supabase and click "Start Your Project"
- Sign up using GitHub, Google, or email
- Verify your email address
- Log in to the Supabase Dashboard
- Click "New Project"
- Choose a unique project name
- Set up your database password
- Select your region
- Go to Project Settings (gear icon)
- Navigate to the "API" section
- Look for the "Project URL"
- It looks like:
https://your-project-id.supabase.co
- Find the "anon (public)" key under "Project API Keys"
Create a .env
file in your project root:
VITE_SUPABASE_URL=your_supabase_project_url
VITE_SUPABASE_ANON_KEY=your_supabase_anon_key
Note: Prefix Vite environment variables with VITE_
For production applications, update ESLint configuration:
- Configure
parserOptions
:
export default tseslint.config({
languageOptions: {
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
},
})
- Update ESLint configs:
- Replace
tseslint.configs.recommended
withtseslint.configs.recommendedTypeChecked
- Optionally add
...tseslint.configs.stylisticTypeChecked
Install eslint-plugin-react:
npm install -D eslint-plugin-react
Update eslint.config.js
:
import react from 'eslint-plugin-react'
export default tseslint.config({
settings: {
react: { version: '18.3' }
},
plugins: {
react,
},
rules: {
...react.configs.recommended.rules,
...react.configs['jsx-runtime'].rules,
},
})
- @vitejs/plugin-react uses Babel for Fast Refresh
- @vitejs/plugin-react-swc uses SWC for Fast Refresh
- Ensure environment variables are correctly set
- Check Supabase project status
- Verify network configurations
- Review Supabase and Vite documentation for the latest updates