codex-lv3-may-2025

Level Navigation: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19⚑ 20

Level 2: Project Setup

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.


What You’ll Do

Create a new React project using Vite and install the Supabase client library.

Instructions

See here for installation details: Install Supabase Client

πŸ’‘ Code Hints

Need help with project setup? Check out these snippets:

Show Me: Creating the project
npm create vite@latest practice-with-db -- --template react
cd practice-with-db
npm install
Show Me: Installing Supabase
npm install @supabase/supabase-js
Show Me: Project structure
practice-with-db/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   └── PotluckMeals.jsx
β”‚   β”œβ”€β”€ utils/
β”‚   β”‚   └── supabase.js
β”‚   β”œβ”€β”€ App.jsx
β”‚   └── main.jsx
β”œβ”€β”€ package.json
└── README.md

πŸ” Diving Deeper

Why do we need these libraries?

Where do these libraries go?

When you run npm install, npm:

  1. Downloads the libraries from the npm registry
  2. Stores them in the node_modules/ folder in your project
  3. Updates your package.json file to record the dependencies

How to verify installation:

  1. Check package.json: Open your package.json file and look for the dependencies section:
    {
      "dependencies": {
        "@supabase/supabase-js": "^2.x.x",
        "tslib": "^2.x.x"
      }
    }
    
  2. Check node_modules/: Look in your project folder for a node_modules/ directory. Inside, you should see folders named @supabase and tslib.

  3. Verify in terminal: Run npm list to see all installed packages and their versions.

βœ… Check

  1. Run npm run dev to start your development server
  2. Open your browser to http://localhost:5173
  3. You should see the default Vite + React welcome page
  4. Check that @supabase/supabase-js is listed in your package.json dependencies
  5. Open your project folder in VS Code and verify you can see the basic file structure