https://github.com/cdcgov/phinvads-go

A complete rewrite of CDC's vocabulary management service, PHIN VADS, in Go.

https://github.com/cdcgov/phinvads-go

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.5%) to scientific vocabulary

Keywords

golang htmx phinvads templ vads
Last synced: 5 months ago · JSON representation

Repository

A complete rewrite of CDC's vocabulary management service, PHIN VADS, in Go.

Basic Info
  • Host: GitHub
  • Owner: CDCgov
  • Language: Go
  • Default Branch: main
  • Homepage: https://phinvads.dev
  • Size: 1.58 MB
Statistics
  • Stars: 3
  • Watchers: 6
  • Forks: 2
  • Open Issues: 10
  • Releases: 0
Archived
Topics
golang htmx phinvads templ vads
Created almost 2 years ago · Last pushed 10 months ago
Metadata Files
Readme Codeowners

README.md

phinvads-go

PHIN VADS written in Go. Load phinvads.dump into a PostgreSQL database using pg_restore, run the app with air, and go!

Getting Started

Clone down the repository:

bash git clone https://github.com/CDCgov/phinvads-go.git cd phinvads-go

Create a .env file:

bash cp .env.sample .env

Installing and Configuring direnv

We use direnv to automatically set environment variables on a per-project basis. The .envrc file found in the project's directory tells direnv to read in the environment variables specified in the .env file.

Follow these steps to set up direnv on your machine:

  1. Install direnv (brew install direnv)
  2. Add a hook for your shell
  3. Restart your terminal
  4. Run direnv allow in the project directory

When navigating into the phinvads-go project directory, you should see something like this in your terminal, which lets you know that the environment variables are loaded:

bash direnv: export +DB_HOST +DB_NAME +DB_PASSWORD +DB_PORT +DB_USER +HOST +PORT

Local Development

In this section, we'll:

  1. Start PostgreSQL in a container or locally
  2. Load data into PostgreSQL
  3. Start the app

Running PostgreSQL in a Container

You may choose to manage your database using Docker. phinvads-go provides a Docker Compose file to allow for a streamlined database setup. Please download and install Rancher Desktop if you don't already have it installed.

Note: If you'd prefer to install PostgreSQL locally, please skip the rest of this section and refer to the Local Database Setup section instead.

To start your database, run this command:

make startdb

