8000 GitHub - bjmoonn/bookmark
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

bjmoonn/bookmark

Repository files navigation

Bookmark: ITP 404 Final Project

Instructions

  • Clone the repo
  • Run npm install
  • Run json-server --watch db.json --port 3001
  • Run npm run dev

Criteria

Client-side routing with React Router

  • At least 4 routes: / (home), /folders, /tags, /settings
  • 2 routes with URL parameters: /folders/[id], /tags/[id]
  • Nested routes: Using Next.js app router with (routes) directory
  • Active links with unique styling: Navigation component shows active state

AJAX requests for each type

  • GET: Fetching linkPreview, bookmarks, tags, folders
  • POST: Creating new bookmarks, tags, folders
  • PATCH: Updating bookmarks, tags, folders
  • DELETE: Deleting bookmarks, tags, folders

API Resources and Relationships

  • 7 API Resources (/api/bookmarks, /api/tags, /api/folders, /api/collections, /api/wipe-db, /api/folders/[id], /api/tags/[id], /api/collections/[id], /api/bookmarks/[id])
  • 3 Relationships (bookmarks -> tags, bookmarks -> folders, bookmarks -> collections)

Form Elements

  • Input: Link/Tag/Folder creation field
  • Textarea: Summary field in LinkItem component
  • Select menu: Folder selection in BookmarkForm
  • Radio buttons: Settings page for wiping data
  • Checkbox: Tag selection in BookmarkForm

Custom Form Validation

  • Component state validation: LinkField component
  • Error messages: Shown below invalid fields
  • Form submission prevention: Invalid forms can't be submitted
  • Unique error messages: Different messages for different validation failures

Reusable Component

  • ListItem component used in multiple places: (Tags list, Folders list)
  • LinkItem component used in multiple places: (Bookmark list, tags/[id], folders/[id])
  • Configurable props: icon, color, title, subtitle, etc.

Document Title

  • Unique titles for different pages

Display Notifications

  • Display notifications using Sonner (similar to React Toastify, just prettier and easier to implement)

Additional Features

Since it's a bookmarking app, "Build a bookmarks / favorites system from scratch for some resource in your application. A user should be able to add and remove a particular resource from their bookmarks / favorites section. When you display the resource in the bookmarks / favorites section, display information about the resource and the date/time of when the item was bookmarked / favorited." is completed

Testing

11 tests, all passing.

Additional notes

  • Things not covered in class:
    • nextjs & app router (and NextRequest, the new params, etc)
    • testing with typescript (had to get jest scripts from stackoverflow)
    • sonner notifications (had to get sonner from npm, made the choice to use it instead of react toastify)
    • typescript & type interfaces & etc

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0