Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/soulsam480/pdf-donkey

On demand pdf generation with custom templates, variables. PDF monkey but open-source with support for self hosting, docs: https://donkey-docs.sambitsahoo.com/
https://github.com/soulsam480/pdf-donkey

express liquidjs pdf pdf-converter pdf-donkey pdf-generation react template-engine

Last synced: about 2 months ago
JSON representation

On demand pdf generation with custom templates, variables. PDF monkey but open-source with support for self hosting, docs: https://donkey-docs.sambitsahoo.com/

Awesome Lists containing this project

README

        

pdf-donkey

![GitHub package.json version (branch)](https://img.shields.io/github/package-json/v/soulsam480/pdf-donkey/master) ![GitHub](https://img.shields.io/github/license/soulsam480/pdf-donkey) ![Website](https://img.shields.io/website?url=https%3A%2F%2Fdonkey.sambitsahoo.com) [![Netlify Status](https://api.netlify.com/api/v1/badges/13df9f66-77fd-4b37-92ca-95b35918d2de/deploy-status)](https://app.netlify.com/sites/pdf-donkey/deploys)

PDF monkey but open-souce.

PDF Donkey - Open-source PDF Monkey alternative. | Product Hunt

## Status

> ### Donkey API has been shut down

> ### The web app is still running

> ### If you want to use it please see [run it locally](#run-it-locally)

[Changelogs](./CHANGELOG.md)

[Donkey API routes (not perfect)](./packages/api/ROUTES.md)

App url https://donkey.sambitsahoo.com

Features:
- Google OAuth2 login/ JWT Auth
- Template CRUD
- Rich template editing
- Template preview
- PDF Generation
- Custom style

Projected:
- UI refining
- more..
### Stack

api:
- Node v14.x
- Express
- SQLite
- Typeorm
- Typescript
- Route Controllers
- Auth (JWT)/Google OAuth2

app:
- Vite
- React
- React router
- zustand
- Typescript
- Tailwind CSS

### Run it locally

#### Pre-requisites
> You need to have `yarn` installed on your machine as this is a monorepo and uses [`yarn woorkspaces`](https://classic.yarnpkg.com/en/docs/workspaces/).
> create a `.env` file in packages/app and add `VITE_API=http://localhost:3000`
> crate a `.env` file in packages/api and add `REFRESH_TOKEN_SECRET`,`ACCESS_TOKEN_SECRET` with any random value.

- clone `git clone https://github.com/soulsam480/pdf-donkey.git`
- install deps
```bash
yarn
```
- Install postgres and add `.env` variables.
```bash
sudo apt update
sudo apt install postgresql postgresql-contrib

sudo -u postgres createuser --interactive
# name: username
# password: userpassword
# hit yes on all questions

createdb db_name # or your db name must be same with linux user name
# or sudo -u postgres createdb your_db_name

# needed to create extensions
grant all privileges on database db_name to user_name

# change user password for new postgres user
alter user user_name with password 'new_password'

# to use postgres properly in ubuntu we need to add a user
sudo adduser user_name # or your username, should be same with postgres user-role and db name

sudo -u user_name psql # log in to postgres with username

# install uuid extension
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";

```
- Add .env variables
```bash
PGRES_USER=
PGRES_PASS=
PGRES_HOST=
PGRES_DB=
```
- Run it
```bash
# start server
yarn serve # starts both app and api

# build for deployment
yarn build
```

Any contributions are welcome. Reach me on [[email protected]](mailto:[email protected])