Code Monkey home page Code Monkey logo

identity-idva-gdrive's Introduction

IDVA GDrive Microservice

The IDVA GDrive microservice is a Python Fast API application that interfaces IDVA applications to the Google Drive API.

Building Locally

Pre-requisites

Make sure you have the following installed if you intend to build the project locally.

Development Setup

To set up your environment, run the following commands (or the equivalent commands if not using a bash-like terminal):

# Clone the project
git clone https://github.com/GSA-TTS/identity-idva-gdrive
cd identity-idva-gdrive

# Set up Python virtual environment
python3.11 -m venv .venv
source .venv/bin/activate
# .venv\Scripts\Activate.ps1 on Windows

# Install dependencies and pre-commit hooks
python -m pip install -r requirements-dev.txt
pre-commit install

The project can be ran locally with:
```shell
uvicorn gdrive.main:app

Running the application

After completing development setup application locally with:

python -m pytest

API Endpoints

Upload file

Upload a single file

POST /upload

Query parameters:
id: <parent interaciton id>
filename: <see codenames>
base64: <is base 64>
Request body:
<file data>

Delete file

Upload a single file

DELETE /upload

Query parameters:
filename: <see codenames>

Analytics Export

Exports flow analytics from single interaction id.

POST /export

Query parameters:
interactionId: <parent flow interaciton id>

Analytics + Survey Response Export

Exports analytics in bulk that are associated with a survey response. Also uploads participant data to google spread sheet.

POST /survey-export

Request body:
{
  "surveyId": str
  "responseId": str
  "participant": {
    "first": str
    "last": str
    "email": str
    "time": str
  }
}

Deploying to Cloud.gov during development

All deployments require having the correct Cloud.gov credentials in place. If you haven't already, visit Cloud.gov and set up your account and CLI.

manifest.yml file contains the deployment configuration for cloud.gov, and expects a vars.yaml file that includes runtime variables referenced. For info, see cloud foundry manifest files reference

Running the following cf command will deploy the application to cloud.gov

cf push --vars-file vars.yaml \
  --var ENVIRONMENT=<env>

Public domain

This project is in the worldwide public domain. As stated in CONTRIBUTING:

This project is in the public domain within the United States, and copyright and related rights in the work worldwide are waived through the CC0 1.0 Universal public domain dedication.

All contributions to this project will be released under the CC0 dedication. By submitting a pull request, you are agreeing to comply with this waiver of copyright interest.

identity-idva-gdrive's People

Contributors

dzaslavskiy avatar shumatepf avatar dependabot[bot] 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.