This is a starter template for Next.js 14 and Supabase with SWR.
First, get this project by installing it:
```bash
npx degit greeenboi/nextjs-supabase-template <APP_NAME>
```
Create a .env.local
file in the root of the project and add the following environment variables:
NEXT_PUBLIC_SUPABASE_URL=https://<your_supabase_url>.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=<your_supabase_anon_key>
npm run dev
# or
pnpm run dev
Open http://localhost:3000 with your browser to see the result.
The repository includes the following features:
- Supabase authentication ( SWR )
- Shadcn UI for styling ( sonner has been setup too )
- SWR for data fetching
- prettier for code formatting
- eslint for code linting
- husky for pre-commit hooks ( goto #husky for more info )
- react-transition-progress for page transition loader
Husky is a tool that can prevent bad git commit
, git push
, and more. It can be used to run scripts (like linting, tests, etc.) before committing or pushing code.
This repository uses Husky to run eslint
and prettier
before committing code. If there are any errors, Husky will prevent the commit.
To Use Husky:
git add -A
git commit -m "Your commit message"
And Husky will run the pre-commit
script before committing the code.
To disable husky, remove the
lint-staged
field from thepackage.json
file and delete the.husky
folder.
This project is licensed under the MIT License - see the LICENSE file for details.
made with 💖 by greeenboi