This directory explains each API endpoint in the front end React app and the purposes they serve. Each function name is linked to the /Controller
file that it executes.
Each category is a link to its Routes
or relevant folder.
refreshToken
checks for user JWT to preserve their session and also protect endpoints from being accessed by non-users in conjunction with the/Auth
files
updateUser
updates user documentchangePassword
changes user password (in-app, during a secure session)resetPassword
changes user password (outside of a secure session, user is verified via unique URL)confirmResetPasswordHash
confirms a unique link provided to user if they ask to reset their passwordconfirmActivationHash
confirms a unique link provided to user if they create a new accountdeleteUser
deletes user account and stored documentlogin
logs user into the appcheckPrivilege
checks if user has viewed the Eligibility requirements and clicked "Agree". (Users cannot make Celebrations without this)givePrivilege
updates a user's document to TRUE for the abovecheckDonor
checks is user has submitted all the required information to comply with the FEC in order to increase their maximum donation amountpromoteDonor
updates a user document to TRUE for the abovegetUser
retrieves a user document from the databasegetUserData
returns any user data that is exposed by the clientforgotPassword
starts process to allow user to reset their password (if they cannot login)createUser
creates a newUser
account document,logout
logs out user
saveCelebration
sends payment to Stripe and creates a new Celebration document in the databasegetCelebrationsByUserId
returns all Celebration documents from a single userresolveDonation
converts a Celebration into a donation by updating the documentsendReceipt
emails Celebration receipt to usergetWhatPolsHaveInEscrow
sums all donation amounts for each politician from across the userbase
getPolsByIds
returns a group of Politicians based on the ID(s) providedgetPol
returns a single Politician's documentgetBill
returns a single Bill's document
sendPayment
sends payment toStripe
,setupIntent
creates a "payment intent" objectsetPaymentMethod
creates a "payment method" i.e. user's credit cardgetNewDonor
registers a new customer with Stripe
getPolsByLocation
returns local Representative information (allows user to search by address/ZIP code)
notifyImgErr
sends an internal system email if a Politician's profile picture is broken/missinggetConstants
retrieves private constant values stored on the server
trawl.js
and endpoints.js
control how the ProPublica Congress API is used.