Skip to content

joshmu/videonote

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

405 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VideoNote

A video review app with slick intuitive controls to create timestamped notes on the fly. ✨

Tech Stack

Some additional experimental features are enabled in tailwind.config.js: uniformColorPalette, extendedSpacingScale, extendedFontSizeScale

Setup

  • MongoDB database
  • SMTP email server
  • JWT

Create a .env.local based on the .env.example for local development.

Run it

npm i && npm run dev

API conventions

Routes under pages/api/ use two small higher-order wrappers from utils/auth/withAuthenticatedUser.ts to keep authentication out of the handler bodies:

  • withAuthenticatedUser(handler) — required for routes that mutate user data (auth, user, settings, project). The handler receives a third ctx argument with { userDoc, email, newToken }. Missing/invalid tokens short-circuit with 401; missing users short-circuit with 401.
  • withOptionalUser(handler) — used by pages/api/note.ts, which allows guest note creation. The handler receives a discriminated ctx: either { isGuest: true, ... null } or the full authenticated context. A token that is present but invalid still 401s — there is no silent fallback to the guest branch.

Shared-project access goes through utils/share/sharePassword.ts:

  • hashSharePassword(plaintext) — used by pages/api/project.ts when creating or updating a Share document. Returns null for empty input.
  • verifySharePassword(storedHash, candidate) — used by pages/api/public_project.ts when reading a shared project. Returns a ShareAccessResult discriminated union: open | passwordRequired | incorrect | ok.

Note write-path goes through utils/note/noteIntake.ts:

  • upsertNote(input, authorId) — used by pages/api/note.ts. Creates if _id is not found, updates otherwise. On create also attaches the note id to its Project. Pass null for authorId to skip authorship (guest path).
  • removeDoneProjectNotes(projectId) — used by the same handler for the REMOVE_DONE_NOTES action; returns the surviving notes.

All three modules have unit tests under src/__test__/ that exercise behaviour through their public interface.

About

Slick video review note taking app 🎬

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors