Skip to content

nahankid/omnidoc

Repository files navigation

OmniDoc

Go GitHub Maintainability GitHub repo size GitHub go.mod Go version

OmniDoc is a Document Management System, written in Go and automatically deployed on AWS, using:

  • AWS API Gateway
  • AWS Lambda
  • AWS S3
  • RDS (PostgreSQL)
  • AWS Serverless Application Model (SAM)

Quick start

Add a document to DMS

You can add a document to DMS in two steps:

  1. Get an asset pre-signed upload URL
  2. Upload a file to the pre-signed URL

Get an asset pre-signed upload URL

POST /

Request

{
	"obj_type": "app",
	"obj_id": 402,
	"type": "Loan Agreement",
	"attrs": {
		"key1": "value1",
		"key2": "value2"
	},
	"filename": "Meeting Mania.xlsx"
}

Parameters

Name Type Description
obj_type string Object Type for which the document is being stored - app or user
obj_id int Object ID for which the document is being stored.
type string Type of the document being stored. Valid types:
Loan Agreement
CAF
SOC
NOC
Welcome Letter
Foreclosure Letter
SOA
RPS
Delivery Order
Insurance Form
Vehicle Registration Certificate
Undertaking Docket
FI Report
FCU Report
Property
NACH
PDC
DRD
Passport
PAN
Aadhaar
Driving License
Voter ID Card
NREGA Job Card
Utility Bill
Bank Statement
Rent Agreement
Experian Bureau Report
CIBIL Bureau Report
CRIF Bureau Report
Equifax Bureau Report
CKYC XML
OKYC XML
Aadhaar Front
Aadhaar Back
Driving License Front
Driving License Back
Voter ID Card Front
Voter ID Card Back
Passport Front
Passport Back
Photo
Address Proof
Constitution of Entity
Commercial Cibil Bureau Report
PD Questionnaire
Student Data
CA Certificate
Audit Report
Valuation Report
Legal Report
Financial Statement Analysis Report
Application Form
GST
KYC Docket
CMA Data/Projections
Udyam Certificate
Ownership Proof
Existing Lan Documents
Sanction letter
filename string Filename of the document to be stored.
attrs JSON Any metadata to be stored with the document.

Response

{
    "url": "<SIGNED_URL>",
    "expires_at": "2020-04-28T03:29:26.882234986Z"
}
Name Type Description
url string Presigned URL for uploading the file
expires_at string Time at which the the presigned URL expires.

Upload a file to the pre-signed URL

PUT <SIGNED_URL>

Retrieve documents from DMS

You can rertrieve all documents from DMS for:

  1. Application
  2. User
  3. Application and Type
  4. User and Type
- GET /?o=app&id=402
- GET /?o=app&id=402&t=Loan Agreement
- GET /?o=app&id=402&t=Loan Agreement&e=1440

Parameters

Name Type Description
o string Object Type for which the documents are to be retrieved
id int Object ID for which the documents are to be retrieved
t string Type of document to be retrieved
e int Expiry for the link in minutes (Default: 10 minutes)

Response

[
[
    {
        "asset": {
            "obj_type": "app",
            "obj_id": 121,
            "filename": "/app/121/loanagreement.pdf",
            "type": "Loan Agreement",
            "attrs": {
                "key1": "value1"
            },
            "created_at": "2020-05-23T19:12:19.308369Z",
            "updated_at": "2020-05-23T19:12:19.308369Z"
        },
        "signed_url": {
            "url": "<SIGNED_URL",
            "expires_at": "2020-05-24T04:42:31.6585508Z"
        }
    },
  
]

Contributing to OmniDoc

Fork, fix, then send me a pull request..

License

MIT

About

Serverless Document Management System in Go

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •