mirror of
https://github.com/documenso/documenso.git
synced 2026-07-05 18:44:54 +10:00
Compare commits
19 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d6437d6533 | |||
| 52f554a636 | |||
| bcc2530484 | |||
| 5c58b32d92 | |||
| f10bafd998 | |||
| 2cf8896e46 | |||
| e873af3ec9 | |||
| 06501bde60 | |||
| 0dcab27e65 | |||
| ff2334ab55 | |||
| 63bd044723 | |||
| b111874d7c | |||
| 21149f82ba | |||
| cb77a40fd9 | |||
| 7aa7485388 | |||
| 984084dd3b | |||
| 6ea38efd9d | |||
| 49cb50ed6e | |||
| 5dd3713475 |
@@ -0,0 +1,38 @@
|
||||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
||||
|
||||
# dependencies
|
||||
**/node_modules
|
||||
**/.pnp
|
||||
**.pnp.js
|
||||
|
||||
# testing
|
||||
**/coverage
|
||||
|
||||
# next.js
|
||||
**/.next/
|
||||
**/out/
|
||||
|
||||
# production
|
||||
**/build
|
||||
|
||||
# misc
|
||||
.DS_Store
|
||||
*.pem
|
||||
|
||||
# debug
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
.pnpm-debug.log*
|
||||
|
||||
# local env files
|
||||
.env*.local
|
||||
|
||||
# vercel
|
||||
.vercel
|
||||
|
||||
# typescript
|
||||
*.tsbuildinfo
|
||||
next-env.d.ts
|
||||
.env
|
||||
.env.example
|
||||
+10
-1
@@ -1,6 +1,9 @@
|
||||
# Database
|
||||
# Option 1: You can use the provided remote test database, courtesy of the documenso team: postgres://documenso_test_user:GnmLG14u12sd9zHsd4vVWwP40WneFJMo@dpg-cf2hljh4reb5o45oqpq0-a.oregon-postgres.render.com/documenso_test_e2i3
|
||||
# Option 2: Set up a local Postgres SQL instance (RECOMMENDED)
|
||||
# Option 3: Use the provided dx setup (RECOMMENDED)
|
||||
# => postgres://documenso:password@127.0.0.1:54320/documenso
|
||||
#
|
||||
# ⚠ WARNING: The test database can be resetted or taken offline at any point.
|
||||
# ⚠ WARNING: Please be aware that nothing written to the test databae is private.
|
||||
DATABASE_URL=''
|
||||
@@ -20,6 +23,12 @@ SENDGRID_API_KEY=''
|
||||
|
||||
# SMTP
|
||||
# Set SMTP credentials to use SMTP instead of the Sendgrid API.
|
||||
# If you're using the dx setup you can use the following values:
|
||||
#
|
||||
# SMTP_MAIL_HOST='127.0.0.1'
|
||||
# SMTP_MAIL_PORT='2500'
|
||||
# SMTP_MAIL_USER='documenso'
|
||||
# SMTP_MAIL_PASSWORD='documenso'
|
||||
SMTP_MAIL_HOST=''
|
||||
SMTP_MAIL_PORT=''
|
||||
SMTP_MAIL_USER=''
|
||||
@@ -30,4 +39,4 @@ MAIL_FROM='documenso@localhost.com'
|
||||
|
||||
#FEATURE FLAGS
|
||||
# Allow users to register via the /signup page. Otherwise they will be redirect to the home page.
|
||||
ALLOW_SIGNUP=true
|
||||
ALLOW_SIGNUP=true
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
[submodule "apps/website/documenso/website"]
|
||||
path = apps/website/documenso/website
|
||||
url = http://github.com/documenso/website.git
|
||||
@@ -99,6 +99,33 @@ To run Documenso locally you need
|
||||
- Node Package Manger NPM - included in Node.js
|
||||
- [PostgreSQL (local or remote)](https://www.postgresql.org/download/)
|
||||
|
||||
## 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.
|
||||
|
||||
```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
|
||||
```
|
||||
|
||||
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
|
||||
|
||||
Your database will also be available on port `5432`. You can connect to it using your favorite database client.
|
||||
|
||||
## Developer Setup
|
||||
|
||||
Follow these steps to setup documenso on you local machnine:
|
||||
@@ -153,6 +180,15 @@ For the digital signature of you documents you need a signign certificate in .p1
|
||||
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 <code>/apps/web/ressource/certificate.p12</code>
|
||||
|
||||
# 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:
|
||||
|
||||
- Run `./docker/build.sh` in the root directory.
|
||||
- Publish the image to your docker registry of choice.
|
||||
|
||||
# Deploying - Coming Soon™
|
||||
|
||||
- Docker support
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"presets": ["next/babel"],
|
||||
"plugins": []
|
||||
}
|
||||
@@ -1,3 +1,8 @@
|
||||
{
|
||||
"extends": ["next/babel", "next/core-web-vitals"]
|
||||
}
|
||||
"extends": [
|
||||
"next/core-web-vitals"
|
||||
],
|
||||
"rules": {
|
||||
"react/no-unescaped-entities": "off"
|
||||
}
|
||||
}
|
||||
+16
-18
@@ -16,27 +16,16 @@
|
||||
"@headlessui/react": "^1.7.4",
|
||||
"@heroicons/react": "^2.0.13",
|
||||
"@pdf-lib/fontkit": "^1.1.1",
|
||||
"@tailwindcss/forms": "^0.5.3",
|
||||
"@types/bcryptjs": "^2.4.2",
|
||||
"@types/filesystem": "^0.0.32",
|
||||
"@types/react-dom": "18.0.9",
|
||||
"avatar-from-initials": "^1.0.3",
|
||||
"base64-arraybuffer": "^1.0.2",
|
||||
"bcryptjs": "^2.4.3",
|
||||
"dotenv": "^16.0.3",
|
||||
"eslint": "8.27.0",
|
||||
"eslint-config-next": "13.0.3",
|
||||
"file-loader": "^6.2.0",
|
||||
"formidable": "^3.2.5",
|
||||
"install": "^0.13.0",
|
||||
"next": "13.0.3",
|
||||
"next-auth": ">=4.20.1",
|
||||
"next-transpile-modules": "^10.0.0",
|
||||
"next": "13.2.4",
|
||||
"next-auth": "^4.22.0",
|
||||
"node-forge": "^1.3.1",
|
||||
"node-signpdf": "^1.5.0",
|
||||
"nodemailer": "^6.9.0",
|
||||
"nodemailer-sendgrid": "^1.0.3",
|
||||
"npm": "^9.1.3",
|
||||
"pdf-lib": "^1.17.1",
|
||||
"placeholder-loading": "^0.6.0",
|
||||
"react": "18.2.0",
|
||||
@@ -46,12 +35,14 @@
|
||||
"react-pdf": "^6.2.2",
|
||||
"react-resizable": "^3.0.4",
|
||||
"react-tooltip": "^5.7.2",
|
||||
"sass": "^1.57.1",
|
||||
"short-uuid": "^4.2.2",
|
||||
"string-to-color": "^2.2.2",
|
||||
"typescript": "4.8.4"
|
||||
"string-to-color": "^2.2.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tailwindcss/forms": "^0.5.3",
|
||||
"@types/bcryptjs": "^2.4.2",
|
||||
"@types/filesystem": "^0.0.32",
|
||||
"@types/react-dom": "18.0.9",
|
||||
"@types/formidable": "^2.0.5",
|
||||
"@types/node": "^18.11.18",
|
||||
"@types/nodemailer": "^6.4.7",
|
||||
@@ -59,7 +50,14 @@
|
||||
"@types/react-pdf": "^6.2.0",
|
||||
"@types/react-resizable": "^3.0.3",
|
||||
"autoprefixer": "^10.4.13",
|
||||
"dotenv": "^16.0.3",
|
||||
"eslint": "8.27.0",
|
||||
"eslint-config-next": "13.0.3",
|
||||
"file-loader": "^6.2.0",
|
||||
"next-transpile-modules": "^10.0.0",
|
||||
"postcss": "^8.4.19",
|
||||
"tailwindcss": "^3.2.4"
|
||||
"sass": "^1.57.1",
|
||||
"tailwindcss": "^3.2.4",
|
||||
"typescript": "4.8.4"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -175,7 +175,6 @@ const RecipientsPage: NextPageWithLayout = (props: any) => {
|
||||
});
|
||||
}}
|
||||
className="block w-full border-0 bg-inherit p-0 text-gray-900 placeholder-gray-500 outline-none disabled:bg-neutral-100 sm:text-sm"
|
||||
placeholder="john.dorian@loremipsum.com"
|
||||
/>
|
||||
{errors?.signers?.[index] ? (
|
||||
<p className="mt-2 text-sm text-red-600" id="email-error">
|
||||
@@ -213,7 +212,6 @@ const RecipientsPage: NextPageWithLayout = (props: any) => {
|
||||
});
|
||||
}}
|
||||
className="block w-full border-0 bg-inherit p-0 text-gray-900 placeholder-gray-500 outline-none disabled:bg-neutral-100 sm:text-sm"
|
||||
placeholder="John Dorian"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Submodule apps/website/documenso/website deleted from db81fb20e7
@@ -0,0 +1,50 @@
|
||||
FROM node:18-alpine AS base
|
||||
|
||||
# Install dependencies only when needed
|
||||
FROM base AS production_deps
|
||||
WORKDIR /app
|
||||
|
||||
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
|
||||
RUN apk add --no-cache libc6-compat
|
||||
|
||||
# Copy our current monorepo
|
||||
COPY . .
|
||||
|
||||
RUN npm ci --production
|
||||
|
||||
# Install dependencies only when needed
|
||||
FROM base AS builder
|
||||
WORKDIR /app
|
||||
|
||||
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
|
||||
RUN apk add --no-cache libc6-compat
|
||||
|
||||
# Copy our current monorepo
|
||||
COPY . .
|
||||
|
||||
RUN npm ci
|
||||
|
||||
RUN npm run build --workspaces
|
||||
|
||||
# Production image, copy all the files and run next
|
||||
FROM base AS runner
|
||||
WORKDIR /app
|
||||
|
||||
ENV NODE_ENV production
|
||||
ENV NEXT_TELEMETRY_DISABLED 1
|
||||
|
||||
RUN addgroup --system --gid 1001 nodejs
|
||||
RUN adduser --system --uid 1001 nextjs
|
||||
|
||||
COPY --from=production_deps --chown=nextjs:nodejs /app/node_modules ./node_modules
|
||||
COPY --from=production_deps --chown=nextjs:nodejs /app/package-lock.json ./package-lock.json
|
||||
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/apps/web/package.json ./package.json
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/apps/web/public ./public
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/apps/web/.next ./.next
|
||||
|
||||
EXPOSE 3000
|
||||
|
||||
ENV PORT 3000
|
||||
|
||||
CMD ["npm", "run", "start"]
|
||||
Executable
+28
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
command -v docker >/dev/null 2>&1 || {
|
||||
echo "Docker is not running. Please start Docker and try again."
|
||||
exit 1
|
||||
}
|
||||
|
||||
command -v jq >/dev/null 2>&1 || {
|
||||
echo "jq is not installed. Please install jq and try again."
|
||||
exit 1
|
||||
}
|
||||
|
||||
SCRIPT_DIR="$(readlink -f "$(dirname "$0")")"
|
||||
MONOREPO_ROOT="$(readlink -f "$SCRIPT_DIR/../")"
|
||||
|
||||
APP_VERSION="$(jq -r '.version' "$MONOREPO_ROOT/apps/web/package.json")"
|
||||
GIT_SHA="$(git rev-parse HEAD)"
|
||||
|
||||
echo "Building docker image for monorepo at $MONOREPO_ROOT"
|
||||
echo "App version: $APP_VERSION"
|
||||
echo "Git SHA: $GIT_SHA"
|
||||
|
||||
docker build -f "$SCRIPT_DIR/Dockerfile" \
|
||||
--progress=plain \
|
||||
-t "documentso:latest" \
|
||||
-t "documenso:$GIT_SHA" \
|
||||
-t "documenso:$APP_VERSION" \
|
||||
"$MONOREPO_ROOT"
|
||||
Executable
+12
@@ -0,0 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
SCRIPT_DIR="$(readlink -f "$(dirname "$0")")"
|
||||
MONOREPO_ROOT="$(readlink -f "$SCRIPT_DIR/../")"
|
||||
|
||||
cd "$MONOREPO_ROOT"
|
||||
|
||||
npm ci
|
||||
|
||||
npm run db-migrate:dev
|
||||
|
||||
npm run dev
|
||||
@@ -0,0 +1,16 @@
|
||||
services:
|
||||
database:
|
||||
image: postgres:15
|
||||
environment:
|
||||
- POSTGRES_USER=documenso
|
||||
- POSTGRES_PASSWORD=password
|
||||
- POSTGRES_DB=documenso
|
||||
ports:
|
||||
- 54320:5432
|
||||
|
||||
inbucket:
|
||||
image: inbucket/inbucket
|
||||
ports:
|
||||
- 9000:9000
|
||||
- 2500:2500
|
||||
- 1100:1100
|
||||
@@ -0,0 +1,40 @@
|
||||
services:
|
||||
database:
|
||||
image: postgres:15
|
||||
environment:
|
||||
- POSTGRES_USER=documenso
|
||||
- POSTGRES_PASSWORD=password
|
||||
- POSTGRES_DB=documenso
|
||||
ports:
|
||||
- 5432:5432
|
||||
|
||||
inbucket:
|
||||
image: inbucket/inbucket
|
||||
ports:
|
||||
- 9000:9000
|
||||
- 2500:2500
|
||||
- 1100:1100
|
||||
|
||||
documenso:
|
||||
image: node:18
|
||||
working_dir: /app
|
||||
command: ./docker/compose-entrypoint.sh
|
||||
depends_on:
|
||||
- database
|
||||
- inbucket
|
||||
environment:
|
||||
- DATABASE_URL=postgres://documenso:password@database:5432/documenso
|
||||
- NEXT_PUBLIC_WEBAPP_URL=http://localhost:3000
|
||||
- NEXTAUTH_SECRET=my-super-secure-secret
|
||||
- NEXTAUTH_URL=http://localhost:3000
|
||||
- SENDGRID_API_KEY=
|
||||
- SMTP_MAIL_HOST=inbucket
|
||||
- SMTP_MAIL_PORT=2500
|
||||
- SMTP_MAIL_USER=username
|
||||
- SMTP_MAIL_PASSWORD=password
|
||||
- MAIL_FROM=admin@example.com
|
||||
- ALLOW_SIGNUP=true
|
||||
ports:
|
||||
- 3000:3000
|
||||
volumes:
|
||||
- ../:/app
|
||||
Submodule
+1
Submodule documenso added at 0dcab27e65
Generated
+1625
-4818
File diff suppressed because it is too large
Load Diff
+22
-18
@@ -2,12 +2,17 @@
|
||||
"name": "documenso-monorepo",
|
||||
"version": "0.0.0",
|
||||
"scripts": {
|
||||
"dev": "cd apps && cd web && next dev",
|
||||
"dev": "npm run dev -w apps/web",
|
||||
"build": "npm i && cd apps && cd web && npm i && next build",
|
||||
"start": "cd apps && cd web && next start",
|
||||
"db-migrate:dev": "prisma migrate dev",
|
||||
"db-seed": "prisma db seed",
|
||||
"db-studio": "prisma studio"
|
||||
"db-studio": "prisma studio",
|
||||
"docker:compose": "docker-compose -f ./docker/compose-without-app.yml",
|
||||
"docker:compose-up": "npm run docker:compose -- up -d",
|
||||
"docker:compose-down": "npm run docker:compose -- down",
|
||||
"dx": "npm install && run-s docker:compose-up db-migrate:dev",
|
||||
"d": "npm install && run-s docker:compose-up db-migrate:dev && npm run db-seed && npm run dev"
|
||||
},
|
||||
"workspaces": [
|
||||
"apps/*",
|
||||
@@ -21,32 +26,31 @@
|
||||
"@documenso/prisma": "*",
|
||||
"@headlessui/react": "^1.7.4",
|
||||
"@heroicons/react": "^2.0.13",
|
||||
"@tailwindcss/forms": "^0.5.3",
|
||||
"@types/bcryptjs": "^2.4.2",
|
||||
"@types/node": "18.11.9",
|
||||
"@types/react-dom": "18.0.9",
|
||||
"@types/react-signature-canvas": "^1.0.2",
|
||||
"avatar-from-initials": "^1.0.3",
|
||||
"bcryptjs": "^2.4.3",
|
||||
"dotenv": "^16.0.3",
|
||||
"eslint": "8.27.0",
|
||||
"eslint-config-next": "13.0.3",
|
||||
"install": "^0.13.0",
|
||||
"next": "13.0.3",
|
||||
"next": "13.2.4",
|
||||
"next-auth": ">=4.20.1",
|
||||
"next-transpile-modules": "^10.0.0",
|
||||
"npm": "^9.1.3",
|
||||
"pdf-lib": "^1.17.1",
|
||||
"react": "18.2.0",
|
||||
"react-dom": "18.2.0",
|
||||
"react-hook-form": "^7.41.5",
|
||||
"react-hot-toast": "^2.4.0",
|
||||
"react-signature-canvas": "^1.0.6",
|
||||
"typescript": "4.8.4"
|
||||
"react-signature-canvas": "^1.0.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tailwindcss/forms": "^0.5.3",
|
||||
"@trivago/prettier-plugin-sort-imports": "^4.1.1",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"@types/bcryptjs": "^2.4.2",
|
||||
"@types/node": "18.11.9",
|
||||
"@types/react-dom": "18.0.9",
|
||||
"@types/react-signature-canvas": "^1.0.2",
|
||||
"dotenv": "^16.0.3",
|
||||
"eslint": "8.27.0",
|
||||
"eslint-config-next": "13.0.3",
|
||||
"next-transpile-modules": "^10.0.0",
|
||||
"prettier": "^2.8.7",
|
||||
"prettier-plugin-tailwindcss": "^0.2.5"
|
||||
"prettier-plugin-tailwindcss": "^0.2.5",
|
||||
"typescript": "4.8.4"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -26,7 +26,7 @@ export async function getUserFromToken(
|
||||
});
|
||||
|
||||
if (!user) {
|
||||
if (res) res.status(401).end();
|
||||
if (res && res.status) res.status(401).end();
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,20 +3,20 @@
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"main": "index.ts",
|
||||
"devDependencies": {
|
||||
"@types/node": "^18.11.18",
|
||||
"ts-node": "^10.9.1",
|
||||
"typescript": "4.8.4"
|
||||
"scripts": {
|
||||
"db-studio": "prisma studio",
|
||||
"db-seed": "prisma db seed"
|
||||
},
|
||||
"dependencies": {
|
||||
"@prisma/client": "^4.8.1",
|
||||
"prisma": "^4.8.1"
|
||||
},
|
||||
"scripts": {
|
||||
"db-studio": "prisma studio",
|
||||
"db-seed": "prisma db seed"
|
||||
"devDependencies": {
|
||||
"@types/node": "^18.11.18",
|
||||
"ts-node": "^10.9.1",
|
||||
"typescript": "4.8.4"
|
||||
},
|
||||
"prisma": {
|
||||
"seed": "ts-node --transpile-only ./seed.ts"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user