This demo app was adapted from an email sending app built within a full-stack course. It's built with a MERN stack: MongoDB, Express, React and Node.
The app allows paid users to send group emails to a user base and obtain feedback on a question that they pose to users. It features a number of API integrations: Google OAuth allows users to securely sign in without having to enter a password, Stripe enables users to pay to add credit to their account so they can send out surveys, SendGrid facilitates email sending and enables click-tracking, and Mongo Cloud Atlas securely stores user and survey data in the cloud.
Users sign in, add credit and then create a survey to be sent out to an email list. When recipients click a link in the email, they are redirected to a page on the VoteNow website. Clicks are tracked via the user email and ID, users can only vote once per survey to prevent duplicate tracking and 'cheating'. Survey creators can also view the number of clicks on each survey.
This app site is hosted on Heroku.
This app makes use of a number of key APIs:
SendGrid is used to send emails. All group emails/surveys are sent from single admin email address via SendGrid.
Single sign on protocol. Integrated via Passport JS.
Enables user to add credits. Note - we only use Stripe Test mode.
All user and survey data is stored in MongoDB, via Cloud Atlas.
Used to build the app front-end.
Manages app state, Redux actions enable sending of data to and from Mongo via Redux actions.
MongooseJS is an Object Data Modeling (ODM) library, essentially a layer over the Node server that allows it to communicate with Mongo to store and access information.
-
Axios: Lets us make asynchronous requests (ie. requests that take a finite amount of time)
-
Redux Form: Enables and greatly simplifies the process of creating forms using Redux
-
React-Router-DOM: Map paths to routes, this lets us specify what components will be loaded at specific urls. Create page Links that bypass refresh enabling the maintenance of data stored within client memory
-
Redux-Thunk: Enables processing of async requests within Redux
-
Client (React, front-end code) folder: all code and componentry related to the React-Redux side of the application. This code has been uploaded to GitHub
-
Server: contains Express files, routing etc.
-
actions: contains all action creators
-
components: React components
-
reducers: Redux reducers
- Procfile: Config file for Heroku to initiate the app
In the server dir: npm run dev Disable const requireHttps and app.use(requireHttps) in root index file on dev