-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
56 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,43 @@ | ||
# MowManApp | ||
push notification app for lawn care companys | ||
push notification app for lawn care companys. | ||
uses google oauth to login and mongoDB to connect | ||
check out the site here http://ec2-3-144-135-34.us-east-2.compute.amazonaws.com/userHub | ||
WARNING: website uses http and is not encrypted. Any private information entered could be exposed. | ||
|
||
HOW TO USE: | ||
1. use git clone "https://github.com/PricetonB/MowManApp.git" to clone the code to your directory | ||
2. create .env file with the following parameters | ||
|
||
GOOGLE_CLIENT_ID="" | ||
GOOGLE_CLIENT_SECRET="" | ||
can be obtained from google cloud console in "apis" under "credentials" after creating account and setting u keys | ||
|
||
|
||
|
||
SMTP_HOST="smtp.gmail.com" | ||
SMTP_PORT="587" | ||
these are default credentials for gmail | ||
|
||
SMTP_USER="" | ||
SMTP_PASS="" | ||
you need to create a gmail account for your app. | ||
Enable two factor authentication and create "App Password" in settings. | ||
user will be your app email address and pass will be your App Password (Gmail account password will not work) | ||
|
||
|
||
EXPRESS_SESSION_SECRET="ght42d8c5970f662658f705fd5jv8tk30d589b7ed0ea9740e56dgkty78290f28" | ||
EXPRESS_LISTENING_PORT=3000 | ||
create a random string for express session secret and specify port you want to use | ||
|
||
MONGO_URL="mongodb+srv://username.randomletters" | ||
create a database on mongoDB Atlas website and get url for the database. | ||
You may also need to add your ip address to mongoDB Atlas whitelist. | ||
|
||
|
||
3. in the "auth.js" file set the baseUrl if your not using local host:3000. | ||
|
||
4. in the "public" directory set the baseUrl at the top of every .js file if your not using localhost:3000 | ||
|
||
5. type npm install in MowManApp directory. | ||
|
||
6. type npm start in the MowManApp directory. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
const express = require("express"); | ||
const mongoose = require("mongoose"); | ||
const app = express(); | ||
require('dotenv').config(); | ||
|
||
|
||
MONGO_URL = process.env.MONGO_URL; | ||
|
||
|
||
// Connect to MongoDB | ||
mongoose.connect( | ||
"mongodb+srv://pricetonbraswell:[email protected]/Node-API?retryWrites=true&w=majority&appName=MowManDB", | ||
MONGO_URL, | ||
{ useNewUrlParser: true, useUnifiedTopology: true } | ||
).then(() => { | ||
console.log("Connected to MongoDB MowManDB!"); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters