Code Monkey home page Code Monkey logo

foia-api's Introduction

DOJ FOIA Project

The DOJ FOIA project's larger purpose is to create a single, unified portal for the submission of Freedom of Information Act (FOIA) requests. This code base's part in that larger goal is to create a Drupal backend which will be accessed by a front-end being developed by 18F.

The backend is currently implemented on the Lightning distro, stealing numerous approaches/configurations from the Reservoir project

BLT

Please see the BLT documentation for information on build, testing, and deployment processes.

Local setup

Follow steps 1-5 from the initial setup section in BLT's docs, as well as 1-3 from the VM steps. Note that you do not need to follow the steps to install npm/nvm on your host machine. If we end up working frontend tasks, these steps can take place within the VM.

VM-related software version suggestions:

  • Virtualbox - 6.0.8
  • Vagrant - 2.2.2
  • Ansible - 2.8.1

Also, be sure to have Vagrant plugins installed:

  • vagrant-auto_network (1.0.3, global)
  • vagrant-exec (0.5.3, global)
  • vagrant-hostmanager (1.8.9, global)
  • vagrant-hostsupdater (1.1.1.160, global)
  • vagrant-share (1.1.9, global)
  • vagrant-vbguest (0.19.0, global)

To export to Word docs via PHPDocX locally:

  • Replace the symlink in docroot/libraries with a downloaded copy of PHPDocX which supports PHP namespaces.
  • Ensure an activated license key is set in the phpdocxconfig.ini file.
  • You may also need to reprovision your environment to ensure that the ZipArchive and Tidy PHP extensions are enabled vagrant reload --provision

Local setup - Docker

As an alternative to Drupal VM, Docker can be used to spin up this project.

  • Install "Docker" and run the "Docker Desktop".
  • From the repo root, run the command "ddev start".
  • Import the database through drush.

Resources

foia-api's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

foia-api's Issues

Make Webform module field definitions output as JSON

When accessed using JSONAPI, the output for the fields in a webform is simply a text string. To be more easily machine parseable, this should be rendered as JSON instead.

    "elements": "first_name:\n  '#type': textfield\n  '#title': 'First Name'\n  '#required': true\nlast_name:\n  '#type': textfield\n  '#title': 'Last name'\n  '#required': true\nemail:\n  '#type': email\n  '#title': Email\n  '#required': true\nrequest_description:\n  '#type': textarea\n  '#title': 'Describe the information you''re requesting'\n  '#required': true\n"

Restrict edit access for an Office and its Request Form to users affiliated with that office

On the assumption that representatives from individual FOIA Offices will be logging in to Drupal and creating the content for their Office and defining its request form, we need a means to a) affiliate users with a given Office*, and b) prevent users from editing content not "owned" by their office.

  • A potential edge case we may need to cover is the possibility of an Agency representative who should have edit access to multiple Offices in their Agency.

Remove modules and configuration which were added to support decoupled approach

Now that we have shifted plans and are going to work in a headed/coupled manner, we should remove modules (like, OpenAPI/ReDoc, SimpleOAuth, JSONAPI, etc) which are unnecessary given current known site needs.

If it turns out we need some of the functionality these modules provide, we can add that back in later when the use case for them is more clear.

DOJ-specific VM updates

Two unrelated tweaks needed:

  • The salt.txt file is not being generated locally in the DOJ-specific local build
  • Some documentation would be helpful of how to set up the DB after the code is installed

Determine API authentication mechanism

In order to secure the API endpoints we provide, we'll need to implement some form of API identity verification. That could be a simple API key, OAuth, or something else.

There are two specific cases that will need to be addressed.

  1. The front-end connecting to the API to read data and submit Requests
  2. Individual FOIA Offices making API calls directly to the backend to update the status of a Request.

Begin documentation for a project user guide

Begin creating system documentation for the features created thus far, including content types, taxonomies, API endpoints, and implemented user stories.

For an initial starting point, work from the Architectural Review documents (as we'll want to start that process also). For consistency store docs in the repo with the codebase.

Create COG subtheme without the grid

As discussed with 18f on July 18, we will be moving forward with the Cog theme.
As part of this discussion, we will be need to abstract the 'Susy' grid out of the new theme.
This is so we can layer in the "U.S. Web Design Standards" framework and use their grid.

add CORS module

To allow front ends to access the API (assuming they're not on the same domain) we'll need to add the CORS module to set those headers.

Import & Setup UWDS Framework into Cog theme

As discussed with 18f on July 18, we will be moving forward with the Cog theme.

The following steps are required to layer in the "U.S. Web Design Standards" framework:
[ ] Using the npm method of inclusion, add in the framework
[ ] Once the files have been generated, confirm both sass imports and js dependencies are included in gulp task framework

Switch from PHP5.6 to PHP7

By switching to PHP7, we'll get better performance out of Drupal 8. Update the BLT configuration so that the local VM uses PHP7 and file a support request to have our ACE environment updated to use it also.

Determine mechanism to ensure all Request forms require a standard minimum set of fields.

It's been discussed that there are common field elements which the Request forms for all FOIA Offices share. Determine a means to define these elements in one setting so that when forms are created for individual Offices they are not forgotten.

This could, minimally, be a validation on form creation that checks to ensure fields with the required machine names are included. A better UX for the form creators would be a means by which the fields are automatically created when they start a new form. Webform module provides a templates feature which might be able to provide that capability.

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.