mirror of
https://github.com/documenso/documenso.git
synced 2025-11-12 07:43:16 +10:00
Compare commits
22 Commits
feat-early
...
chore/team
| Author | SHA1 | Date | |
|---|---|---|---|
| 4d4b011146 | |||
| 97dfacd133 | |||
| 87a5bab734 | |||
| fa61bb660e | |||
| 83dd079e03 | |||
| f7933d8a4d | |||
| 4bd0cfd283 | |||
| 86f39f3824 | |||
| 94216f5219 | |||
| a2e6187dae | |||
| 15e3926ce4 | |||
| 69738d7ed3 | |||
| 649620c1c9 | |||
| 99df006019 | |||
| be40e28f47 | |||
| 8899d82e1b | |||
| 0527641a4f | |||
| 54e32af1d4 | |||
| b1645ec09a | |||
| 5b9ce55a6d | |||
| ab26af19b8 | |||
| dc512600dc |
245
README.md
245
README.md
@ -1,8 +1,6 @@
|
||||
<p align="center" style="margin-top: 120px">
|
||||
<a href="https://github.com/documenso/documenso">
|
||||
<img width="250px" src="https://github.com/documenso/documenso/assets/1309312/ea8de2d0-8e33-4527-8a5c-40780142a2ed" alt="Documenso Logo">
|
||||
</a>
|
||||
<img src="https://github.com/documenso/documenso/assets/13398220/a643571f-0239-46a6-a73e-6bef38d1228b" alt="Documenso Logo">
|
||||
|
||||
<p align="center" style="margin-top: 20px">
|
||||
<p align="center">
|
||||
The Open Source DocuSign Alternative.
|
||||
<br>
|
||||
@ -16,24 +14,29 @@
|
||||
<a href="https://github.com/documenso/documenso/issues">Issues</a>
|
||||
·
|
||||
<a href="https://github.com/documenso/documenso/milestones">Roadmap</a>
|
||||
·
|
||||
<a href="https://documen.so/launches">Upcoming Launches</a>
|
||||
</p>
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://documen.so/discord"><img src="https://img.shields.io/badge/Discord-documen.so/discord-%235865F2" alt="Join Documenso on Discord"></a>
|
||||
<a href="https://documen.so/discord"><img src="https://img.shields.io/badge/Discord-documen.so/discord-%235865F2" alt="Join Documenso on Discord"></a>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
</p>
|
||||
|
||||
> 🦺 Documenso 1.0 is deployed to our <a href="https://documen.so/staging" target="_blank">Staging Environment</a>.
|
||||
>
|
||||
> The code can be found on the [feat/refresh](https://github.com/documenso/documenso/tree/feat/refresh) branch.
|
||||
>
|
||||
> The new Version will be released after the current testing phase.
|
||||
|
||||
>
|
||||
> The new version will be released after the current testing phase.
|
||||
|
||||
# Join us in testing Documenso 1.0 during [MALFUNCTION MANIA](https://documenso.com/blog/malfunction-mania)
|
||||
|
||||
<div>
|
||||
<img style="display: block; height: 120px; width: 24%"
|
||||
src="https://github.com/documenso/documenso/assets/1309312/67e08c98-c153-4115-aa2d-77979bb12c94)">
|
||||
@ -49,19 +52,27 @@
|
||||
|
||||
## About this project
|
||||
|
||||
Signing documents digitally is 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.
|
||||
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.
|
||||
|
||||
## Recognition
|
||||
|
||||
<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 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>
|
||||
|
||||
## Community and Next Steps 🎯
|
||||
|
||||
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.
|
||||
|
||||
- Check out the first source code release in this repository and test it
|
||||
- Tell us what you think in the current [Discussions](https://github.com/documenso/documenso/discussions)
|
||||
- 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
|
||||
@ -77,62 +88,70 @@ Contact us if you are interested in our Enterprise plan for large organizations
|
||||
|
||||
<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>
|
||||
|
||||
## Activity
|
||||
## Tech Stack
|
||||
|
||||

|
||||
- [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
|
||||
|
||||
# Tech
|
||||
<!-- - Support for [opensignpdf (requires Java on server)](https://github.com/open-pdf-sign) is currently planned. -->
|
||||
|
||||
Documenso is built using awesome open source tech including:
|
||||
## Local Development
|
||||
|
||||
- [Typescript](https://www.typescriptlang.org/)
|
||||
- [Javascript (when necessary)](https://developer.mozilla.org/en-US/docs/Web/JavaScript)
|
||||
- [NextJS (JS Fullstack Framework)](https://nextjs.org/)
|
||||
- [Postgres SQL (Database)](https://www.postgresql.org/)
|
||||
- [Prisma (ORM - Object-relational mapping)](https://www.prisma.io/)
|
||||
- [Tailwind CSS (Styling)](https://tailwindcss.com/)
|
||||
- [Node SignPDF (Digital Signature)](https://github.com/vbuch/node-signpdf)
|
||||
- [React-PDF for viewing PDFs](https://github.com/wojtekmaj/react-pdf)
|
||||
- [PDF-Lib for PDF manipulation](https://github.com/Hopding/pdf-lib)
|
||||
- Check out `/package.json` and `/apps/web/package.json` for more
|
||||
- Support for [opensignpdf (requires Java on server)](https://github.com/open-pdf-sign) is currently planned.
|
||||
### Requirements
|
||||
|
||||
# Getting Started
|
||||
To run Documenso locally you will need
|
||||
|
||||
## Requirements
|
||||
- Node.js
|
||||
- Postgres SQL Database
|
||||
- Docker (optional)
|
||||
|
||||
To run Documenso locally you need
|
||||
|
||||
- [Node.js (Version: >=18.x)](https://nodejs.org/en/download/)
|
||||
- Node Package Manager NPM - included in Node.js
|
||||
- [PostgreSQL (local or remote)](https://www.postgresql.org/download/)
|
||||
|
||||
## Developer Quickstart
|
||||
### Developer Quickstart
|
||||
|
||||
> **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:
|
||||
|
||||
- [Clone the repository](https://help.github.com/articles/cloning-a-repository/) it to your local device.
|
||||
1. [Clone the repository](https://help.github.com/articles/cloning-a-repository/) it to your local device.
|
||||
|
||||
```sh
|
||||
git clone https://github.com/documenso/documenso
|
||||
```
|
||||
```sh
|
||||
git clone https://github.com/documenso/documenso
|
||||
```
|
||||
|
||||
- Set up your `.env` file using the recommendations in the `.env.example` file.
|
||||
- Run `npm run dx` in the root directory
|
||||
- This will spin up a postgres database and inbucket mail server in docker containers.
|
||||
- Run `npm run dev` in the root directory
|
||||
- Want it even faster? Just use
|
||||
```sh
|
||||
npm run d
|
||||
```
|
||||
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.
|
||||
|
||||
That's it! You should now be able to access the app at http://localhost:3000
|
||||
|
||||
Incoming mail will be available at http://localhost:9000
|
||||
3. Run `npm run dx` in the root directory
|
||||
|
||||
Your database will also be available on port `54320`. You can connect to it using your favorite database client.
|
||||
- This will spin up a postgres database and inbucket mailserver in a docker container.
|
||||
|
||||
4. Run `npm run dev` in the root directory
|
||||
|
||||
|
||||
5. Want it even faster? Just use
|
||||
|
||||
```sh
|
||||
npm run d
|
||||
```
|
||||
|
||||
#### Access Points for Your Application
|
||||
|
||||
1. **App** - http://localhost:3000
|
||||
2. **Incoming Mail Access** - http://localhost:9000
|
||||
|
||||
3. **Database Connection Details**
|
||||
- **Port**: 54320
|
||||
- **Connection**: Use your favorite database client to connect using the provided port.
|
||||
|
||||
## Developer Setup
|
||||
|
||||
@ -140,33 +159,37 @@ Your database will also be available on port `54320`. You can connect to it usin
|
||||
|
||||
Follow these steps to setup documenso on you local machine:
|
||||
|
||||
- [Clone the repository](https://help.github.com/articles/cloning-a-repository/) it to your local device.
|
||||
```sh
|
||||
git clone https://github.com/documenso/documenso
|
||||
```
|
||||
- Run `npm i` in root directory
|
||||
- Rename `.env.example` to `.env`
|
||||
- Set DATABASE_URL value in .env file
|
||||
- You can use the provided test database url (may be wiped at any point)
|
||||
- Or setup a local postgres sql instance (recommended)
|
||||
- Create the database scheme by running `db-migrate:dev`
|
||||
- Setup your mail provider
|
||||
- Set `SENDGRID_API_KEY` value in .env file
|
||||
- You need a SendGrid account, which you can create [here](https://signup.sendgrid.com/).
|
||||
- Documenso uses [Nodemailer](https://nodemailer.com/about/) so you can easily use your own SMTP server by setting the `SMTP
|
||||
\_
|
||||
* variables` in your .env
|
||||
- Run `npm run dev` root directory to start
|
||||
- Register a new user at http://localhost:3000/signup
|
||||
1. [Clone the repository](https://help.github.com/articles/cloning-a-repository/) it to your local device.
|
||||
|
||||
```sh
|
||||
git clone https://github.com/documenso/documenso
|
||||
```
|
||||
|
||||
2. Run `npm i` in root directory
|
||||
|
||||
3. Create your `.env` from the `.env.example`. You can use `cp .env.example .env` to get started with our handpicked defaults.
|
||||
|
||||
4. Set the following environement variables.
|
||||
- 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
|
||||
|
||||
5. Create the database schema by running `npm run prisma:migrate-dev -w @documenso/prisma`
|
||||
|
||||
6. Run `npm run dev` root directory to start
|
||||
|
||||
7. Register a new user at http://localhost:3000/signup
|
||||
|
||||
---
|
||||
|
||||
- Optional: Seed the database using `npm run db-seed` to create a test user and document
|
||||
- Optional: Upload and sign `apps/web/resources/example.pdf` manually to test your setup
|
||||
|
||||
- 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
|
||||
- A demo certificate is provided in `/app/web/resources/certificate.p12`
|
||||
- To generate your own using these steps and a Linux Terminal or Windows Subsystem for Linux (WSL) see **[Create your own signing certificate](#creating-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)**.
|
||||
|
||||
### Run in Gitpod
|
||||
|
||||
@ -174,81 +197,39 @@ Follow these steps to setup documenso on you local machine:
|
||||
|
||||
[](https://gitpod.io/#https://github.com/documenso/documenso)
|
||||
|
||||
## Updating
|
||||
### Run in DevContainer
|
||||
|
||||
- If you pull the newest version from main, using `git pull`, it may be necessary to regenerate your database client
|
||||
- You can do this by running the generate command in `/packages/prisma`:
|
||||
```sh
|
||||
npx prisma generate
|
||||
```
|
||||
- This is not necessary on first clone.
|
||||
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)
|
||||
|
||||
# Creating your own signing certificate
|
||||
## Docker
|
||||
|
||||
For the digital signature of your documents you need a signing certificate in .p12 format (public and private key). You can buy one (not recommended for dev) or use the steps to create a self-signed one:
|
||||
🚧 Docker containers and images are current in progress. We are actively working on bringing a simple docker build and publish pipeline for Documenso.
|
||||
|
||||
1. Generate a private key using the OpenSSL command. You can run the following command to generate a 2048-bit RSA key:
|
||||
|
||||
`openssl genrsa -out private.key 2048`
|
||||
|
||||
2. Generate a self-signed certificate using the private key. You can run the following command to generate a self-signed certificate:
|
||||
|
||||
`openssl req -new -x509 -key private.key -out certificate.crt -days 365`
|
||||
|
||||
This will prompt you to enter some information, such as the Common Name (CN) for the certificate. Make sure you enter the correct information. The -days parameter sets the number of days for which the certificate is valid.
|
||||
|
||||
3. Combine the private key and the self-signed certificate to create the p12 certificate. You can run the following command to do this:
|
||||
|
||||
`openssl pkcs12 -export -out certificate.p12 -inkey private.key -in certificate.crt`
|
||||
|
||||
4. You will be prompted to enter a password for the p12 file. Choose a strong password and remember it, as you will need it to use the certificate (**can be empty for dev certificates**)
|
||||
5. Place the certificate `/apps/web/resources/certificate.p12`
|
||||
|
||||
# Docker
|
||||
|
||||
> We are still working on the publishing of docker images, in the meantime you can follow the steps below to create a production ready docker image.
|
||||
|
||||
Want to create a production ready docker image? Follow these steps:
|
||||
|
||||
- cd into `docker` directory
|
||||
- Make `build.sh` executable by running `chmod +x build.sh`
|
||||
- Run `./build.sh` to start building the docker image.
|
||||
- Publish the image to your docker registry of choice (or) If you prefer running the image from local, run the below command
|
||||
|
||||
```
|
||||
docker run -d --restart=unless-stopped -p 3000:3000 -v documenso:/app/data --name documenso documenso:latest
|
||||
```
|
||||
|
||||
Command Breakdown:
|
||||
- `-d` - Let's you run the container in background
|
||||
- `-p` - Passes down which ports to use. First half is the host port, Second half is the app port. You can change the first half anything you want and reverse proxy to that port.
|
||||
- `-v` - Volume let's you persist the data
|
||||
- `--name` - Name of the container
|
||||
- `documenso:latest` - Image you have built
|
||||
|
||||
# Deployment
|
||||
## Self Hosting
|
||||
|
||||
We support a variety of deployment methods, and are actively working on adding more. Stay tuned for updates!
|
||||
|
||||
## Railway
|
||||
> Please note the below deployment methods are for v0.9, we will update these to v1.0 once it has been released.
|
||||
|
||||
### Railway
|
||||
|
||||
[](https://railway.app/template/DjrRRX)
|
||||
|
||||
## Render
|
||||
### Render
|
||||
|
||||
[](https://render.com/deploy?repo=https://github.com/documenso/documenso)
|
||||
|
||||
# Troubleshooting
|
||||
## Troubleshooting
|
||||
|
||||
## I'm not receiving any emails when using the developer quickstart
|
||||
### I'm not receiving any emails when using the developer quickstart
|
||||
|
||||
When using the developer quickstart an [Inbucket](https://inbucket.org/) server will be spun up in a docker container that will store all outgoing email locally for you to view.
|
||||
|
||||
The Web UI can be found at http://localhost:9000 while the SMTP port will be on localhost:2500.
|
||||
|
||||
## Support IPv6
|
||||
### Support IPv6
|
||||
|
||||
In case you are deploying to a cluster that uses only IPv6. You can use a custom command to pass a parameter to the NextJS start command
|
||||
In case 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
|
||||
|
||||
For local docker run
|
||||
|
||||
@ -270,5 +251,9 @@ containers:
|
||||
- start
|
||||
- --
|
||||
- -H
|
||||
- "::"
|
||||
- '::'
|
||||
```
|
||||
|
||||
## Repo Activity
|
||||
|
||||

|
||||
|
||||
55
SIGNING.md
Normal file
55
SIGNING.md
Normal file
@ -0,0 +1,55 @@
|
||||
# Creating your own signing certificate
|
||||
|
||||
For the digital signature of your documents you need a signing certificate in .p12 format (public and private key). You can buy one (not recommended for dev) or use the steps to create a self-signed one:
|
||||
|
||||
1. Generate a private key using the OpenSSL command. You can run the following command to generate a 2048-bit RSA key:
|
||||
|
||||
`openssl genrsa -out private.key 2048`
|
||||
|
||||
2. Generate a self-signed certificate using the private key. You can run the following command to generate a self-signed certificate:
|
||||
|
||||
`openssl req -new -x509 -key private.key -out certificate.crt -days 365`
|
||||
|
||||
This will prompt you to enter some information, such as the Common Name (CN) for the certificate. Make sure you enter the correct information. The -days parameter sets the number of days for which the certificate is valid.
|
||||
|
||||
3. Combine the private key and the self-signed certificate to create the p12 certificate. You can run the following command to do this:
|
||||
|
||||
`openssl pkcs12 -export -out certificate.p12 -inkey private.key -in certificate.crt`
|
||||
|
||||
4. You will be prompted to enter a password for the p12 file. Choose a strong password and remember it, as you will need it to use the certificate (**can be empty for dev certificates**)
|
||||
5. Place the certificate `/apps/web/resources/certificate.p12`
|
||||
|
||||
## Docker
|
||||
|
||||
> We are still working on the publishing of docker images, in the meantime you can follow the steps below to create a production ready docker image.
|
||||
|
||||
Want to create a production ready docker image? Follow these steps:
|
||||
|
||||
- cd into `docker` directory
|
||||
- Make `build.sh` executable by running `chmod +x build.sh`
|
||||
- Run `./build.sh` to start building the docker image.
|
||||
- Publish the image to your docker registry of choice (or) If you prefer running the image from local, run the below command
|
||||
|
||||
```
|
||||
docker run -d --restart=unless-stopped -p 3000:3000 -v documenso:/app/data --name documenso documenso:latest
|
||||
```
|
||||
|
||||
Command Breakdown:
|
||||
|
||||
- `-d` - Let's you run the container in background
|
||||
- `-p` - Passes down which ports to use. First half is the host port, Second half is the app port. You can change the first half anything you want and reverse proxy to that port.
|
||||
- `-v` - Volume let's you persist the data
|
||||
- `--name` - Name of the container
|
||||
- `documenso:latest` - Image you have built
|
||||
|
||||
## Deployment
|
||||
|
||||
We support a variety of deployment methods, and are actively working on adding more. Stay tuned for updates!
|
||||
|
||||
## Railway
|
||||
|
||||
[](https://railway.app/template/DjrRRX)
|
||||
|
||||
## Render
|
||||
|
||||
[](https://render.com/deploy?repo=https://github.com/documenso/documenso)
|
||||
@ -23,22 +23,6 @@ export const TEAM_MEMBERS = [
|
||||
engagement: 'Part-Time',
|
||||
joinDate: 'June 6th, 2023',
|
||||
},
|
||||
{
|
||||
name: 'Florent Merian',
|
||||
role: 'Marketer - III',
|
||||
salary: 'Project-Based',
|
||||
location: 'France',
|
||||
engagement: 'Full-Time',
|
||||
joinDate: 'July 10th, 2023',
|
||||
},
|
||||
{
|
||||
name: 'Thilo Konzok',
|
||||
role: 'Designer',
|
||||
salary: 'Project-Based',
|
||||
location: 'Germany',
|
||||
engagement: 'Full-Time',
|
||||
joinDate: 'April 26th, 2023',
|
||||
},
|
||||
{
|
||||
name: 'David Nguyen',
|
||||
role: 'Software Engineer - III',
|
||||
@ -47,6 +31,22 @@ export const TEAM_MEMBERS = [
|
||||
engagement: 'Full-Time',
|
||||
joinDate: 'July 26th, 2023',
|
||||
},
|
||||
{
|
||||
name: 'Catalin-Marinel Pit',
|
||||
role: 'Software Engineer - II',
|
||||
salary: 80_000,
|
||||
location: 'Romania',
|
||||
engagement: 'Full-Time',
|
||||
joinDate: 'September 4th, 2023',
|
||||
},
|
||||
{
|
||||
name: 'Gowdhama Rajan B',
|
||||
role: 'Designer - III',
|
||||
salary: 100_000,
|
||||
location: 'India',
|
||||
engagement: 'Full-Time',
|
||||
joinDate: 'October 9th, 2023',
|
||||
},
|
||||
];
|
||||
|
||||
export const FUNDING_RAISED = [
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
'use client';
|
||||
|
||||
import React, { useState } from 'react';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
|
||||
import { useSearchParams } from 'next/navigation';
|
||||
|
||||
@ -55,8 +55,8 @@ export const ClaimPlanDialog = ({ className, planId, children }: ClaimPlanDialog
|
||||
register,
|
||||
handleSubmit,
|
||||
formState: { errors, isSubmitting },
|
||||
reset,
|
||||
} = useForm<TClaimPlanDialogFormSchema>({
|
||||
mode: 'onBlur',
|
||||
defaultValues: {
|
||||
name: params?.get('name') ?? '',
|
||||
email: params?.get('email') ?? '',
|
||||
@ -91,6 +91,12 @@ export const ClaimPlanDialog = ({ className, planId, children }: ClaimPlanDialog
|
||||
}
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (!isSubmitting && !open) {
|
||||
reset();
|
||||
}
|
||||
}, [open]);
|
||||
|
||||
return (
|
||||
<Dialog open={open} onOpenChange={(value) => !isSubmitting && setOpen(value)}>
|
||||
<DialogTrigger asChild>{children}</DialogTrigger>
|
||||
|
||||
@ -73,7 +73,7 @@ export const ForgotPasswordForm = ({ className }: ForgotPasswordFormProps) => {
|
||||
</div>
|
||||
|
||||
<Button size="lg" loading={isSubmitting}>
|
||||
Reset Password
|
||||
{isSubmitting ? 'Sending Reset Email...' : 'Reset Password'}
|
||||
</Button>
|
||||
</form>
|
||||
);
|
||||
|
||||
@ -166,7 +166,7 @@ export const ResetPasswordForm = ({ className, token }: ResetPasswordFormProps)
|
||||
</div>
|
||||
|
||||
<Button size="lg" loading={isSubmitting}>
|
||||
Reset Password
|
||||
{isSubmitting ? 'Resetting Password...' : 'Reset Password'}
|
||||
</Button>
|
||||
</form>
|
||||
);
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
import { useState } from 'react';
|
||||
|
||||
import { zodResolver } from '@hookform/resolvers/zod';
|
||||
import { Eye, EyeOff, Loader } from 'lucide-react';
|
||||
import { Eye, EyeOff } from 'lucide-react';
|
||||
import { signIn } from 'next-auth/react';
|
||||
import { useForm } from 'react-hook-form';
|
||||
import { FcGoogle } from 'react-icons/fc';
|
||||
@ -147,9 +147,13 @@ export const SignInForm = ({ className }: SignInFormProps) => {
|
||||
<FormErrorMessage className="mt-1.5" error={errors.password} />
|
||||
</div>
|
||||
|
||||
<Button size="lg" disabled={isSubmitting} className="dark:bg-documenso dark:hover:opacity-90">
|
||||
{isSubmitting && <Loader className="mr-2 h-5 w-5 animate-spin" />}
|
||||
Sign In
|
||||
<Button
|
||||
size="lg"
|
||||
loading={isSubmitting}
|
||||
disabled={isSubmitting}
|
||||
className="dark:bg-documenso dark:hover:opacity-90"
|
||||
>
|
||||
{isSubmitting ? 'Signing in...' : 'Sign In'}
|
||||
</Button>
|
||||
|
||||
<div className="relative flex items-center justify-center gap-x-4 py-2 text-xs uppercase">
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
import { useState } from 'react';
|
||||
|
||||
import { zodResolver } from '@hookform/resolvers/zod';
|
||||
import { Eye, EyeOff, Loader } from 'lucide-react';
|
||||
import { Eye, EyeOff } from 'lucide-react';
|
||||
import { signIn } from 'next-auth/react';
|
||||
import { Controller, useForm } from 'react-hook-form';
|
||||
import { z } from 'zod';
|
||||
@ -157,9 +157,13 @@ export const SignUpForm = ({ className }: SignUpFormProps) => {
|
||||
<FormErrorMessage className="mt-1.5" error={errors.signature} />
|
||||
</div>
|
||||
|
||||
<Button size="lg" disabled={isSubmitting} className="dark:bg-documenso dark:hover:opacity-90">
|
||||
{isSubmitting && <Loader className="mr-2 h-5 w-5 animate-spin" />}
|
||||
Sign Up
|
||||
<Button
|
||||
size="lg"
|
||||
loading={isSubmitting}
|
||||
disabled={isSubmitting}
|
||||
className="dark:bg-documenso dark:hover:opacity-90"
|
||||
>
|
||||
{isSubmitting ? 'Signing up...' : 'Sign Up'}
|
||||
</Button>
|
||||
</form>
|
||||
);
|
||||
|
||||
19
docker/compose-services.yml
Normal file
19
docker/compose-services.yml
Normal file
@ -0,0 +1,19 @@
|
||||
name: documenso-services
|
||||
services:
|
||||
database:
|
||||
image: postgres:15
|
||||
container_name: database
|
||||
environment:
|
||||
- POSTGRES_USER=documenso
|
||||
- POSTGRES_PASSWORD=password
|
||||
- POSTGRES_DB=documenso
|
||||
ports:
|
||||
- 54320:5432
|
||||
|
||||
inbucket:
|
||||
image: inbucket/inbucket
|
||||
container_name: mailserver
|
||||
ports:
|
||||
- 9000:9000
|
||||
- 2500:2500
|
||||
- 1100:1100
|
||||
12
package-lock.json
generated
12
package-lock.json
generated
@ -1868,6 +1868,17 @@
|
||||
"resolved": "apps/marketing",
|
||||
"link": true
|
||||
},
|
||||
"node_modules/@documenso/nodemailer-resend": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@documenso/nodemailer-resend/-/nodemailer-resend-1.0.0.tgz",
|
||||
"integrity": "sha512-rG+jBbBEsVJUBU6v/2hb+OQD1m3Lhn49TOzQjln73zzL1B/sZsHhYOKpNPlTX0/FafCP7P9fKerndEeIKn54Vw==",
|
||||
"dependencies": {
|
||||
"resend": "^1.1.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"nodemailer": "^6.9.3"
|
||||
}
|
||||
},
|
||||
"node_modules/@documenso/prettier-config": {
|
||||
"resolved": "packages/prettier-config",
|
||||
"link": true
|
||||
@ -19794,6 +19805,7 @@
|
||||
"version": "1.0.0",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@documenso/nodemailer-resend": "1.0.0",
|
||||
"@react-email/components": "^0.0.7",
|
||||
"nodemailer": "^6.9.3",
|
||||
"react-email": "^1.9.4",
|
||||
|
||||
@ -8,7 +8,11 @@
|
||||
"format": "prettier --write \"**/*.{js,jsx,cjs,mjs,ts,tsx,cts,mts,mdx}\"",
|
||||
"prepare": "husky install",
|
||||
"commitlint": "commitlint --edit",
|
||||
"clean": "turbo run clean && rimraf node_modules"
|
||||
"clean": "turbo run clean && rimraf node_modules",
|
||||
"d": "npm run dx && npm run dev",
|
||||
"dx": "npm i && npm run dx:up && npm run prisma:migrate-dev -w @documenso/prisma",
|
||||
"dx:up": "docker compose -f docker/compose-services.yml up -d",
|
||||
"dx:down": "docker compose -f docker/compose-services.yml down"
|
||||
},
|
||||
"engines": {
|
||||
"npm": ">=8.6.0",
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
import { createTransport } from 'nodemailer';
|
||||
|
||||
import { ResendTransport } from '@documenso/nodemailer-resend';
|
||||
|
||||
import { MailChannelsTransport } from './transports/mailchannels';
|
||||
import { ResendTransport } from './transports/resend';
|
||||
|
||||
const getTransport = () => {
|
||||
const transport = process.env.NEXT_PRIVATE_SMTP_TRANSPORT ?? 'smtp-auth';
|
||||
|
||||
@ -17,6 +17,7 @@
|
||||
"worker:test": "tsup worker/index.ts --format esm"
|
||||
},
|
||||
"dependencies": {
|
||||
"@documenso/nodemailer-resend": "1.0.0",
|
||||
"@react-email/components": "^0.0.7",
|
||||
"nodemailer": "^6.9.3",
|
||||
"react-email": "^1.9.4",
|
||||
|
||||
@ -1,145 +0,0 @@
|
||||
import { type SentMessageInfo, type Transport } from 'nodemailer';
|
||||
import type Mail from 'nodemailer/lib/mailer';
|
||||
import type MailMessage from 'nodemailer/lib/mailer/mail-message';
|
||||
import { Resend } from 'resend';
|
||||
|
||||
const VERSION = '1.0.0';
|
||||
|
||||
type ResendTransportOptions = {
|
||||
apiKey: string;
|
||||
};
|
||||
|
||||
type ResendResponseError = {
|
||||
statusCode: number;
|
||||
name: string;
|
||||
message: string;
|
||||
};
|
||||
|
||||
const isResendResponseError = (error: unknown): error is ResendResponseError => {
|
||||
// We could use Zod here, but it's not worth the extra bundle size
|
||||
return (
|
||||
typeof error === 'object' &&
|
||||
error !== null &&
|
||||
'statusCode' in error &&
|
||||
typeof error.statusCode === 'number' &&
|
||||
'name' in error &&
|
||||
typeof error.name === 'string' &&
|
||||
'message' in error &&
|
||||
typeof error.message === 'string'
|
||||
);
|
||||
};
|
||||
|
||||
/**
|
||||
* Transport for sending email via the Resend SDK.
|
||||
*/
|
||||
export class ResendTransport implements Transport<SentMessageInfo> {
|
||||
public name = 'ResendMailTransport';
|
||||
public version = VERSION;
|
||||
|
||||
private _client: Resend;
|
||||
private _options: ResendTransportOptions;
|
||||
|
||||
public static makeTransport(options: Partial<ResendTransportOptions>) {
|
||||
return new ResendTransport(options);
|
||||
}
|
||||
|
||||
constructor(options: Partial<ResendTransportOptions>) {
|
||||
const { apiKey = '' } = options;
|
||||
|
||||
this._options = {
|
||||
apiKey,
|
||||
};
|
||||
|
||||
this._client = new Resend(apiKey);
|
||||
}
|
||||
|
||||
public send(mail: MailMessage, callback: (_err: Error | null, _info: SentMessageInfo) => void) {
|
||||
if (!mail.data.to || !mail.data.from) {
|
||||
return callback(new Error('Missing required fields "to" or "from"'), null);
|
||||
}
|
||||
|
||||
this._client
|
||||
.sendEmail({
|
||||
subject: mail.data.subject ?? '',
|
||||
from: this.toResendFromAddress(mail.data.from),
|
||||
to: this.toResendAddresses(mail.data.to),
|
||||
cc: this.toResendAddresses(mail.data.cc),
|
||||
bcc: this.toResendAddresses(mail.data.bcc),
|
||||
html: mail.data.html?.toString() || '',
|
||||
text: mail.data.text?.toString() || '',
|
||||
attachments: this.toResendAttachments(mail.data.attachments),
|
||||
})
|
||||
.then((response) => {
|
||||
if (isResendResponseError(response)) {
|
||||
throw new Error(`[${response.statusCode}]: ${response.name} ${response.message}`);
|
||||
}
|
||||
|
||||
callback(null, response);
|
||||
})
|
||||
.catch((error) => {
|
||||
callback(error, null);
|
||||
});
|
||||
}
|
||||
|
||||
private toResendAddresses(addresses: Mail.Options['to']) {
|
||||
if (!addresses) {
|
||||
return [];
|
||||
}
|
||||
|
||||
if (typeof addresses === 'string') {
|
||||
return [addresses];
|
||||
}
|
||||
|
||||
if (Array.isArray(addresses)) {
|
||||
return addresses.map((address) => {
|
||||
if (typeof address === 'string') {
|
||||
return address;
|
||||
}
|
||||
|
||||
return address.address;
|
||||
});
|
||||
}
|
||||
|
||||
return [addresses.address];
|
||||
}
|
||||
|
||||
private toResendFromAddress(address: Mail.Options['from']) {
|
||||
if (!address) {
|
||||
return '';
|
||||
}
|
||||
|
||||
if (typeof address === 'string') {
|
||||
return address;
|
||||
}
|
||||
|
||||
return `${address.name} <${address.address}>`;
|
||||
}
|
||||
|
||||
private toResendAttachments(attachments: Mail.Options['attachments']) {
|
||||
if (!attachments) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return attachments.map((attachment) => {
|
||||
if (!attachment.filename || !attachment.content) {
|
||||
throw new Error('Attachment is missing filename or content');
|
||||
}
|
||||
|
||||
if (typeof attachment.content === 'string') {
|
||||
return {
|
||||
filename: attachment.filename,
|
||||
content: Buffer.from(attachment.content),
|
||||
};
|
||||
}
|
||||
|
||||
if (attachment.content instanceof Buffer) {
|
||||
return {
|
||||
filename: attachment.filename,
|
||||
content: attachment.content,
|
||||
};
|
||||
}
|
||||
|
||||
throw new Error('Attachment content must be a string or a buffer');
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -118,7 +118,7 @@ export const SigningCard3D = ({ className, name, signingCelebrationImage }: Sign
|
||||
style={{ perspective: 800 }}
|
||||
>
|
||||
<motion.div
|
||||
className="bg-background w-full [--sheen-color:180_180_180] dark:[--sheen-color:200_200_200]"
|
||||
className="bg-background w-full rounded-lg [--sheen-color:180_180_180] dark:[--sheen-color:200_200_200]"
|
||||
ref={cardRef}
|
||||
style={{
|
||||
perspective: '800',
|
||||
|
||||
@ -425,7 +425,7 @@ export const AddFieldsFormPartial = ({
|
||||
<CardContent className="flex flex-col items-center justify-center px-6 py-4">
|
||||
<p
|
||||
className={cn(
|
||||
'text-muted-foreground group-data-[selected]:text-foreground text-3xl font-medium',
|
||||
'text-muted-foreground group-data-[selected]:text-foreground w-full truncate text-3xl font-medium',
|
||||
fontCaveat.className,
|
||||
)}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user