Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 14 additions & 47 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,48 +1,29 @@
<p align="center">
<a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo-small.svg" width="200" alt="Nest Logo" /></a>
</p>

[circleci-image]: https://img.shields.io/circleci/build/github/nestjs/nest/master?token=abc123def456
[circleci-url]: https://circleci.com/gh/nestjs/nest
<h1>Doc Generator</h1>

<p align="center">A progressive <a href="http://nodejs.org" target="_blank">Node.js</a> framework for building efficient and scalable server-side applications.</p>
<p align="center">
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/v/@nestjs/core.svg" alt="NPM Version" /></a>
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/l/@nestjs/core.svg" alt="Package License" /></a>
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/dm/@nestjs/common.svg" alt="NPM Downloads" /></a>
<a href="https://circleci.com/gh/nestjs/nest" target="_blank"><img src="https://img.shields.io/circleci/build/github/nestjs/nest/master" alt="CircleCI" /></a>
<a href="https://coveralls.io/github/nestjs/nest?branch=master" target="_blank"><img src="https://coveralls.io/repos/github/nestjs/nest/badge.svg?branch=master#9" alt="Coverage" /></a>
<a href="https://discord.gg/G7Qnnhy" target="_blank"><img src="https://img.shields.io/badge/discord-online-brightgreen.svg" alt="Discord"/></a>
<a href="https://opencollective.com/nest#backer" target="_blank"><img src="https://opencollective.com/nest/backers/badge.svg" alt="Backers on Open Collective" /></a>
<a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://opencollective.com/nest/sponsors/badge.svg" alt="Sponsors on Open Collective" /></a>
<a href="https://paypal.me/kamilmysliwiec" target="_blank"><img src="https://img.shields.io/badge/Donate-PayPal-ff3f59.svg"/></a>
<a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://img.shields.io/badge/Support%20us-Open%20Collective-41B883.svg" alt="Support us"></a>
<a href="https://twitter.com/nestframework" target="_blank"><img src="https://img.shields.io/twitter/follow/nestframework.svg?style=social&label=Follow"></a>
</p>
<!--[![Backers on Open Collective](https://opencollective.com/nest/backers/badge.svg)](https://opencollective.com/nest#backer)
[![Sponsors on Open Collective](https://opencollective.com/nest/sponsors/badge.svg)](https://opencollective.com/nest#sponsor)-->

## Description
[![Build](https://github.com/Samagra-Development/PDF-Package/actions/workflows/docker-push.yml/badge.svg)](https://github.com/Samagra-Development/PDF-Package/actions/workflows/docker-push.yml)

[Nest](https://github.com/nestjs/nest) framework TypeScript starter repository.
## About :open_book:

## Installation
An easy tool for generating single and bulk documents in several supported formats from templates.

## Dev Setup
```bash
$ yarn install
```
# create .env file
$ cp .env.copy .env

## Running the app
# start all microservices and application(watch mode)
$ bash run.sh start
## swagger docs available at /swagger

```bash
# development
$ yarn run start
# stop all microservices
$ bash run.sh stop

# watch mode
$ yarn run start:dev

# production mode
$ yarn run start:prod
# help
$ bash run.sh --help
```

## Test
Expand All @@ -57,17 +38,3 @@ $ yarn run test:e2e
# test coverage
$ yarn run test:cov
```

## Support

Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support).

## Stay in touch

- Author - [Kamil Myśliwiec](https://kamilmysliwiec.com)
- Website - [https://nestjs.com](https://nestjs.com/)
- Twitter - [@nestframework](https://twitter.com/nestframework)

## License

Nest is [MIT licensed](LICENSE).
3 changes: 2 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ services:

broker:
container_name: broker
image: "arm64v8/rabbitmq"
image: "docker.io/bitnami/rabbitmq:latest"
# image: "arm64v8/rabbitmq"
environment:
- RABBITMQ_PASSWORD=${RABBITMQ_PASSWORD}
- RABBITMQ_USERNAME=${RABBITMQ_USERNAME}
Expand Down
5 changes: 0 additions & 5 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,3 @@ datasource db {
url = env("DATABASE_URL")
}

model User {
id Int @id @default(autoincrement())
email String @unique
name String?
}
21 changes: 21 additions & 0 deletions run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

if [[ $1 = "start" ]]
then
echo "starting services"
yarn install
docker-compose up -d
yarn start:dev
elif [[ $1 = "stop" ]]
then
echo "not ok"
docker-compose down
elif [[ $1 = "--help" ]]
then
echo "Usage: run.sh [COMMAND]"
echo "Commands:"
echo "start start all services"
echo "stop stop all services"
else
echo "Invalid Command"
fi
97 changes: 97 additions & 0 deletions src/app.interface.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
import { ApiProperty } from "@nestjs/swagger"

export class StringTypeRequestBody {
@ApiProperty({
description: 'Type of the template',
})
templateType: TemplateType
@ApiProperty({
description: 'Input options',
})
inputType: StringInputType
@ApiProperty({
description: 'Template to be rendered',
})
template?: String
@ApiProperty({
description: 'JWT token if google doc',
})
token?: String
@ApiProperty({
description: 'Variables to be replaced in template',
})
payload?: JSON
outputType: OutputType
deliveryOptions?: DeliveryOptions
storageOptions?: StorageOptions
}

export enum TemplateType {
ID="ID",
EJS="EJS",
JINJA="JINJA",
JSTL="JSTL",
STATIC="STATIC",
}

export enum InputType {
STRING="STRING",
FILE="FILE",
URL="URL",
}

export enum StringInputType {
PDFMAKE="PDFMAKE",
GOOGLEDOC="GOOGLEDOC",
MARKDOWN="MARKDOWN",
MERMAID="MERMAID",
TEMPLATOR="TEMPLATOR"
}

export enum OutputTypeOptions {
SHORTURL="SHORTURL",
WEBPAGE="WEBPAGE",
}

export enum OutputType {
png="png",
jpeg="jpeg",
html="html",
pdf="pdf",
qr="qr",
}

export interface OutputOptions {
type: OutputType,
output: OutputTypeOptions
}

export enum DeliveryType {
WEBHOOK="WEBHOOK",
EMAIL="EMAIL",
}

export interface DeliveryTypeOptions {
// TODO
}

export interface DeliveryOptions {
type: DeliveryType
options: DeliveryTypeOptions
}

export enum StorageType {
S3="S3",
Minio="Minio",
Dropbox="Dropbox",
GoogleDrive="GoogleDrive"
}

export interface StorageOptions {
// TODO
}

export interface StorageOptions {
type: StorageType
options: StorageOptions
}