diff --git a/apps/documentation/pages/_app.mdx b/apps/documentation/pages/_app.mdx new file mode 100644 index 000000000..3f5e9bbd5 --- /dev/null +++ b/apps/documentation/pages/_app.mdx @@ -0,0 +1,7 @@ +import '../styles.css' + +export default function App({ Component, pageProps }) { + return + + +} diff --git a/apps/documentation/pages/_meta.json b/apps/documentation/pages/_meta.json index e6734b530..0c6efdb55 100644 --- a/apps/documentation/pages/_meta.json +++ b/apps/documentation/pages/_meta.json @@ -1,7 +1,27 @@ { - "index": "My Homepage", - "contact": "Contact Us", - "about": "About Us", + "index": { + "title": "Home", + "type": "page", + "theme": { + "layout": "full", + "sidebar": false + } + }, + "local-development": { + "title": "Local Development", + "type": "page" + }, + "api": { + "title": "API", + "type": "page" + }, + "webhook": { + "title": "Webhook", + "type": "page" + }, + "---": { + "type": "separator" + }, "GitHub": { "title": "View on GitHub", "href": "https://documen.so/github", diff --git a/apps/documentation/pages/api/api.mdx b/apps/documentation/pages/api/api.mdx new file mode 100644 index 000000000..ffe864ac6 --- /dev/null +++ b/apps/documentation/pages/api/api.mdx @@ -0,0 +1,3 @@ +# Hello world + +Hey there! diff --git a/apps/documentation/pages/index.mdx b/apps/documentation/pages/index.mdx index ffe864ac6..07576477d 100644 --- a/apps/documentation/pages/index.mdx +++ b/apps/documentation/pages/index.mdx @@ -1,3 +1,10 @@ -# Hello world +export const Wrapper = ({ children }) => { + return
{children}
; +}; -Hey there! + + # Hello World + +My first Nextra page. + + diff --git a/apps/documentation/pages/local-development/_meta.json b/apps/documentation/pages/local-development/_meta.json new file mode 100644 index 000000000..5b3f5ee87 --- /dev/null +++ b/apps/documentation/pages/local-development/_meta.json @@ -0,0 +1,7 @@ +{ + "index": "Home", + "quickstart": "Developer Quickstart", + "manual": "Manual Setup", + "docker": "Docker", + "gitpod": "Gitpod" +} diff --git a/apps/documentation/pages/local-development/docker.mdx b/apps/documentation/pages/local-development/docker.mdx new file mode 100644 index 000000000..ee1c9c41c --- /dev/null +++ b/apps/documentation/pages/local-development/docker.mdx @@ -0,0 +1,150 @@ +# Docker + +We provide a Docker container for Documenso, which is published on both DockerHub and GitHub Container Registry. + +- DockerHub: [https://hub.docker.com/r/documenso/documenso](https://hub.docker.com/r/documenso/documenso) +- GitHub Container Registry: [https://ghcr.io/documenso/documenso](https://ghcr.io/documenso/documenso) + +You can pull the Docker image from either of these registries and run it with your preferred container hosting provider. + +Please note that you will need to provide environment variables for connecting to the database, mailserver, and so forth. + +The following guide will walk you through setting up Documenso using Docker. You can choose between a production setup using Docker Compose or a standalone container. + +## Prerequisites + +Before you begin, ensure that you have the following installed: + +- Docker +- Docker Compose (if using the Docker Compose setup) + +## Option 1: Production Docker Compose Setup + +This setup includes a PostgreSQL database and the Documenso application. You will need to provide your own SMTP details via environment variables. + +1. Download the Docker Compose file from the Documenso repository: [compose.yml](https://raw.githubusercontent.com/documenso/documenso/release/docker/production/compose.yml) +2. Navigate to the directory containing the `compose.yml` file. +3. Create a `.env` file in the same directory and add your SMTP details as well as a few extra environment variables, following the example below: + +``` +NEXTAUTH_SECRET="" +NEXT_PRIVATE_ENCRYPTION_KEY="" +NEXT_PRIVATE_ENCRYPTION_SECONDARY_KEY="" +NEXT_PUBLIC_WEBAPP_URL="" +NEXT_PRIVATE_SMTP_TRANSPORT="smtp-auth" +NEXT_PRIVATE_SMTP_HOST="" +NEXT_PRIVATE_SMTP_PORT= +NEXT_PRIVATE_SMTP_USERNAME="" +NEXT_PRIVATE_SMTP_PASSWORD="" +``` + +4. Update the volume binding for the cert file in the `compose.yml` file to point to your own key file: + +Since the `cert.p12` file is required for signing and encrypting documents, you will need to provide your own key file. Update the volume binding in the `compose.yml` file to point to your key file: + +```yaml +volumes: + - /path/to/your/keyfile.p12:/opt/documenso/cert.p12 +``` + +1. Run the following command to start the containers: + +``` +docker-compose --env-file ./.env -d up +``` + +This will start the PostgreSQL database and the Documenso application containers. + +5. Access the Documenso application by visiting `http://localhost:3000` in your web browser. + +## Option 2: Standalone Docker Container + +If you prefer to host the Documenso application on your container provider of choice, you can use the pre-built Docker image from DockerHub or GitHub's Package Registry. Note that you will need to provide your own database and SMTP host. + +1. Pull the Documenso Docker image: + +``` +docker pull documenso/documenso +``` + +Or, if using GitHub's Package Registry: + +``` +docker pull ghcr.io/documenso/documenso +``` + +2. Run the Docker container, providing the necessary environment variables for your database and SMTP host: + +``` +docker run -d \ + -p 3000:3000 \ + -e NEXTAUTH_URL="" + -e NEXTAUTH_SECRET="" + -e NEXT_PRIVATE_ENCRYPTION_KEY="" + -e NEXT_PRIVATE_ENCRYPTION_SECONDARY_KEY="" + -e NEXT_PUBLIC_WEBAPP_URL="" + -e NEXT_PRIVATE_DATABASE_URL="" + -e NEXT_PRIVATE_DIRECT_DATABASE_URL="" + -e NEXT_PRIVATE_SMTP_TRANSPORT="" + -e NEXT_PRIVATE_SMTP_FROM_NAME="" + -e NEXT_PRIVATE_SMTP_FROM_ADDRESS="" + -v /path/to/your/keyfile.p12:/opt/documenso/cert.p12 + documenso/documenso +``` + +Replace the placeholders with your actual database and SMTP details. + +1. Access the Documenso application by visiting the URL you provided in the `NEXT_PUBLIC_WEBAPP_URL` environment variable in your web browser. + +## Success + +You have now successfully set up Documenso using Docker. You can start organizing and managing your documents efficiently. If you encounter any issues or have further questions, please refer to the official Documenso documentation or seek assistance from the community. + +## Advanced Configuration + +The environment variables listed above are a subset of those that are available for configuring Documenso. For a complete list of environment variables and their descriptions, refer to the table below: + +Here's a markdown table documenting all the provided environment variables: + +| Variable | Description | +| -------------------------------------------- | --------------------------------------------------------------------------------------------------- | +| `PORT` | The port to run the Documenso application on, defaults to `3000`. | +| `NEXTAUTH_URL` | The URL for the NextAuth.js authentication service. | +| `NEXTAUTH_SECRET` | The secret key used by NextAuth.js for encryption and signing. | +| `NEXT_PRIVATE_ENCRYPTION_KEY` | The primary encryption key for symmetric encryption and decryption (at least 32 characters). | +| `NEXT_PRIVATE_ENCRYPTION_SECONDARY_KEY` | The secondary encryption key for symmetric encryption and decryption (at least 32 characters). | +| `NEXT_PRIVATE_GOOGLE_CLIENT_ID` | The Google client ID for Google authentication (optional). | +| `NEXT_PRIVATE_GOOGLE_CLIENT_SECRET` | The Google client secret for Google authentication (optional). | +| `NEXT_PUBLIC_WEBAPP_URL` | The URL for the web application. | +| `NEXT_PRIVATE_DATABASE_URL` | The URL for the primary database connection (with connection pooling). | +| `NEXT_PRIVATE_DIRECT_DATABASE_URL` | The URL for the direct database connection (without connection pooling). | +| `NEXT_PRIVATE_SIGNING_TRANSPORT` | The signing transport to use. Available options: local (default) | +| `NEXT_PRIVATE_SIGNING_PASSPHRASE` | The passphrase for the key file. | +| `NEXT_PRIVATE_SIGNING_LOCAL_FILE_CONTENTS` | The base64-encoded contents of the key file, will be used instead of file path. | +| `NEXT_PRIVATE_SIGNING_LOCAL_FILE_PATH` | The path to the key file, default `/opt/documenso/cert.p12`. | +| `NEXT_PUBLIC_UPLOAD_TRANSPORT` | The transport to use for file uploads (database or s3). | +| `NEXT_PRIVATE_UPLOAD_ENDPOINT` | The endpoint for the S3 storage transport (for third-party S3-compatible providers). | +| `NEXT_PRIVATE_UPLOAD_FORCE_PATH_STYLE` | Whether to force path-style URLs for the S3 storage transport. | +| `NEXT_PRIVATE_UPLOAD_REGION` | The region for the S3 storage transport (defaults to us-east-1). | +| `NEXT_PRIVATE_UPLOAD_BUCKET` | The bucket to use for the S3 storage transport. | +| `NEXT_PRIVATE_UPLOAD_ACCESS_KEY_ID` | The access key ID for the S3 storage transport. | +| `NEXT_PRIVATE_UPLOAD_SECRET_ACCESS_KEY` | The secret access key for the S3 storage transport. | +| `NEXT_PRIVATE_SMTP_TRANSPORT` | The transport to use for sending emails (smtp-auth, smtp-api, resend, or mailchannels). | +| `NEXT_PRIVATE_SMTP_HOST` | The host for the SMTP server for SMTP transports. | +| `NEXT_PRIVATE_SMTP_PORT` | The port for the SMTP server for SMTP transports. | +| `NEXT_PRIVATE_SMTP_USERNAME` | The username for the SMTP server for the `smtp-auth` transport. | +| `NEXT_PRIVATE_SMTP_PASSWORD` | The password for the SMTP server for the `smtp-auth` transport. | +| `NEXT_PRIVATE_SMTP_APIKEY_USER` | The API key user for the SMTP server for the `smtp-api` transport. | +| `NEXT_PRIVATE_SMTP_APIKEY` | The API key for the SMTP server for the `smtp-api` transport. | +| `NEXT_PRIVATE_SMTP_SECURE` | Whether to force the use of TLS for the SMTP server for SMTP transports. | +| `NEXT_PRIVATE_SMTP_FROM_ADDRESS` | The email address for the "from" address. | +| `NEXT_PRIVATE_SMTP_FROM_NAME` | The sender name for the "from" address. | +| `NEXT_PRIVATE_RESEND_API_KEY` | The API key for Resend.com for the `resend` transport. | +| `NEXT_PRIVATE_MAILCHANNELS_API_KEY` | The optional API key for MailChannels (if using a proxy) for the `mailchannels` transport. | +| `NEXT_PRIVATE_MAILCHANNELS_ENDPOINT` | The optional endpoint for the MailChannels API (if using a proxy) for the `mailchannels` transport. | +| `NEXT_PRIVATE_MAILCHANNELS_DKIM_DOMAIN` | The domain for DKIM signing with MailChannels for the `mailchannels` transport. | +| `NEXT_PRIVATE_MAILCHANNELS_DKIM_SELECTOR` | The selector for DKIM signing with MailChannels for the `mailchannels` transport. | +| `NEXT_PRIVATE_MAILCHANNELS_DKIM_PRIVATE_KEY` | The private key for DKIM signing with MailChannels for the `mailchannels` transport. | +| `NEXT_PUBLIC_DOCUMENT_SIZE_UPLOAD_LIMIT` | The maximum document upload limit displayed to the user (in MB). | +| `NEXT_PUBLIC_POSTHOG_KEY` | The optional PostHog key for analytics and feature flags. | +| `NEXT_PUBLIC_DISABLE_SIGNUP` | Whether to disable user signups through the /signup page. | diff --git a/apps/documentation/pages/local-development/gitpod.mdx b/apps/documentation/pages/local-development/gitpod.mdx new file mode 100644 index 000000000..1206a01a9 --- /dev/null +++ b/apps/documentation/pages/local-development/gitpod.mdx @@ -0,0 +1,5 @@ +# Run in Gitpod + +- Click below to launch a ready-to-use Gitpod workspace in your browser. + +[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/documenso/documenso) diff --git a/apps/documentation/pages/local-development/index.mdx b/apps/documentation/pages/local-development/index.mdx new file mode 100644 index 000000000..91c5e01f0 --- /dev/null +++ b/apps/documentation/pages/local-development/index.mdx @@ -0,0 +1,10 @@ +# Local development + +There are multiple ways of setting up Documenso for local development. At the moment of writing this documentation, there are 4 ways of running Documenso locally: + +- [Using the developer quickstart](/local-development/quickstart) +- [Manually setting up the development environment](/local-development/manual) +- [Using the Docker image](/local-development/docker) +- [Using Gitpod](/local-development/gitpod) + +Pick the one that fits your needs the best. diff --git a/apps/documentation/pages/local-development/manual.mdx b/apps/documentation/pages/local-development/manual.mdx new file mode 100644 index 000000000..669a870b8 --- /dev/null +++ b/apps/documentation/pages/local-development/manual.mdx @@ -0,0 +1,38 @@ +# Manual Setup + +Follow these steps to setup Documenso on your local machine: + +1. [Fork this repository](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/about-forks) to your GitHub account. + +After forking the repository, clone it to your local device by using the following command: + +```sh +git clone https://github.com//documenso +``` + +2. Run `npm i` in the 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 environment 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` + +6. Run `npm run dev` in the root directory to start + +7. Register a new user at http://localhost:3000/signup + +--- + +- 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)**. diff --git a/apps/documentation/pages/local-development/quickstart.mdx b/apps/documentation/pages/local-development/quickstart.mdx new file mode 100644 index 000000000..abeda7b30 --- /dev/null +++ b/apps/documentation/pages/local-development/quickstart.mdx @@ -0,0 +1,38 @@ +# 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: + +1. [Fork this repository](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/about-forks) to your GitHub account. + +After forking the repository, clone it to your local device by using the following command: + +```sh +git clone https://github.com//documenso +``` + +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. + +3. Run `npm run dx` in the root directory + + - 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. + +4. **S3 Storage Dashboard** - http://localhost:9001 diff --git a/apps/documentation/pages/webhook/webhook.mdx b/apps/documentation/pages/webhook/webhook.mdx new file mode 100644 index 000000000..ffe864ac6 --- /dev/null +++ b/apps/documentation/pages/webhook/webhook.mdx @@ -0,0 +1,3 @@ +# Hello world + +Hey there! diff --git a/apps/documentation/styles.css b/apps/documentation/styles.css new file mode 100644 index 000000000..b5c61c956 --- /dev/null +++ b/apps/documentation/styles.css @@ -0,0 +1,3 @@ +@tailwind base; +@tailwind components; +@tailwind utilities; diff --git a/apps/documentation/theme.config.jsx b/apps/documentation/theme.config.jsx index 1d7e860cb..daa68d977 100644 --- a/apps/documentation/theme.config.jsx +++ b/apps/documentation/theme.config.jsx @@ -1,7 +1,25 @@ -export default { - logo: My Nextra Documentation, +const themeConfig = { + logo: Documenso Documentation, project: { - link: 'https://github.com/shuding/nextra', + link: 'https://documen.so/github', }, - // ... other theme options + chat: { + link: 'https://documen.so/discord', + }, + docsRepositoryBase: 'https://github.com/documenso/documenso/tree/main/apps/documentation', + footer: { + text: ( + + {new Date().getFullYear()} ©{' '} + + Documenso + + . + + ), + }, + primaryHue: 100, + primarySaturation: 48.47, }; + +export default themeConfig;