Giter Club home page Giter Club logo

codeforboston / anypia-js Goto Github PK

View Code? Open in Web Editor NEW
5.0 5.0 6.0 1.05 MB

Javascript wrapper version and API for Official Social Security Benefit Calculator, AnyPIA, used by Windfall Elimination Awareness app (prev: ssacalculator dot org

Home Page: https://windfall-develop.netlify.app/

License: Other

C++ 92.61% C 6.46% CMake 0.44% Shell 0.33% Batchfile 0.13% JavaScript 0.02% HTML 0.01%
code-for-america code-for-boston public-benefits retirees social-security

anypia-js's People

Contributors

alexmerritt avatar mrpippy avatar thadk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

anypia-js's Issues

Add a license.md

Hi @mrpippy, Thanks again for all the help getting this project rolling. Do you have any objection to re-licensing this CC0 along the lines of these GSA 18F guidelines so this could be adopted more broadly inside/outside gov if desired? I don't know much about the patent issues but happy to consider broader licenses too.

I think we and @AlexMerritt are the only contributors so far but there were some more interested folks tonight at hacknight. The code is running great in a React environment over at https://github.com/codeforboston/windfall-elimination/ .

Update and test build, esp in NodeJS

Short version:
I used the below line to replace https://github.com/codeforboston/anypia-js/blob/master/anypiajs/CMakeLists.txt#L67 along with ./installbuild-emscripten-mac.sh to compile AnyPIAJS.mjs for the Windfall Awareness project using the July 2020 (>= 1.39.17) version of Emscripten (I used a new emscripten promise feature in the line below).

set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "-s USE_BOOST_HEADERS=1" LINK_FLAGS "-s USE_BOOST_HEADERS=1 -s EXPORT_ES6=1 -s USE_ES6_IMPORT_META=1 -s ENVIRONMENT=web -MODULARIZE=1 -s WASM=1 --bind ${EXPORTED_FUNCTIONS} ${EXPORTED_RUNTIME_METHODS}")

But this change is not committed to this repository yet. Also ENVIRONMENT=web does not work with NodeJS so cannot be used in automated testing such as what we might want to do with TravisCI in this repo.

More details at codeforboston/windfall-elimination#209

New 2021.1 version of SSA's AnyPIA + TravisCI free tier sunset

The Windows AnyPIA detailed calculator got updated yesterday with the new COVID economic projections. Good timing to dig back into the AnyPIA-JS and perhaps even automate parts of the refreshed build.

The current version of the Detailed Calculator is 2021.1, which we released on November 20, 2020. It updates the economic data with the new automatic adjustments announced on October 13, 2020.

https://www.ssa.gov/oact/anypia/anypia.html

Also I noticed that TravisCI may not be free starting next year unfortunately: a big setback. I might look into getting Code for Boston to pay for it rather than rewriting the very particular Windows tests builds in Github Actions. It could be a slog to replicate the emscripten's python+nodejs+visualstudio environment. Maybe choco will make it easier than I think though.

In happier news, I had a great call just now with the SSA-focused staffer at Congresswoman Lori Trahan's office showing him through the app for the first time and about connecting with the Northeast region Social Security administration rep about re-using these pieces.

*.PIA structure

anypiab is a command line program like the anypia32 GUI program.

Loading a *.pia file outputs something like
"123-45-0020 06/22/1952 1235.80 2090.10 931.00 62 and 1 month 5 T" but it also appears that it outputs to a file (thanks @AlexMerritt)

One issue we will face is getting the earnings, and other data, into anypia-js

The current interface is using this .pia file format.
http://thadk.net/anypiamac-docs/html/General/structure.html

The alternative is to support the XML format somehow with the oactobjs libraries directly and plug the javascript straight into its state format and skip the .pia format.

Flesh out the c++ project interface

A simple interface project was added to the repo (anypiajs). This will replace needing to build anypiab or anypia32 and allow us the flexibility to define what we want out of the ssa calculator without editing any of their source code.

Attempt to build emscripten on linux , repaired installation of boost 1.64

git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
./emsdk install latest
./emsdk activate latest
source ./emsdk_env.sh
cd ..
#curl -L -O "https://dl.bintray.com/boostorg/release/1.64.0/source/boost_1_64_0.zip"
#unzip -q boost_1_64_0.zip
cd boost_1_64_0
./bootstrap.sh
./b2 toolset=emscripten link=static runtime-link=static --with-date_time
export BOOST_INCL=`pwd`
export BOOST_LIB=`pwd`/stage/lib

cd ..
mkdir -p anypiab/build
cd anypiab/build
emcmake cmake -DBOOST_INCLUDEDIR=$BOOST_INCL -DBOOST_LIBRARYDIR=$BOOST_LIB ..
make
cd ../..
mkdir -p anypiajs/build
cd anypiajs/build
emcmake cmake -DBOOST_INCLUDEDIR=$BOOST_INCL -DBOOST_LIBRARYDIR=$BOOST_LIB ..
make


JS interface into anypiajs

Create an interface into the c++ anypiajs interface.

  • These functions from this interface will mirror anything that we expose from anypiajs.
  • Create a html template so that when we build the emscription we use our own html page rather than what is auto generated.
  • The interface should look something like https://github.com/azavea/loam/blob/develop/src/worker.js
  • The interface should be easily called to make the front end as easy as possible
  • We also need to determine how we want to be passing data into and out of the interface.

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.