Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

108 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Docbase

An open-source alternative to DocSend for securely sharing documents with tracking and analytics.

✨ Features

Document Sharing & Security

  • πŸ“„ Secure PDF Sharing - Upload and share PDFs with password protection and expiration dates
  • πŸ”— Multiple Links Per Document - Create different links with different settings for the same document
  • πŸ”„ Clone Links - Duplicate existing links with one click to create variations
  • πŸ” Access Control - Email verification, password protection, and self-hosted signup controls
  • 🎨 Custom Branding - Add logos, cover letters, and signatures to shared documents
  • πŸ“± Responsive Viewer - Beautiful slideshow and document modes that work on all devices

Signatures & Agreements

  • ✍️ E-Signatures - Request and collect legally binding signatures on documents
  • πŸ“‹ Signature Tracking - Track signature status and audit trails
  • πŸ–ŠοΈ Multiple Signature Methods - Draw, upload, or type signatures
  • βš–οΈ NDA & Contract Ready - Perfect for NDAs, contracts, and legal agreements

Analytics & Tracking

  • 🏠 Home Dashboard - Aggregated overview of all your documents and activity
  • πŸ“Š View Analytics - Track who views your documents, when, and for how long
  • ⏱️ Page-Level Tracking - See time spent on each page with engagement insights
  • πŸ‘₯ Contact Management - Organize contacts with groups
  • πŸ“ˆ Engagement Insights - Detailed analytics for each shared link
  • πŸ”” Notifications - Get notified when documents are viewed or signed
  • πŸ“ˆ Timeline Charts - 30-day views history and trends

Communication

  • βœ‰οΈ Email Integration - Send documents via email with magic links (powered by Resend)
  • πŸ’¬ Slack Integration - Get notifications in Slack when documents are viewed or signed
  • 🎯 Personalized Emails - Custom email templates with your branding

Privacy & Control

  • πŸ”’ Privacy First - Row-level security and encrypted passwords
  • 🏒 Self-Hosted Ready - Full control over your data and users
  • 🚫 Disable Signups - Control who can create accounts on your instance
  • πŸ“¦ Open Source - MIT licensed, transparent, and community-driven

Quick Start

1. Clone the repository

git clone https://github.com/alanagoyal/docbase
cd docbase

2. Run the Setup Wizard

We've created an interactive setup wizard to make configuration easy:

npm run setup

The wizard will:

  • βœ… Guide you through all required environment variables
  • βœ… Provide links to get API keys
  • βœ… Validate your inputs
  • βœ… Create your .env file automatically
  • βœ… Show you next steps

Or manually create .env:

If you prefer to configure manually, copy env.example to .env and fill in your values.

3. Install Dependencies

npm install

4. Set up Supabase Database

  1. Create a Supabase project
  2. Link to your project and push migrations:
npx supabase login
npx supabase link
npx supabase db push
  1. Create storage bucket:

    • Go to Supabase Dashboard > Storage
    • Create a new public bucket named cube
  2. Important: Apply additional migrations for advanced features:

    • See SETUP.md for detailed migration instructions
    • Required for: Home dashboard, page-level tracking, and document consolidation

5. Start Development Server

npm run dev

Your app will be running at http://localhost:3000

Tech Stack

  • Frontend: Next.js 14 (App Router), TypeScript, Tailwind CSS, shadcn/ui
  • Backend: Supabase (PostgreSQL + Auth + Storage)
  • Email: Resend
  • AI: OpenAI GPT-4o-mini
  • Monitoring: Braintrust (optional)
  • Integrations: Slack, Google Maps

Required Services

Core (Required)

  • Supabase - Database, authentication, and file storage (Sign up)
    • PostgreSQL database with Row Level Security
    • Authentication with magic links and email/password
    • Storage buckets for PDF files

Optional Features

  • Resend - Email sending (Sign up)

    • Required for: Document sharing emails, magic link authentication, notifications
    • Free tier: 3,000 emails/month
  • OpenAI - AI-powered features (Sign up)

    • Required for: Signature block parsing
    • Uses GPT-4o-mini (cost-effective)
  • Google Maps - Address autocomplete (Get API key)

    • Optional: Enhances contact management with address suggestions
  • Braintrust - Prompt management and logging (Sign up)

    • Optional: AI prompt versioning and monitoring
  • Slack - Team notifications (Setup OAuth)

    • Optional: Get notified in Slack when documents are viewed or signed

