Skip to content

Commit

Permalink
Clean up docs (#689)
Browse files Browse the repository at this point in the history
* add badges to read me and update names of our test workflows

* remove terminology page

remove duplicative docs on e-Manifest

* move contributing guide to directory recognized by GitHub and remove duplication

* Streamline our source roadmap, specifications, and update our deployment workflow

    update deploy documentation workflow dependencies and add comments explaining repo setting requirements

    update source roadmap to help newcomers navigate the project monorepo, fix bug in runhaz.sh

    rename deployment chapter to operations

    streamline design documentation

    add figma iframe

    remove reference chapter from documentation

* add lint_client workflow

a simple workflow that lints the client codebase to check for common errors
  • Loading branch information
dpgraham4401 authored Feb 26, 2024
1 parent 4a1f358 commit cd151ae
Show file tree
Hide file tree
Showing 37 changed files with 368 additions and 711 deletions.
66 changes: 63 additions & 3 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,65 @@
# Contributing
# Contributing to Haztrak

See our contributing guide at https://usepa.github.io/haztrak/development/contributing.html
You are formally invited to contribute to the Haztrak Project!

Markdown file version of our documentation can be found [here](/docs/guide/src)
You don't need experience programming to donate your time,
we accept contribution of all types, code, written word, bug reports, feature suggestions,
graphics.

Thank you for your interest in contributing to haztrak, this short guide will
tell you everything you need to know before your first pull request.

- [I found a bug](#report-an-issue)
- [I have a feature request](#suggest-an-enhancement)
- [I'd like to work on an issue](#work-on-an-issue)

# How to Contribute

We welcome all contributions! You don't need to know how to program to contribute, here are some of the ways you can get involved:

### Start a discussion or ask a question

If you have a question about Haztrak, or want to start a discussion, please open an [ticket](https://github.com/USEPA/haztrak/issues).on our GitHub repository. We welcome all questions and feedback!

### Report a bug

You can help us improve Haztrak by reporting any bugs
or issues you encounter. You can also do this by opening an [issue at our GitHub repository](https://github.com/USEPA/haztrak/issues).

### Suggest an Enhancement

If you have an idea for how we could improve Haztrak, please
share it with us by opening an issue! (if you haven't noticed, we track everything through tickets on our issues page). Please be as detailed as possible in your suggestion.

If you have an idea It's best to open an issue, before starting work or
submitting a PR. we also welcome draft PRs.

### Work on an Issue

If you're looking to contribute code or documentation, here's the general process...

- Ask to be assigned an [Issues](https://github.com/USEPA/haztrak/issues).
- Fork this repo to your GitHub account (click 'Fork').
- Clone your fork to your local workstation or a remote development environment.
- Set up a local development environment
- See our documentation on setting up a [local development environment](./local-development.md)
- Create a git feature branch branch,
- Write a test that fails (commit)
- [See our documentation on Testing Haztrak](../design/testing.md)
- Write the code to make that test pass (commit some more)
- Run the test suite and ensure all tests pass (celebrate)
- refactor your code (commit often)
- clean up your commit history (squash commits)
- push your branch to your fork and open a PR from the feature branch
- please leave "Allow edits from maintainers" checked.

## Pull Request Guidelines

Before you submit a pull request, please make sure that your changes align with
our project goals and vision (create an issue if you're not sure). Here are some guidelines to follow when submitting a pull request:

- Keep your pull requests small and focused.
- Make sure your code is well-documented and tested.
- Explain the reasoning behind your changes in the pull request description.
- Make sure your code follows Haztrak's coding style and conventions.
- Be open to feedback and willing to make changes to your code based on reviewer feedback.
36 changes: 23 additions & 13 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
name: 'Deploy Documentation'
# when changes are made to the documentation, build and deploy it to GitHub Pages
name: 'Build and Deploy Project Documentation'

# This Workflow builds a static site using mdBook and deploys it to GitHub Pages.

# The GitHub repo settings must be configured for pages deployed from this workflow to persist after
# another push to the repository. Go to Repository Settings > Pages -> Build and Deployment,
# set the source to the `GitHub Actions` branch.
# For more information on mdbook, see https://rust-lang.github.io/mdBook/

on:
push:
Expand All @@ -17,32 +23,36 @@ concurrency:
group: 'pages'
cancel-in-progress: true

env:
BOOK_DIRECTORY: ./docs/guide
MDBOOK_VERSION: v0.4.37

jobs:
build:
name: 'Build Documentation'
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./docs/guide
working-directory: ${{ env.BOOK_DIRECTORY }}
steps:
- name: 'Checkout Repo'
uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v4

- name: 'Setup mdBook'
- name: Setup mdBook
run: |
mkdir bin
curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.25/mdbook-v0.4.25-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=bin
curl -sSL https://github.com/rust-lang/mdBook/releases/download/${{env.MDBOOK_VERSION}}/mdbook-${{env.MDBOOK_VERSION}}-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=bin
- name: 'Build Documentation'
- name: Build Documentation
run: bin/mdbook build

- name: 'Upload Docs'
uses: actions/upload-pages-artifact@v1
- name: Upload Docs
uses: actions/upload-pages-artifact@v3
with:
path: ./docs/guide/book
path: '${{ env.BOOK_DIRECTORY }}/book'

deploy_pages:
name: 'Deploy Documentation'
name: Deploy Documentation
needs: build
environment:
name: github-pages
Expand All @@ -51,4 +61,4 @@ jobs:
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
uses: actions/deploy-pages@v4
32 changes: 32 additions & 0 deletions .github/workflows/lint_client.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: 'Lint Client'

on:
push:
pull_request:

jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./client

strategy:
matrix:
node-version: [20]

steps:
- uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: '**/package-lock.json'

- name: Install dependencies
run: npm ci

- name: Lint
run: npm run lint
2 changes: 1 addition & 1 deletion .github/workflows/test_client.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'Haztrak Client Tests'
name: 'React Client Tests'
# This workflow is responsible for running the Haztrak react client tests.

on:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_server.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'Haztrak Server Tests'
name: 'Trak Service Tests'
# This workflow is responsible for running the Haztrak server tests.
# It spins up a postgres container and runs the tests against it.

Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
[![Client Tests](https://github.com/USEPA/haztrak/actions/workflows/test_client.yaml/badge.svg)](https://github.com/USEPA/haztrak/actions/workflows/test_client.yaml)
[![GitHub release (latest by date)](https://img.shields.io/github/v/release/USEPA/haztrak?label=latest%20release)](https://github.com/my-user/my-repo/releases/tag/v1.0.0)

[![Backend Framework](https://img.shields.io/badge/Django-RESTful_API-0C4B33?logo=django)](https://www.djangoproject.com/)
[![Frontend Framework](https://img.shields.io/badge/React-SPA-374151?logo=react)](https://reactjs.org/)
[![Database](https://img.shields.io/badge/PostgreSQL-Database-336791?logo=postgresql)](https://www.postgresql.org/)
[![Async Tasks](https://img.shields.io/badge/Celery-Async_Tasks-A9CC54?logo=celery)](https://www.postgresql.org/)

---

# Haztrak :recycle:
Expand Down
25 changes: 10 additions & 15 deletions docs/guide/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,19 @@

- [Haztrak Introduction](introduction.md)
- [About e-Manifest](e-Manifest.md)
- [e-Manifest Terminology](terminology.md)
- [Project Design](design/index.md)
- [Project Design](design/source-roadmap.md)
- [Repo Roadmap](design/source-roadmap.md)
- [Source Design Document](design/sdd.md)
- [Http Server Design](design/http-server.md)
- [Http Server Design](design/server.md)
- [Client Design](design/browser-client.md)
- [Database Design](design/db-design.md)
- [Async Task Design](design/task-queue.md)
- [Source Navigation](design/source-roadmap.md)
- [Testing](design/testing.md)
- [Development](development/index.md)
- [Contributing Guide](development/contributing.md)
- [Development](development/local-development.md)
- [Local Development](development/local-development.md)
- [Continuous Integration (CI)](development/ci.md)
- [Continuous Delivery (CD)](development/cd.md)
- [Deployment](deployment/index.md)
- [Configuration](deployment/configuration.md)
- [Containerization](deployment/containerization.md)
- [Deploying](deployment/deployment.md)
- [References](references/index.md)
- [Demos](references/demos.md)
- [Notes for Future Maintainers](references/future-maintainers.md)
- [Continuous Integration (CI)](development/ci-cd.md)
- [Continuous Delivery (CD)](development/ci-cd.md)
- [Operations](operations/configuration.md)
- [Configuration](operations/configuration.md)
- [Containerization](operations/containerization.md)
- [Deploying](operations/deployment.md)
Binary file removed docs/guide/src/assets/erd.png
Binary file not shown.
Binary file modified docs/guide/src/assets/images/erd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/guide/src/assets/images/haztrak_backend.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 0 additions & 6 deletions docs/guide/src/deployment/index.md

This file was deleted.

28 changes: 3 additions & 25 deletions docs/guide/src/design/db-design.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,12 @@ the means to, for example, draft or update electronic manifests without submitti
the changes to RCRAInfo immediately.

The database schema is maintained in version control via a series of 'migration'
scripts. This enables us to initiate a new database and scaffold the expected
scripts. This also enables haztrak to initiate a new database and scaffold the expected
schema quickly and consistently for local development, testing, and backup.

The Haztrak project currently utilizes [PostgreSQL](https://www.postgresql.org/),
a widely used open-source object-relational database system known for reliability and performance.

## Django ORM

Haztrak uses the Django Framework's ORM (Object-Relational Mapping), a powerful tool
that allows Haztrak to define the schema for, and interact with, the databases using Python
objects instead of writing raw SQL queries.
See the [Django model layer documentation](https://docs.djangoproject.com/en/4.1/topics/db/models/) for a more comprehensive introduction.

## DB Migrations

In addition to defining the database schema through Django's ORM, Django also comes with built-in
support for managing database changes through [migration scripts](https://cloud.google.com/architecture/database-migration-concepts-principles-part-1). These migrations are checked into
source control, which can then be applied to a standing database or used to spin up a new database
as the current database schema is simply the sum of its changes.
See the [Django Migrations documentation](https://docs.djangoproject.com/en/4.1/topics/migrations/)
for more information.

## Notes on generating the ERD

We use the `pygraphviz` python library and the `django-extensions` reusable Django app to generate the above entity relationship diagram (ERD).
Expand All @@ -41,24 +25,18 @@ We use the `pygraphviz` python library and the `django-extensions` reusable Djan

This library doesn't come with pre-compiled [wheels](https://realpython.com/python-wheels/), so you'll need to install the C header files.

#### Fedora/RHEL

On Fedora (37) the following packages can be installed to meet this requirement.
Fedora/RHEL

```shell
dnf install python3-devel graphviz-devel
```

#### Ubuntu/Debian

The following packages should accomplish the same task, however this is untested.
Ubuntu/Debian

```shell
apt-get install libpython3-dev libgraphviz-dev
```

### Python Dependencies

after installing the necessary header files, install the `pygraphviz` package from PyPI.

```shell
Expand Down
25 changes: 0 additions & 25 deletions docs/guide/src/design/http-server.md

This file was deleted.

16 changes: 0 additions & 16 deletions docs/guide/src/design/index.md

This file was deleted.

Loading

0 comments on commit cd151ae

Please sign in to comment.