This App lets buisnesses create surveys for their endusers to take and gather results to be used for analysis and further feature developement of their website. It has features of accepting payments and sending surveys via emails to end users. The result of surveys are collected and can be used to provide important information to users.
- Google OAuth 2.0 to handle user login
- Stripe Api to handle payments
- SendGrid API to send emails
- AWS Code Pipeline to automate code deployment
- Back End : Passport JS, AWS SDK, sendgrid, stripe
- Front End: React JS, Redux, React-Redux, React-Router, Axios, Stripe API, ReduxForm ,
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
node v8 or greater
concurrent - latestest version
create-react-app - latest version
pm2 - latest version
Install the following in your AWS EC2 Linux AMI Instance:
First, install node js
:
Install from node official website
Next, install concurrent
:
npm install -g concurrently
Next, install create-react-app
:
npm install -g create-react-app
Last, install pm2
:
npm install -g pm2
Details on what enviornment variables to set are mentioned in the enviornment-variables.md file.
-
Create a AWS EC2 Linux AMI Instance and assign following policies to its IAM roles :
AmazonEC2RoleforAWSCodeDeploy
&AmazonDynamoDBFullAccess
. -
Create 2 Dynamo DB tables:
- User Table - googleId is partition key & id is secondary key named id-index.
- Survey Table - id is partition key. and _user , id is the secondary key named _user-id-index
- Set Both Tables names in the enviornment variables.
-
Assign an Elastic IP to your ec2 instance.
-
Create your credentials for Google OAuth 2.0 Api
- Assign
Javascript Authorized Origins
as your ec2 instances public ip:http://ec2-instance-public-ip
- Assign
Authorized Redirect URL's
ashttp://ec2-instance-public-ip/auth/google/callback
- Copy Client ID and Client secret from the credentials you created and set it into enviornment variables.
- Assign
-
Create your Stripe Free Account. Copy the Stripe Publishable Key and Stripe Secret Key and set it into enviornment variables.
-
Create sendgrid Free Account. Copy the SendGrid API Key and set it into enviornment variables..
-
Set NODE_ENV enviornemnt variable to
production
, set redirectDomain toec2-instance-public-ip/surveys/feedback
and set PORT to5000
and Generate a goodcookieKey
as enviornment variable. -
set your STRIPE Publishable Key in
client/.env.production
file. -
Run the following lines on your ec2 instance to run the app.
sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 5000
cd /home/ec2-user/QuikFeedback
pm2 start npm -- start
To forward all requests from port 80 to port 5000 internally and to start the server on startup
- Install CodeDeploy Agent in your Ec2 Instance. Create a new AWS Code Pipeline, Link it to this project on github and Code Build should use the
buildspec.yml
provided in the root of the project. Code Deploy should use theappspec.yml
in the root of the project. (It will auto deploy the project to your ec2 instance and start it, using the scripts in scripts directory).
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.
We use SemVer for versioning. For the versions available, see the tags on this repository.
- Jaymit Desai
This project is licensed under the MIT License - see the LICENSE.md file for details