Next, please follow these steps in order to load in the data:

  1. Place phinvads.dump into the top level of your /phinvads-go project directory (Please let an engineering team member know if you need a copy of phinvads.dump)
  2. Navigate to the project directory and start your PostgreSQL database with make startdb (if the container isn't already running)
  3. Run make refreshdb to create the phinvads database and load in the data

Running the App

In order to run the app you'll need to have completed the following steps:

  1. Install Go
  2. Install air:

    bash go install github.com/air-verse/air@latest

  3. Install templ

    bash go install github.com/a-h/templ/cmd/templ@latest

  4. Install mkcert

  5. Create your own self-signed certs for local development:

    bash cd tls mkcert -install mkcert localhost cd ..

Once all dependencies have been installed, run this command:

bash make startapp

The application is now running and available in your browser at http://localhost:4000. As files are modified and saved, your application will automatically rebuild.

If you'd like to use live reloading in your browser when doing frontend work, you can make use of the templ proxy. The proxy can be accessed in your browser at http://localhost:7331. Changes to *.templ files will be automatically reflected in the browser.

You can stop running the app with ctrl + c.

Local Database Setup

If you'd prefer to not rely on Docker and instead run PostgreSQL locally, you will need to:

  1. Install and run PostgreSQL
  2. Create an empty database:

    bash psql -c 'CREATE DATABASE phinvads'

  3. Load the database dump file:

    bash pg_restore -d phinvads --no-owner --role=$(whoami) phinvads.dump

Linting

Pull requests to the main branch are required to pass linting checks. We use pre-commit to run these checks. To run them locally, install pre-commit and then install the hooks to run before every commit.

bash pip install pre-commit pre-commit install

You can also run the checks on demand using pre-commit run (staged files) or pre-commit run --all-files (entire repo).

Owner

  • Name: Centers for Disease Control and Prevention
  • Login: CDCgov
  • Kind: organization
  • Email: data@cdc.gov
  • Location: Atlanta, GA

CDC's collaborative software projects to protect America from health, safety, and security threats, both foreign and in the U.S.

GitHub Events

Total
  • Issues event: 7
  • Push event: 1
  • Fork event: 2
  • Create event: 1
Last Year
  • Issues event: 7
  • Push event: 1
  • Fork event: 2
  • Create event: 1

Issues and Pull Requests

Last synced: about 1 year ago

All Time
  • Total issues: 33
  • Total pull requests: 23
  • Average time to close issues: 11 days
  • Average time to close pull requests: 2 days
  • Total issue authors: 7
  • Total pull request authors: 7
  • Average comments per issue: 0.42
  • Average comments per pull request: 0.3
  • Merged pull requests: 21
  • Bot issues: 0
  • Bot pull requests: 1
Past Year
  • Issues: 33
  • Pull requests: 23
  • Average time to close issues: 11 days
  • Average time to close pull requests: 2 days
  • Issue authors: 7
  • Pull request authors: 7
  • Average comments per issue: 0.42
  • Average comments per pull request: 0.3
  • Merged pull requests: 21
  • Bot issues: 0
  • Bot pull requests: 1
Top Authors
Issue Authors
  • nickclyde (3)
  • KeepAustinWired (2)
  • mcmcgrath13 (1)
  • anke-stohlmann (1)
  • akasper (1)
Pull Request Authors
  • mcmcgrath13 (10)
  • nickclyde (8)
  • jakewheeler (7)
  • katyasoup (4)
  • akintner (2)
  • dependabot[bot] (2)
Top Labels
Issue Labels
Vocabulizer (3)
Pull Request Labels
Vocabulizer (17) dependencies (2)

Packages

  • Total packages: 1
  • Total downloads: unknown
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 0
proxy.golang.org: github.com/CDCgov/phinvads-go
  • Versions: 0
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 5.8%
Average: 6.0%
Dependent repos count: 6.2%
Last synced: 6 months ago

Dependencies

docker-compose.yml docker
  • redis alpine
.github/workflows/deployment.yaml actions
  • actions/checkout v4 composite
  • actions/setup-go v5 composite
  • azure/login v2 composite
go.mod go
  • github.com/jackc/pgpassfile v1.0.0
  • github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a
  • github.com/jackc/pgx/v5 v5.6.0
  • github.com/jackc/puddle/v2 v2.2.1
  • github.com/joho/godotenv v1.5.1
  • github.com/justinas/alice v1.2.0
  • golang.org/x/crypto v0.17.0
  • golang.org/x/sync v0.8.0
  • golang.org/x/text v0.14.0
go.sum go
  • github.com/davecgh/go-spew v1.1.0
  • github.com/davecgh/go-spew v1.1.1
  • github.com/jackc/pgpassfile v1.0.0
  • github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a
  • github.com/jackc/pgx/v5 v5.6.0
  • github.com/jackc/puddle/v2 v2.2.1
  • github.com/joho/godotenv v1.5.1
  • github.com/justinas/alice v1.2.0
  • github.com/pmezard/go-difflib v1.0.0
  • github.com/stretchr/objx v0.1.0
  • github.com/stretchr/testify v1.3.0
  • github.com/stretchr/testify v1.7.0
  • github.com/stretchr/testify v1.8.1
  • golang.org/x/crypto v0.17.0
  • golang.org/x/sync v0.8.0
  • golang.org/x/text v0.14.0
  • gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405
  • gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c
  • gopkg.in/yaml.v3 v3.0.1