mlim-usfca / PersonalKnowledge

https://personal-knowledge.vercel.app
0 stars 0 forks source link

Huimin/category #28

Closed Huimin22 closed 6 months ago

Huimin22 commented 7 months ago

Description

This PR implements the functionality to create new categories and save links according to categories for authenticated users after successful login.

Usage Instructions

Starting Supabase Service

  1. Start the Supabase service by navigating to the PersonalKnowledge/server directory:

    supabase start
  2. You need to update database. Run

    supabase migration list --db-url postgresql://postgres:postgres@127.0.0.1:54322/postgres 
    supabase migration up
    supabase db reset
  3. Retrieve relevant Supabase service information. Open the Studio URL to view database changes.

Starting Frontend Project

  1. Navigate to the PersonalKnowledge/web directory:
  2. Start the frontend project using npm:
    npm run dev
  3. Upon initial login, use Google OAuth.

Saving New Categories

  1. Click on the "New Category" button in the web application.
  2. Enter the new category and submit.
  3. You can check the categories table in the Supabase database to verify if the new category is saved successfully.
  4. Add the categories "Food," "Theory," and "Sport" to the categories table in the Supabase database to ensure that links can be saved under these categories.

Saving New Links

  1. Click the plus (+) button on the right to add a new link.
  2. Paste the link you want to save and select a link label.
  3. You can check the category_link_relation table and links table in the Supabase database to verify if the new link is saved with the corresponding category.

Potential Error

If you have error "Extract content failed", you can comment the code from line 43 to line 52 in newlink.tsx.

Feedback and Contributions

Any feedback and suggestions for this feature are welcome. Contributors are encouraged to submit pull requests or open issues for improvements.