Environment Variables

See env.example for a complete list with descriptions. Core variables:

NEXT_PUBLIC_SITE_URL="http://localhost:3000"
NEXT_PUBLIC_SUPABASE_URL="your-supabase-url"
NEXT_PUBLIC_SUPABASE_ANON_KEY="your-anon-key"
SUPABASE_SERVICE_ROLE_KEY="your-service-role-key"

Self-Hosted Configuration

For self-hosted instances, you can control access:

# Disable new signups (only allow existing users to sign in)
DISABLE_SIGNUPS="true"

This is useful when you want to run Docbase privately and control who has access to your instance.

Development

npm run dev          # Start development server
npm run build        # Build for production
npm run start        # Start production server
npm run lint         # Run ESLint
npm run lint:fix     # Fix linting issues

Deployment

Deploy using Vercel:

  1. Push code to GitHub
  2. Import repository to Vercel
  3. Add all environment variables from your .env file
  4. Apply database migrations (see SETUP.md)
  5. Deploy!

Use Cases

For Founders & Fundraising

  • πŸš€ Share pitch decks with investors and track engagement
  • πŸ“Š See which slides investors spend the most time on
  • πŸ”’ Protect sensitive financial information with passwords
  • ✍️ Get NDAs signed before sharing confidential materials

For Sales & Business Development

  • πŸ“„ Share proposals and track when prospects view them
  • 🎯 Follow up at the right time based on engagement data
  • πŸ–ŠοΈ Get contracts and agreements signed electronically
  • πŸ“§ Send personalized documents with custom branding

For Legal & HR

  • βš–οΈ Send contracts and collect signatures
  • πŸ” Secure sharing of sensitive documents
  • πŸ“‹ Track document access and maintain audit trails
  • βœ… Ensure compliance with signature timestamps

For Self-Hosted Teams

  • 🏒 Run your own private DocSend alternative
  • 🚫 Control who can create accounts (disable public signups)
  • πŸ’Ύ Keep all data on your own infrastructure
  • πŸ”§ Customize and extend the platform as needed

Why Docbase?

vs. DocSend

  • βœ… Free & Open Source - No per-document pricing
  • βœ… Self-Hosted - Full control over your data
  • βœ… E-Signatures Built-In - No need for separate DocuSign/HelloSign
  • βœ… Customizable - Extend and modify as needed
  • βœ… Modern Stack - Built with Next.js 14 and TypeScript

vs. Building Your Own

  • βœ… Production Ready - Battle-tested features and security
  • βœ… Full Feature Set - Signatures, analytics, notifications, and more
  • βœ… Active Development - Regular updates and improvements
  • βœ… Great DX - Clean code, TypeScript, comprehensive docs

Contributing

We love contributions! Whether it's bug fixes, new features, or documentation improvements, all contributions are welcome.

How to Contribute

  1. Fork the repository and create your branch from main
  2. Make your changes - see CONTRIBUTING.md for detailed guidelines
  3. Test your changes - ensure the build passes (npm run build)
  4. Submit a pull request with a clear description of your changes

Development Guidelines

  • Use TypeScript for type safety
  • Follow existing code style and patterns
  • Write meaningful commit messages
  • Keep PRs focused and small when possible
  • Update documentation as needed

See CONTRIBUTING.md for detailed contribution guidelines.

Community & Support

Roadmap

  • Multiple links per document
  • Clone links functionality
  • Page-level time tracking
  • Home dashboard with aggregated analytics
  • Multi-document packages
  • Advanced analytics (heatmaps)
  • Mobile apps (React Native)
  • Video support
  • Custom domains for shared links
  • Webhook support for integrations
  • API for programmatic access

Star History

If you find Docbase useful, please consider giving it a star! ⭐

License

Licensed under the MIT license.


Built with ❀️ by Outcome Driven Studio

About

An open source alternative for Docusign - cloned from docbase by @alanagoyal

Resources

Contributing

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages