opensourcefellows / amplify-back-end Goto Github PK
View Code? Open in Web Editor NEWThe API backend for ProgramEquity
Home Page: https://www.programequity.com/
License: MIT License
The API backend for ProgramEquity
Home Page: https://www.programequity.com/
License: MIT License
FrontEnd
Backend
Architecture
QA
Frontend | Backend | Architecture | QA/Security | |
---|---|---|---|---|
Verify Address | based off of boolean check, display one of the screens | Format address input from FrontEnd to Lob, return boolean check | Make it easier for backend and database to connect | testing the data passed to APIs |
Takeaways from the BackEnd discussion on #6 : Moving forward with a Heroku Postgres structure
Data Structure Read more here
BackEnd functions:
Testing
Working on:
Creating a new issue to update the Amplify Endpoint.
Per our conversation in the Send Letter Issue, updating api/amplify/{zipcode}
to reflect api/representatives/{zipcode}
While onboarding to join this project, it took a several minutes (sadly 😅) to realize that the project wasn't actually missing its package.json
file, it was just unexpectedly down 1 level deeper (inside of server/
).
My take on the project setup here is that the server
directory was probably a direct copy from another location (e.g. a previous repository), so it ended up looking a bit like a monorepo setup (sub-repositories inside of a repository).
My understanding from @manishapriya94 and @BeeXiong is that this repository will continue to be a single repository dedicated to the backend server, so I feel that we should flatten the hierarchy at least for the meta files to achieve a more standard Node.js project layout and avoid confusion for onboarding additional folks in the future. 😊
User authenticates through email in order to send campaign later (limit spam). Store their information into a database on airtable to be indexed for each campaign letter
Part of User Login Outline
Implementing rules with Auth0 allows the user to maneuver amplify and browse many campaigns before having to login when they've chosen a letter to send.
When the user clicks 'send letter':
After a successful authentication, the user will be added to our database of User Volunteer where any future letters sent will be added.
To implement the logic, we reference the below to require Auth0 for specific routes
If the user is already logged in (use cookie), send the lob api call
Purpose: Users are able to donate to the cost of letter and any additional amount to the advocacy nonprofit directly. Users donating a certain amount over $30 will get a campaign sticker. Full details ProgramEquity/product#3
User Story:
@nawazkhan could you fill in subtasks for backend each sprint for this feature?
a. pre-req: database structure being finalized OpenSourceFellows/amplify#32. Heroku
b. transactions as a balance, id matches checkout items
type refers to:
c. checkout items table
d. API set up in Heroku and routed in index file
GET checkout info via unit price and campaign_id
unit price is 3$ (letter), 30$ (sticker), $45 (button)
Mirroring balancing object
Questions to explore:
check success_url string to determine if this button is highlighted
Use show and hide method for send message button
In Heroku we're seeing the following error:
At first in package.json main was not in the correct directory, it now is but even though a new build is refreshed with each install
Let @manishapriya know if you have access issues with Heroku
Heroku environment variables for each
Hi! Are you new?
Current Issues:
Find our weekly discussions here
Resources:
Some Definitions:
Hi @teakopp - Got an issue with the Auth0 environmental variables when deploying I believe.
Getting this error message from the logs ⬇️
Seems to be the same variable for when you had me create the .env file locally and added in...
ISSUER_BASE_URL=https://YOUR_DOMAIN
CLIENT_ID=YOUR_CLIENT_ID
BASE_URL=https://YOUR_APPLICATION_ROOT_URL
SECRET=LONG_RANDOM_VALUE
Would the fix be to add these as Heroku Config Environment Variables? 🤔
Issue: callback needs to have a URL that takes the user back to the campaign page they were on before hitting login, currently it takes the user to home
does it have to do with specifying the url path?
BACKGRUOND:
Creating the URL to direct users to when checking session authentication prior to sending letter. Referencing Rules Layer #19
Referencing the Auth0 basic Setup
We have the following setup in Heroku
to be referenced in further routing of the user
https://git.heroku.com/murmuring-headland-63935.git
Part of verify address
Integrating Lob to create mail sending capability for Amplify
https://user-images.githubusercontent.com/9143339/105809192-3cc19a80-5f77-11eb-8bb0-e8c0e8c4e059.mov
Describe the solution you'd like
1. MVP: Pilot letter parties with SoapBox, AAAJ, and the Breathe Act (starting mid April 2021)
2. MVP+ Campaign Sponsors launched, scale 10 organizations. (August 2021)
3. Alpha: Public facing site launched, scale 25 organizations. (November 2021)
Should we revise the volunteers
database schema to break down name
and physical_address
columns into more granular bits? I followed what I saw in the Notion Product Log but now I've noticed that in the current production database (pre-migration), those fields were actually broken down into:
name
➡️ first_name
, last_name
physical_address
➡️ street_address
(line 1), address_2
(line 2), city
, state
, zip
I haven't verified but I'm guessing that better aligns with what the Lob API will be expecting us to provide vs. just a large text field like I used? 😅
Part 1 of Amplify Refresh Ally-Guide/ally-guide-app#98
The user will be prompted to the sms passwordless if they attempt to send the letter and aren't authenticated. This ensures they can not send a letter unless authenticated
We're dealing with post request instead of get due to the 'send letter button' which is speaking to the Lob API if user is authenticated.
Using the following route customization:
1. Sending a password protected custom URL (so only users can know based off of nonprofit user list)
Security Reasons:
To maintain the growth of this platform's performance and the integrity of its users, we'll grow through nonprofit based referrals for users (that way they are only responsible for the costs of their user list).
2. The user would then enter from the standpoint of the campaign:
3. Organization has a login to dashboard for their custom url and metrics
4. Do we want to create member user login now or just cache emails?
BackEnd creates letters_sent table which has the following pieces of information in database
FrontEnd sends information on representative and campaign_id
BackEnd posts the following
Do we happen to have any sort of subsidy from GitHub that would allow us to use GitHub Actions for continuous integration/deployment (to run our tests on each pull request, for example) without incurring any/much cost?
I'm guilty of being unfamiliar with the GitHub Actions pricing model and just using it a lot internally. 😓
I have a ton of experience with GitHub Actions, so if this is a cost-free or cost-effective option for us, I would love to help setup CI and/or CD (if we can -- and want to -- deploy our changes programmatically, that is) for the project.
User flow after #10 : Organizations have their own login
Data Structure
BackEnd functions:
DATABASE_URL = API Variable
Wanted to highlligh that part of the issue for getting set up seems to be PGAdmin
The fix seems to be if we use the Postgres App to install and might be good to add as an additional step in the guide?
Currently, the package.json
lists the project's license as MIT
, which is a free and open source license that allows anyone to use, reuse, change, sell (🤔), etc. the contents.
I know the project is currently private, so it's not an urgent issue to attend to, but I'm curious....
package.json
file) suggested for proprietary/closed source software is [confusing, IMHO] UNLICENSED
."private": true
flag into the package.json
to prevent accidental publishing to npm for those of us with local-and-active npm credentials. 😅
Priority 4 from Ally-Guide/ally-guide-app#98
Takeaways from the BackEnd discussion on #6
What happens to the current airtable?
Storing orgs
Since we are now storing physical/mailing addresses in multiple database tables, we should probably just make a new database table to hold addresses and reference them from the relevant tables (and load them with records via JOIN
operations or an ORM).
This would also allow us to validate the addresses more directly for greater data integrity, e.g. require values for at least one line, a city, a state, and a zip code at the database level.
Not an urgent requirement but something that would probably be wise in the long term.
into user_table
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.