sudobob / wild_apricot_python_flask_utils

Web interface for maker space tool sign-offs implemented in python flask with Wild Apricot oauth and rest on the back end

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Wild Apricot Flask Utilities

Web interface for maker space tool sign-offs implemented in python flask with Wild Apricot oauth and rest on the back end.

The Nova Labs Maker Space evaluated Wild Apricot as a possible solution for member managment. While CiviCRM was ultimately chosen. Methods for implementing a fairly complex tool sign-off system was explored.

Wild Apricot is a commercial member management system for non-profits and clubs. It provides oAuth for authentication and a RESTful API. If you prefer to code your web applications using Python+Flask I hope you find this useful to look at.

Install

cd (this repo)
python3 -m venv venv
source venv/bin/activate
pip3 install -r requirements.txt

Run

python3 app.py Connect by browsing to http://localhost:8080

Walk through

On page load, flask delivers wautils.js which implements the UI. On the server, app.py implements a series of RESTful endpoints. When the user clicks on login, it call /authorize/wildapricot Which checks with wildapricot for a valid oauth session and token. If none exists, the user will be redirected to the wild apricot login/password window to be authenticated.

Once authenticated, the flask server establishes a login session and renders the utils page. It checks with wildapricot to determine if the user has wild apricot admin credentials. If so, the user is allowed to continue to the utils page. Currently, the only functionality is signoffs and a link is provided.

For all pages, the server makes a call to wildapricot to establish if the user has wilapricot admin credentials and congratulates the user if they do. The signoffs page is restricted to admins and will not render unless the user is authorized.

Once at the signoffs is loaded, wautils.js Begins to make use of the very powerful get_any_endpoint call to the server. At this point the server acts as a simple pass-through to wildpapricot. Any API endpoint implemented by wildapricot could be easily implemented in the js. The signoffs page requests a list of all contact fields available via thecontactfields endpoint. Tool sign-offs are implemented as a series of checkboxes in wildapricot. The users names and signoffs are rendered. If the user clicks on the edit button for a user, they are sent to a page where they can edit the users individual signoffs. the save button will update the user's record.

About

Web interface for maker space tool sign-offs implemented in python flask with Wild Apricot oauth and rest on the back end

License:MIT License


Languages

Language:Python 51.4%Language:JavaScript 37.2%Language:HTML 10.0%Language:CSS 1.4%