This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
Currently, two official plugins are available:
- @vitejs/plugin-react uses Babel (or oxc when used in rolldown-vite) for Fast Refresh
- @vitejs/plugin-react-swc uses SWC for Fast Refresh
The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see this documentation.
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
export default defineConfig([
globalIgnores(['dist']),
{
files: ['**/*.{ts,tsx}'],
extends: [
// Other configs...
// Remove tseslint.configs.recommended and replace with this
tseslint.configs.recommendedTypeChecked,
// Alternatively, use this for stricter rules
tseslint.configs.strictTypeChecked,
// Optionally, add this for stylistic rules
tseslint.configs.stylisticTypeChecked,
// Other configs...
],
languageOptions: {
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
// other options...
},
},
])- Copy
.env.exampleto.env. - Add your Supabase project values:
VITE_SUPABASE_URLVITE_SUPABASE_ANON_KEY
- Optional:
VITE_SUPABASE_AUTH_REDIRECT_URL=http://localhost:5173/getting-started
- In Supabase Auth > URL Configuration, set:
- Site URL:
http://localhost:5173 - Redirect URLs: add
http://localhost:5173/getting-started(or your value fromVITE_SUPABASE_AUTH_REDIRECT_URL)
- In Supabase Auth > Providers > GitHub, enable the provider.
- In your GitHub OAuth App, set:
- Homepage URL:
http://localhost:5173(for local dev) - Authorization callback URL:
https://<your-project-id>.supabase.co/auth/v1/callback
- Sign in from
/getting-started; on success, the app redirects to/dashboardand loads your GitHub user profile + repositories.
Supabase is not configured yet:.envstill has placeholder values. Replace with real project values.redirect_to is not allowed: add the exact redirect URL to Supabase Redirect URLs.The redirect_uri is not associated with this application: in GitHub OAuth App settings, callback URL does not exactly match Supabase callback URL. Set it tohttps://<your-project-id>.supabase.co/auth/v1/callback.Error getting user profile from external provider: ensure GitHub OAuth is configured in Supabase with the correct Client ID/Secret, and login requests includeuser:emailscope.- Login succeeds but returns to login page: ensure callback returns to
/getting-startedand the app is running on the same origin.
You can also install eslint-plugin-react-x and eslint-plugin-react-dom for React-specific lint rules:
// eslint.config.js
import reactX from 'eslint-plugin-react-x'
import reactDom from 'eslint-plugin-react-dom'
export default defineConfig([
globalIgnores(['dist']),
{
files: ['**/*.{ts,tsx}'],
extends: [
// Other configs...
// Enable lint rules for React
reactX.configs['recommended-typescript'],
// Enable lint rules for React DOM
reactDom.configs.recommended,
],
languageOptions: {
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
// other options...
},
},
])