Code Monkey home page Code Monkey logo

doc-generator's Introduction

Doc Generator

Build

Try it ๐Ÿ‘€

Open in Gitpod

About ๐Ÿ“–

An easily integrable and resusable tool built on OSS, can be easily leveraged to generate single and bulk documents in the any available formats interoperably and at same time it can upload the docs to your CDN and generate a short url for the content, you can integerate any url shortener service like bit.ly, tinyurl, etc (check our own url shortener service here). This service is developed on a plugin based model to ensure API federation across service and allow easy development of new plugins with less chances of error.

Features ๐ŸŽฏ

  • Allow doc generation(.pdf, .docx, .png) from Google Doc templates

  • Allow bulk request processing

  • Allow easy integration for multiple CDN providers

  • Allow easy integrations for URL shortener services

  • Allow real time transforms on the raw data for complex template processing

  • Allow audit logs for tracking doc generation stages (useful in case of tracking async requests like bulk processing requests)

  • Allow image in template processing request (by url and meta)

  • Interactive UI for template validation and doc preview before generation

Requirements ๐Ÿ“œ

  1. Your machine should have Python and pip installed.

Note: Preferable Python version (3.9.7) and Ubuntu OS version(18.04)*

  1. Check the python and ubuntu version by running following commands.
python --version

lsb_release -a

Installation Steps ๐Ÿšถ

1. Fork it ๐Ÿด

You can get your own fork/copy of Doc-Generator by using the Fork button.

2. Clone it ๐Ÿ‘ฅ

You need to clone (download) it to a local machine using

https://github.com/Samagra-Development/Doc-Generator.git

This makes a local copy of the repository in your machine.

Once you have cloned the Doc-Generator repository in GitHub, move to that folder first using the change directory command.

cd Doc-Generator

Move to this folder for all other commands.

3. Set it up โฌ†๏ธ

Run the following commands to see that your local copy has a reference to your forked remote repository in GitHub :octocat:

git remote -v

origin https://github.com/Your_Username/Doc-Generator.git (fetch)

origin https://github.com/Your_Username/Doc-Generator.git (push)

4. Run it ๐Ÿ

  • rename env.sample file to .env and set the correct variable values

  • build and run the container docker-compose up -d

docker-compose up -d

5. API

Start the server and go to http://localhost:8000/swagger/

Sample Postman Collection here

6. Contribution ๐Ÿ”จ

  1. Preequisites:
  • Minio (You can find how to run a minio instance on local here)

  • Teamplater Engine (You can find fork it here and run a docker-compose instance)

  1. Update the .env file and place it in the root folder with docker-coompose file

  2. Run the docker-compose file in the project root folder to run an instance of doc generator.

  3. Create a superuser docker-compose run web python manage.py createsuperuser

  4. Got to http://localhost:8000/admin and login with your credentials

  5. Create a sample GeneralConfig entry.

Note: GeneralConfig is encrypted store for storing your configurations and credentials

Sample GeneralConfig entry:

{
  "APPLICATION_SETTINGS_FILE": "gdrive_dev_settings.yaml", //needed in case of integration with google drive for docs
  "CREDENTIAL_SETTINGS_FILE": "gdrive_dev_creds.json", //needed in case of integration with google drive for docs
  "MINIO_HOST": "YOUR MINIO HOST WITH PORT", // host:port
  "MINIO_ACCESS_KEY": "", // minio/s3 username for login
  "MINIO_SECRET_KEY": "", // minio/s3 password for login
  "MINIO_BUCKET_NAME": "doc-generator", // name of the minio bucket used for storing docs
  "SHORTENER_URL": "{{yaus_host_address}}/sr/addURL" // can be any url shortener service url
}

you will need to move the .yaml and .json file downloaded on first authentication with your google drive in creds folder for non interactive authentications to google drive. check this link for reference on how to integrate with google APIs.

Note: This is a sample json config which can be fetched at runtime by the service. It can store all kinds of variables in a key value pair.

  1. Now you can import the postman API collections provided above and make sample requests to check APIs.

  2. You can find sample interfaces for creating new Plugin creation here.

You can check sample plugins here.

7. Documentation ๐Ÿ“–

Docs can be found here

doc-generator's People

Contributors

kamalauriga avatar radhay-samagra avatar chakshugautam avatar aayushkedia95 avatar abhay-86 avatar tushar5526 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.