| Level Navigation: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19β‘ | 20 |
Goal: Set up your development environment with Vite and React.
User Story: As a developer, I want to create a new React project and install dependencies so that I can start building my potluck management app.
Create a new React project using Vite and install the Supabase client library.
npm create vite@latest practice-with-db -- --template reactcd practice-with-dbnpm installnpm install @supabase/supabase-jsnpm install tslibnpm run devSee here for installation details: Install Supabase Client
Need help with project setup? Check out these snippets:
npm create vite@latest practice-with-db -- --template react
cd practice-with-db
npm install
npm install @supabase/supabase-js
practice-with-db/
βββ src/
β βββ components/
β β βββ PotluckMeals.jsx
β βββ utils/
β β βββ supabase.js
β βββ App.jsx
β βββ main.jsx
βββ package.json
βββ README.md
Why do we need these libraries?
@supabase/supabase-js: This is the official JavaScript client library for Supabase. It provides all the functions we need to connect to our database, perform queries, and handle authentication. Without it, weβd have to write complex HTTP requests manually.
tslib: This is a TypeScript runtime library that Supabase depends on. Even though weβre using JavaScript, Supabaseβs internal code uses TypeScript features, so we need this library to support those features.
Where do these libraries go?
When you run npm install, npm:
node_modules/ folder in your projectpackage.json file to record the dependenciesHow to verify installation:
package.json: Open your package.json file and look for the dependencies section:
{
"dependencies": {
"@supabase/supabase-js": "^2.x.x",
"tslib": "^2.x.x"
}
}
Check node_modules/: Look in your project folder for a node_modules/ directory. Inside, you should see folders named @supabase and tslib.
npm list to see all installed packages and their versions.npm run dev to start your development serverhttp://localhost:5173@supabase/supabase-js is listed in your package.json dependencies