Skip to content

Latest commit

 

History

64 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Note Keeper

Note Keeper is a shared note-taking app for writing and editing notes together in real time. Invite another registered user to a note, work in the same document, and let Automerge reconcile concurrent changes across connected browsers.

Hosted services

Service URL
Web app tappz-gamma.vercel.app
HTTP API tappz-api
WebSocket sync server wss://tappz-ws-fl3vm4p4lq-uc.a.run.app
Architecture documentation Eraser workspace

Hosted endpoints are listed for convenience and may not always be available.

Collaborate on notes

  • Invite by username. Note owners can add registered users from the note itself.
  • Edit together. Invited contributors can open and update the same shared document.
  • Merge concurrent changes. Automerge synchronizes document updates without relying on last-write-wins behavior.
  • Keep access scoped to collaborators. The sync server checks that each sender owns or contributes to the requested note.
  • See who has access. Contributor avatars identify the note owner and invited collaborators.
  • Continue from the browser. IndexedDB stores local Automerge data, while the WebSocket service synchronizes it with other clients.

How collaboration works

flowchart LR
    A["Next.js client<br/>ProseMirror + Automerge"]
    B["Cloud Functions<br/>users, notes, invitations"]
    C["Cloud Run WebSocket server<br/>real-time document sync"]
    D["Firestore<br/>notes and Automerge data"]
    E["Redis<br/>collaboration and access cache"]

    A -->|"HTTP"| B
    A <-->|"Automerge changes over WebSocket"| C
    B <--> D
    B <--> E
    C <--> D
    C <--> E
Loading
  1. A note owner creates a note and receives an Automerge document ID.
  2. The owner invites registered users by username through the HTTP API.
  3. Each collaborator opens the same note and connects to the WebSocket sync server.
  4. Automerge and ProseMirror reconcile edits, while the server validates document access before relaying changes.
  5. Firestore persists application and document data; Redis caches collaboration and note-access information.

Architecture

The repository contains two applications:

  • web/ — a Next.js client with a ProseMirror editor, Automerge React hooks, WebSocket and broadcast-channel networking, and IndexedDB persistence.
  • backend/ — an Express API deployed through Google Cloud Functions plus an Automerge WebSocket sync service deployed on Cloud Run. Firestore provides persistence and Redis supports caching and access checks.

Technology stack

Area Technologies
Frontend Next.js 14, React 18, TypeScript, Tailwind CSS, Radix UI
Collaborative editor ProseMirror, Automerge Repo, WebSockets, IndexedDB
API Express, Firebase Functions, Zod
Persistence Google Cloud Firestore
Cache and access data Redis / Google Cloud Memorystore
Infrastructure Google Cloud Run, Cloud Functions, Cloud Build, Firebase

Local development

Prerequisites

  • Node.js 18 or newer
  • pnpm for the web app
  • Yarn for the backend
  • A running Redis instance
  • Google Application Default Credentials with access to a Firestore project
  • An OpenAI API key for the backend formatting endpoint

1. Configure the backend

Create backend/.env:

NODE_ENV=development
REDIS_URL=redis://localhost:6379
OPENAI_API_KEY=your_openai_api_key
GOOGLE_APPLICATION_CREDENTIALS=/absolute/path/to/service-account.json

Install dependencies:

cd backend
yarn install

Start the HTTP API on port 8181:

yarn watch:functions

In another terminal, start the WebSocket sync server on port 3030:

cd backend
yarn watch:ws

2. Configure the web app

Create web/.env.local:

NEXT_PUBLIC_BACKEND_BASE_URL=http://localhost:8181
NEXT_PUBLIC_WS_URL=ws://localhost:3030

Install dependencies and start Next.js:

cd web
pnpm install
pnpm dev

Open http://localhost:3000.

Deployment

The backend deployment expects Google Cloud resources for Firestore, Cloud Run, Cloud Functions, Secret Manager, Memorystore for Redis, and a Serverless VPC Access connector. Review the substitutions in backend/cloudbuild.yaml before deploying.

From backend/, deploy the Firestore indexes and submit the Cloud Build configuration with:

chmod +x ./bin/deploy.sh
./bin/deploy.sh

The deployment script requires authenticated firebase and gcloud CLIs. Store OPENAI_API_KEY in Secret Manager for the production API.

Repository structure

.
├── backend/   # HTTP API, collaboration access control, sync server, and cloud deployment
├── web/       # Next.js application and collaborative editor
└── README.md  # Project overview and setup guide

Licensing

This repository does not currently include a project-wide root license. Review backend/LICENSE before reusing backend code.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages