/papermark-next-prisma-vercel-blob-next-auth-resend-email

Works but needs further work. Papermark is the open-source DocSend alternative with built-in analytics and custom domains. With Next.js, Stripe, NextAuth, Vercel Blob Storage, Resend Email, Analytics, Cookies, Zod, React-pdf, TinyBird, React Charts

Primary LanguageTypeScriptGNU Affero General Public License v3.0AGPL-3.0

papermark-next-prisma-vercel-blob-next-auth-resend-email

🚀 Papermark is the open-source DocSend alternative with built-in analytics and custom domains. With Next.js, Stripe, NextAuth, Vercel Blob Storage, Resend Email, Analytics, Cookies, Zod, React-pdf, TinyBird, React Charts 🚀

https://github.com/coding-to-music/papermark-next-prisma-vercel-blob-next-auth-resend-email

https://papermark-next-prisma-vercel-blob-next-auth-resend-email.vercel.app

From / By https://github.com/mfts/papermark

https://www.papermark.io/

https://dev.to/mfts/build-an-expandable-data-table-with-2-shadcnui-components-4nge

https://github.com/mfts/gauge-demo

https://gauge-demo.vercel.app/

https://vercel.com/design/gauge

Tasks:

  • GitHub auth
  • Google auth
  • Tinybird
  • Resend emails
  • Vercel Blob (on waitlist)
  • Use Cloudflare R2 or AWS S3 blob
  • PDF Viewer
  • Light/Dark mode
  • Verify database table operations

Node Environment:

nvm use 18

Environment variables:

see .env.example

# NEXTAUTH_SECRET= # Linux: `openssl rand -hex 32` or go to https://generate-secret.now.sh/32

NEXTAUTH_SECRET=my-superstrong-secret
NEXTAUTH_URL=http://localhost:3000

# These variables are from Vercel Storage Postgres
POSTGRES_PRISMA_URL=
POSTGRES_URL_NON_POOLING=
# This variable is from Vercel Storage Blob
BLOB_READ_WRITE_TOKEN=

# Google client id and secret for authentication
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=

NEXT_PUBLIC_BASE_URL=http://localhost:3000

# This variable is from Resend to send emails
RESEND_API_KEY=

# This variable is from Tinybird to publish and read event data
TINYBIRD_TOKEN=

# These variables are from Vercel and used for setting up custom domains
PROJECT_ID_VERCEL=
TEAM_ID_VERCEL=
AUTH_BEARER_TOKEN=

GitHub

git init
git add .
git remote remove origin
git commit -m "first commit"
git branch -M main
git remote add origin git@github.com:coding-to-music/papermark-next-prisma-vercel-blob-next-auth-resend-email.git
git push -u origin main

Papermark

The open-source DocSend alternative.

Papermark - The open-source DocSend alternative | Product Hunt

papermark.io

GitHub Repo stars Twitter Follow License

Papermark is an open-source document sharing alternative to DocSend with built-in analytics. Built with Vercel Storage and Vercel Edge Functions.

Features

  • Shareable Links: Share your document securely by sending a custom link
  • Analytics: Get insights via document tracking and soon page-by-page analytics
  • Self-hosted, open-source: Host it yourself and hack on it

Demo

Papermark Welcome GIF

Tech Stack

Getting Started

Prerequisites

Here's what you need to be able to run Papermark:

1. Clone the repository

git clone https://github.com/mfts/papermark.git
cd papermark

2. Install npm dependencies

npm install

3. Copy the environment variables to .env

cp .env.example .env

4. Configure the variables in .env

Variable Value
NEXTAUTH_SECRET a random string
NEXTAUTH_URL < Your base domain or localhost:3000 >
POSTGRES_PRISMA_URL < Vercel Postgres Pooling URL >
POSTGRES_URL_NON_POOLING < Vercel Postgres Non-Pooling URL >
BLOB_READ_WRITE_TOKEN < Vercel Blob Token >
GOOGLE_CLIENT_ID < Google Client ID >
GOOGLE_CLIENT_SECRET < Google Client Secret >
RESEND_API_KEY < Resend API KEY >
NEXT_PUBLIC_BASE_URL < Your base domain or localhost:3000 >

5. Initialize the database

npx prisma generate
npx prisma db push

6. Run the dev server

npm run dev

7. Open the app in your browser

Visit http://localhost:3000 in your browser.

Deploy your own

All you need is a Vercel account and access to Vercel Storage (Blob and Postgres). Click the button below to clone and deploy:

Deploy with Vercel

Contributing

Papermark is an open-source project and we welcome contributions from the community.

If you'd like to contribute, please fork the repository and make changes as you'd like. Pull requests are warmly welcome.

Our Contributors ✨

Inspiration

...and friends

  • Dub - An open-source link shortener SaaS with built-in analytics + free custom domains