2023-11-08 12:22:48 +11:00
<img src="https://github.com/documenso/documenso/assets/13398220/a643571f-0239-46a6-a73e-6bef38d1228b" alt="Documenso Logo">
2023-09-28 22:48:02 +00:00
<p align="center" style="margin-top: 20px">
2023-03-14 12:29:38 +01:00
<p align="center">
2023-07-21 09:55:50 +02:00
The Open Source DocuSign Alternative.
2023-07-21 09:47:05 +02:00
<br>
2023-03-14 12:29:38 +01:00
<a href="https://documenso.com"><strong>Learn more »</strong></a>
<br />
<br />
2023-08-02 15:12:31 +02:00
<a href="https://documen.so/discord">Discord</a>
2023-03-14 12:29:38 +01:00
·
<a href="https://documenso.com">Website</a>
·
<a href="https://github.com/documenso/documenso/issues">Issues</a>
·
2024-01-09 14:32:49 +01:00
<a href="https://documen.so/live">Upcoming Releases</a>
2023-11-06 14:47:46 +11:00
·
2024-01-09 14:32:49 +01:00
<a href="https://documen.so/roadmap">Roadmap</a>
2023-03-14 12:29:38 +01:00
</p>
</p>
<p align="center">
2023-09-30 00:43:45 +10:00
<a href="https://documen.so/discord"><img src="https://img.shields.io/badge/Discord-documen.so/discord-%235865F2" alt="Join Documenso on Discord"></a>
2023-03-14 12:29:38 +01:00
<a href="https://github.com/documenso/documenso/stargazers"><img src="https://img.shields.io/github/stars/documenso/documenso" alt="Github Stars"></a>
<a href="https://github.com/documenso/documenso/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-AGPLv3-purple" alt="License"></a>
2023-03-17 13:43:42 +01:00
<a href="https://github.com/documenso/documenso/pulse"><img src="https://img.shields.io/github/commit-activity/m/documenso/documenso" alt="Commits-per-month"></a>
2023-09-30 00:43:45 +10:00
<a href="https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/documenso/documenso">
<img alt="open in devcontainer" src="https://img.shields.io/static/v1?label=Dev%20Containers&message=Enabled&color=blue&logo=visualstudiocode" />
</a>
2023-10-04 18:38:59 +11:00
<a href="code_of_conduct.md"><img src="https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg" alt="Contributor Covenant"></a>
2023-03-14 12:29:38 +01:00
</p>
2023-03-12 21:28:59 +01:00
<div>
<img style="display: block; height: 120px; width: 24%"
2023-09-26 11:12:59 +02:00
src="https://github.com/documenso/documenso/assets/1309312/67e08c98-c153-4115-aa2d-77979bb12c94)">
2023-03-12 21:28:59 +01:00
<img style="display: block; height: 120px; width: 24%"
2023-09-26 11:12:59 +02:00
src="https://github.com/documenso/documenso/assets/1309312/040cfbae-3438-4ca3-87f2-ce52c793dcaf">
2023-03-12 21:28:59 +01:00
<img style="display: block; height: 120px; width: 24%"
2023-09-26 11:12:59 +02:00
src="https://github.com/documenso/documenso/assets/1309312/72d445be-41e5-4936-bdba-87ef8e70fa09">
2023-03-12 21:28:59 +01:00
<img style="display: block; height: 120px; width: 24%"
2023-09-26 11:12:59 +02:00
src="https://github.com/documenso/documenso/assets/1309312/d7b86c0f-a755-4476-a022-a608db2c4633">
2023-03-12 21:28:59 +01:00
<img style="display: block; height: 120px; width: 24%"
2023-09-26 11:12:59 +02:00
src=https://github.com/documenso/documenso/assets/1309312/c0f55116-ab82-433f-a266-f3fc8571d69f">
2023-03-12 21:28:59 +01:00
</div>
2023-03-13 21:39:20 +01:00
## About this project
2023-03-13 21:03:23 +01:00
2023-09-30 00:43:45 +10:00
Signing documents digitally should be fast and easy and should be the best practice for every document signed worldwide.
This is technically quite easy today, but it also introduces a new party to every signature: The signing tool providers. While this is not a problem in itself, it should make us think about how we want these providers of trust to work.
Documenso aims to be the world's most trusted document-signing tool. This trust is built by empowering you to self-host Documenso and review how it works under the hood.
Join us in creating the next generation of open trust infrastructure.
2023-01-16 13:38:26 +01:00
2023-06-05 12:33:08 +01:00
## Recognition
2023-09-30 00:43:45 +10:00
<p align="center">
<a href="https://www.producthunt.com/posts/documenso?utm_source=badge-top-post-badge&utm_medium=badge&utm_souce=badge-documenso" target="_blank"><img src="https://api.producthunt.com/widgets/embed-image/v1/top-post-badge.svg?post_id=395047&theme=light&period=daily" alt="Documenso - The  ;open  ;source  ;DocuSign  ;alternative | Product Hunt" style="width: 250px; height: 54px;" width="250" height="54" /></a>
<a href="https://www.producthunt.com/posts/documenso?utm_source=badge-featured&utm_medium=badge&utm_souce=badge-documenso" target="_blank"><img src="https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=395047&theme=light" alt="Documenso - The  ;Open  ;Source  ;DocuSign  ;Alternative. ; | Product Hunt" style="width: 250px; height: 54px;" width="250" height="54" /></a>
</p>
2023-06-05 12:33:08 +01:00
2023-03-14 09:45:37 +01:00
## Community and Next Steps 🎯
2023-04-04 14:20:36 +02:00
2023-11-01 04:20:35 +05:30
We're currently working on a redesign of the application, including a revamp of the codebase, so Documenso can be more intuitive to use and robust to develop upon.
2023-03-13 21:03:23 +01:00
2023-11-01 04:20:35 +05:30
- Check out the first source code release in this repository and test it.
- Tell us what you think in the [Discussions ](https://github.com/documenso/documenso/discussions ).
- Join the [Discord server ](https://documen.so/discord ) for any questions and getting to know to other community members.
- ⭐ the repository to help us raise awareness.
- Spread the word on Twitter that Documenso is working towards a more open signing tool.
- Fix or create [issues ](https://github.com/documenso/documenso/issues ), that are needed for the first production release.
2023-03-14 09:45:37 +01:00
## Contributing
2023-04-04 14:20:36 +02:00
2023-08-30 00:27:44 +05:30
- To contribute, please see our [contribution guide ](https://github.com/documenso/documenso/blob/main/CONTRIBUTING.md ).
2023-03-13 21:03:23 +01:00
2023-06-28 19:53:39 +02:00
## Contact us
Contact us if you are interested in our Enterprise plan for large organizations that need extra flexibility and control.
<a href="https://cal.com/timurercan/enterprise-customers?utm_source=banner&utm_campaign=oss"><img alt="Book us with Cal.com" src="https://cal.com/book-with-cal-dark.svg" /></a>
2023-09-28 22:48:02 +00:00
## Tech Stack
2023-08-28 16:34:31 +02:00
2023-09-28 22:48:02 +00:00
- [Typescript ](https://www.typescriptlang.org/ ) - Language
- [Next.js ](https://nextjs.org/ ) - Framework
- [Prisma ](https://www.prisma.io/ ) - ORM
- [Tailwind ](https://tailwindcss.com/ ) - CSS
- [shadcn/ui ](https://ui.shadcn.com/ ) - Component Library
- [NextAuth.js ](https://next-auth.js.org/ ) - Authentication
- [react-email ](https://react.email/ ) - Email Templates
- [tRPC ](https://trpc.io/ ) - API
- [Node SignPDF ](https://github.com/vbuch/node-signpdf ) - Digital Signature
- [React-PDF ](https://github.com/wojtekmaj/react-pdf ) - Viewing PDFs
- [PDF-Lib ](https://github.com/Hopding/pdf-lib ) - PDF manipulation
- [Stripe ](https://stripe.com/ ) - Payments
- [Vercel ](https://vercel.com ) - Hosting
2023-03-13 21:03:23 +01:00
2023-09-28 22:48:02 +00:00
<!-- - Support for [opensignpdf (requires Java on server) ](https://github.com/open-pdf-sign ) is currently planned. -->
2023-03-13 21:03:23 +01:00
2023-09-28 22:48:02 +00:00
## Local Development
2023-03-13 21:03:23 +01:00
2023-09-28 22:48:02 +00:00
### Requirements
2023-02-14 13:11:10 +01:00
2023-11-01 04:20:35 +05:30
To run Documenso locally, you will need
2023-02-02 20:04:59 +01:00
2024-03-01 18:42:08 +05:30
- Node.js (v18 or above)
2023-09-28 22:48:02 +00:00
- Postgres SQL Database
- Docker (optional)
2023-02-02 20:04:59 +01:00
2023-09-28 22:48:02 +00:00
### Developer Quickstart
2023-04-08 23:09:57 +10:00
> **Note**: This is a quickstart for developers. It assumes that you have both [docker](https://docs.docker.com/get-docker/) and [docker-compose](https://docs.docker.com/compose/) installed on your machine.
Want to get up and running quickly? Follow these steps:
2023-12-29 08:48:26 -05:00
1. [Fork this repository ](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/about-forks ) to your GitHub account.
2023-12-23 23:18:32 -05:00
2023-12-30 18:27:24 -05:00
After forking the repository, clone it to your local device by using the following command:
2023-04-08 23:09:57 +10:00
2023-09-28 22:48:02 +00:00
```sh
2023-12-23 23:18:32 -05:00
git clone https://github.com/<your-username>/documenso
2023-09-28 22:48:02 +00:00
```
2023-04-08 23:09:57 +10:00
2023-11-01 04:20:35 +05:30
2. Set up your `.env` file using the recommendations in the `.env.example` file. Alternatively, just run `cp .env.example .env` to get started with our handpicked defaults.
2023-09-30 00:43:45 +10:00
2023-09-28 22:48:02 +00:00
3. Run `npm run dx` in the root directory
2023-04-08 23:09:57 +10:00
2023-09-28 22:48:02 +00:00
- This will spin up a postgres database and inbucket mailserver in a docker container.
2023-04-08 23:09:57 +10:00
2023-09-28 22:48:02 +00:00
4. Run `npm run dev` in the root directory
2023-09-30 00:43:45 +10:00
2023-09-28 22:48:02 +00:00
5. Want it even faster? Just use
2023-04-08 23:09:57 +10:00
2023-09-28 22:48:02 +00:00
```sh
npm run d
```
2023-04-08 23:09:57 +10:00
2023-09-28 22:48:02 +00:00
#### Access Points for Your Application
2023-02-02 20:04:59 +01:00
2023-09-28 22:48:02 +00:00
1. **App ** - http://localhost:3000
2. **Incoming Mail Access ** - http://localhost:9000
3. **Database Connection Details **
2023-12-08 20:49:08 +11:00
2023-09-28 22:48:02 +00:00
- **Port**: 54320
- **Connection**: Use your favorite database client to connect using the provided port.
2023-03-13 21:03:23 +01:00
2023-12-08 20:49:08 +11:00
4. **S3 Storage Dashboard ** - http://localhost:9001
2023-09-28 22:48:02 +00:00
## Developer Setup
2023-03-13 21:03:23 +01:00
2023-09-28 22:48:02 +00:00
### Manual Setup
2023-04-04 22:02:32 +00:00
2023-11-01 04:20:35 +05:30
Follow these steps to setup Documenso on your local machine:
2023-03-13 21:03:23 +01:00
2023-12-29 08:48:26 -05:00
1. [Fork this repository ](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/about-forks ) to your GitHub account.
2023-12-23 23:18:32 -05:00
2023-12-30 18:27:24 -05:00
After forking the repository, clone it to your local device by using the following command:
2023-03-13 21:03:23 +01:00
2023-09-28 22:48:02 +00:00
```sh
2023-12-23 23:18:32 -05:00
git clone https://github.com/<your-username>/documenso
2023-09-28 22:48:02 +00:00
```
2023-08-11 20:44:09 +00:00
2023-11-01 04:20:35 +05:30
2. Run `npm i` in the root directory
2023-08-11 20:44:09 +00:00
2023-09-30 00:43:45 +10:00
3. Create your `.env` from the `.env.example` . You can use `cp .env.example .env` to get started with our handpicked defaults.
2023-03-14 11:35:27 +01:00
2023-11-01 04:20:35 +05:30
4. Set the following environment variables:
2023-10-04 18:38:59 +11:00
- NEXTAUTH_URL
- NEXTAUTH_SECRET
- NEXT_PUBLIC_WEBAPP_URL
- NEXT_PUBLIC_MARKETING_URL
- NEXT_PRIVATE_DATABASE_URL
- NEXT_PRIVATE_DIRECT_DATABASE_URL
- NEXT_PRIVATE_SMTP_FROM_NAME
- NEXT_PRIVATE_SMTP_FROM_ADDRESS
2023-03-13 21:03:23 +01:00
2023-10-08 21:51:15 +11:00
5. Create the database schema by running `npm run prisma:migrate-dev`
2023-03-13 21:03:23 +01:00
2023-11-01 04:20:35 +05:30
6. Run `npm run dev` in the root directory to start
2023-06-17 13:08:15 +10:00
2023-09-30 00:43:45 +10:00
7. Register a new user at http://localhost:3000/signup
2023-06-17 13:08:15 +10:00
2023-09-28 22:48:02 +00:00
---
2023-03-13 21:03:23 +01:00
2023-11-01 04:20:35 +05:30
- Optional: Seed the database using `npm run prisma:seed -w @documenso/prisma` to create a test user and document.
- Optional: Create your own signing certificate.
- To generate your own using these steps and a Linux Terminal or Windows Subsystem for Linux (WSL), see * * [Create your own signing certificate ](./SIGNING.md )**.
2023-06-17 13:08:15 +10:00
2023-09-28 22:48:02 +00:00
### Run in Gitpod
2023-06-17 13:08:15 +10:00
2023-09-28 22:48:02 +00:00
- Click below to launch a ready-to-use Gitpod workspace in your browser.
2023-06-17 13:08:15 +10:00
2023-09-28 22:48:02 +00:00
[](https://gitpod.io/#https://github .com/documenso/documenso)
2023-03-13 21:03:23 +01:00
2023-09-30 00:43:45 +10:00
### Run in DevContainer
2023-04-08 23:09:57 +10:00
2023-09-30 00:43:45 +10:00
We support DevContainers for VSCode. [Click here to get started. ](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/documenso/documenso )
2023-04-08 23:09:57 +10:00
2023-11-20 10:01:34 +02:00
### Video walkthrough
If you're a visual learner and prefer to watch a video walkthrough of setting up Documenso locally, check out this video:
[](https://youtu.be/Y0ppIQrEnZs)
2023-09-30 00:43:45 +10:00
## Docker
2023-09-10 09:28:15 +05:30
2023-11-01 04:20:35 +05:30
🚧 Docker containers and images are current in progress. We are actively working on bringing a simple Docker build and publish pipeline for Documenso.
2023-09-10 09:28:15 +05:30
2023-09-28 22:48:02 +00:00
## Self Hosting
2023-03-13 21:03:23 +01:00
2023-08-01 14:12:33 +00:00
We support a variety of deployment methods, and are actively working on adding more. Stay tuned for updates!
2023-11-01 04:20:35 +05:30
> Please note that the below deployment methods are for v0.9, we will update these to v1.0 once it has been released.
2023-09-30 00:43:45 +10:00
2023-11-01 04:20:35 +05:30
### Fetch, configure, and build
2023-10-23 15:44:28 +02:00
First, clone the code from Github:
```
git clone https://github.com/documenso/documenso.git
```
Then, inside the `documenso` folder, copy the example env file:
```
cp .env.example .env
```
2023-11-06 02:18:24 +01:00
The following environment variables must be set:
2023-10-23 15:44:28 +02:00
* `NEXTAUTH_URL`
* `NEXTAUTH_SECRET`
* `NEXT_PUBLIC_WEBAPP_URL`
* `NEXT_PUBLIC_MARKETING_URL`
* `NEXT_PRIVATE_DATABASE_URL`
* `NEXT_PRIVATE_DIRECT_DATABASE_URL`
* `NEXT_PRIVATE_SMTP_FROM_NAME`
* `NEXT_PRIVATE_SMTP_FROM_ADDRESS`
> If you are using a reverse proxy in front of Documenso, don't forget to provide the public URL for both `NEXTAUTH_URL` and `NEXT_PUBLIC_WEBAPP_URL` variables!
Now you can install the dependencies and build it:
```
npm i
2023-11-29 20:06:25 +01:00
npm run build:web
2023-10-23 15:44:28 +02:00
npm run prisma:migrate-deploy
```
Finally, you can start it with:
```
npm run start
```
This will start the server on `localhost:3000` . For now, any reverse proxy can then do the frontend and SSL termination.
> If you want to run with another port than 3000, you can start the application with `next -p <ANY PORT>` from the `apps/web` folder.
### Run as a service
2023-11-01 04:20:35 +05:30
You can use a systemd service file to run the app. Here is a simple example of the service running on port 3500 (using 3000 by default):
2023-10-23 15:44:28 +02:00
```bash
[Unit]
Description=documenso
After=network.target
[Service]
Environment=PATH=/path/to/your/node/binaries
Type=simple
User=www-data
WorkingDirectory=/var/www/documenso/apps/web
ExecStart=/usr/bin/next start -p 3500
TimeoutSec=15
Restart=always
[Install]
WantedBy=multi-user.target
```
2023-09-28 22:48:02 +00:00
### Railway
2023-08-01 13:47:50 +00:00
2023-12-22 11:44:22 +05:30
[](https://railway.app/template/bG6D4p)
2023-06-02 14:00:54 +07:00
2023-09-28 22:48:02 +00:00
### Render
2023-08-10 01:53:05 +00:00
[](https://render.com/deploy?repo=https://github.com/documenso/documenso)
2023-12-19 13:34:29 +05:30
### Koyeb
[](https://app.koyeb.com/deploy?type=git&repository=github.com/documenso/documenso&branch=main&name=documenso-app&builder=dockerfile&dockerfile=/docker/Dockerfile)
2023-09-28 22:48:02 +00:00
## Troubleshooting
2023-06-02 14:00:54 +07:00
2023-11-01 04:20:35 +05:30
### I'm not receiving any emails when using the developer quickstart.
2023-06-17 13:08:15 +10:00
2023-11-01 04:20:35 +05:30
When using the developer quickstart, an [Inbucket ](https://inbucket.org/ ) server will be spun up in a docker container that will store all outgoing emails locally for you to view.
2023-06-17 13:08:15 +10:00
2023-11-01 04:20:35 +05:30
The Web UI can be found at http://localhost:9000, while the SMTP port will be on localhost:2500.
2023-06-17 13:08:15 +10:00
2023-09-28 22:48:02 +00:00
### Support IPv6
2023-06-02 14:00:54 +07:00
2023-11-01 04:20:35 +05:30
If you are deploying to a cluster that uses only IPv6, You can use a custom command to pass a parameter to the Next.js start command
2023-06-02 14:00:54 +07:00
For local docker run
```bash
docker run -it documenso:latest npm run start -- -H ::
```
For k8s or docker-compose
```yaml
containers:
- name: documenso
image: documenso:latest
imagePullPolicy: IfNotPresent
command:
- npm
args:
- run
- start
- --
- -H
2023-09-28 22:48:02 +00:00
- '::'
2023-06-02 14:00:54 +07:00
```
2023-09-28 22:48:02 +00:00
2023-11-01 04:20:35 +05:30
### I can't see environment variables in my package scripts.
2023-10-08 21:51:15 +11:00
Wrap your package script with the `with:env` script like such:
```
npm run with:env -- npm run myscript
```
2023-11-01 04:20:35 +05:30
The same can be done when using `npx` for one of the bin scripts:
2023-10-08 21:51:15 +11:00
```
npm run with:env -- npx myscript
```
This will load environment variables from your `.env` and `.env.local` files.
2023-09-28 22:48:02 +00:00
## Repo Activity
