Giter Site home page Giter Site logo

pet-comments's Introduction

Pet Comments Supabase: Detail Page with Related Data

The Golden Rule:

🦸 πŸ¦Έβ€β™‚οΈ Stop starting and start finishing. 🏁

If you work on more than one feature at a time, you are guaranteed to multiply your bugs and your anxiety.

Work incrementally, being fully done, one small step at a time!

Demo

Use this template for this deliverable.

Live Example:

Demo

Setup Supabase

You have three options for which supabase project to use:

  1. Use the shared supabase project by sticking with the URL and KEY already in fetch-utils.js
  2. If you already have your own supabase pet-lover project instance, you can Run the db.sql setup scripts to add the new comments table
  3. Create a new supabase project:
    1. Run the db-part-1.sql setup scripts
    2. Run the db.sql setup scripts

Having your own project will enable you to inspect the result of uploading images and inserting data rows. With option #2 or #3, make sure to update your URL and KEY

Requirements

For this deliverable, use the provided application code. Auth is already provided.

Your job is to add:

  • A. Add links from the pet list page to the detail for each pet
  • B. Create a pet detail page that dynamically loads a pet based on the id search param
  • C. Add the ability for users to leave comments on a pet detail

Part A: Add links to the pet items on list page

  • render-utils.js - add link that goes to pet detail page

When complete, your pet items in the list should link to the pet detail page with the ?id=34 search param

Part B: Load Pet Detail

  • fetch-utils.js - export a function to get a pet by id
  • pet.js - import fetch-util function, get detail on load, displayPet info

When complete, the pet detail page should show the selected pet name, image, and bio

Part C: Pet Comments

  • fetch-utils.js
    • add a create comment function
    • change getPet to also returned the joined comment rows
  • pet.js
    • import create comment, add load logic, display comments, add new comment

Your UI should be showing visual results.

Schema

Storage bucket

The name of the storage bucket is images

Data Model

Here is the schema for the pets table in supabase:

Data Model

Rubric

The following is required for your assignment to be graded:

  • PR open from dev to main
  • PR Passes CI (lint + tests)
  • PR preview on netlify
Commit with Working Feature... Points
Pet items link to pet detail page 2
View pet detail 2
Redirect on no/bad id 1
Add and view pet comments 5

pet-comments's People

Contributors

rioredwards avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.