Some helper tools to avoid using a spreadsheet
There are still a lot of hardcoded hacks in the deploy process.
- [] Fix that.
you need to install:
fishshellnpmawsandebcli tools.
run:
eb initnpm install
to deploy new code:
deploy.fish
follow the instructions on setting up the environment variables
Most of the application resides in the frontend/src directory.
/coderThe base Django applicationapi- a Django app containing backend code, comprising a model around a postgres database and some coarse validation logicfrontend- a Django app containing the frontend code. The meat of the application lives here.frontend/src- a JSX/React application the renders the UI and contains way too much application logic.
The basic model involves:
- policy - the atomistic unit to be coded. For example, an organization's privacy policy for a given jurisdiction.
- policy instance - a snapshot of the set of documents comprising a policy at a specific point in time. For example, the July 2021 version of an orgianization's policy for a given jurisdiction.
- coding - a list of multiple-choice questions to ask about a policy instance.
- coding instance - a coder's answers to the coding questions for a specific policy instance
We also include some logging tables:
- Raw Policy Instance - a snapshot of the raw HTML of a policy instance. The coded policy instances are converted into a standard format resembling markdown.
- Timing Session - a log of the time spent coding a policy instance, with question-level detail and attention tracking.
And some project management stuff:
- Assignment - an assignment for a coder. Typically a policy to code.
- Assignment Type - an artifact of a grand design not realized.
- Project - a high-level container to keep coding projects separate from each other.
api/models.py should be a relatively direct translation of these definitions to code. It uses the Django REST framework and is structured to roughly follow the Django REST framework's convention. It's not complex enough to get beyond what is covered in the introduction section of the documentation.
The frontend application is a React/Redux application.
The core concept of Redux is a careful separation of rendering and state modification logic.
components are responsible for rendering UI, given a state. The only thing a component can do is call anaction.reducers takes the current state and andactionand return a new state.actions encode user inputs and external data into a standard format which they pass to the reducer. They can be triggered by API responses, user actions, or timers. note: I break the standard Redux model and allow actions to shoot off API calls.
If you install redux toolkit in your browser, you can rewind, replay, and edit actions in the browser during testing and development.apt install libpq-dev