npm install
Creat a .env file under the root directory (Web-App-Repo/)
Paste the following code in the newly created .env file and change the values.
DATABASEURL="MongoDB connection string"
SECRET="Debbie is my first open source app"
PORT="3000"
EMAIL="johndoe@gmail.com"
TWOFACT="password Or 2-factor secret string"
DATABASEURL
is the connection string provided by the MongoDB or MongoDB Atlas. I think @gsw-codes has a common string for all of the projects.
SECRET
can be any string or even dummy text.
PORT
is the port number for example 3000
or 8080
.
EMAIL
, this variable is the admin or the debbie email. This email will use to send mails to users when they try to change or reset their password.
TWOFACT
, this is the secret string provided by Gmail or your mail provider. I have to use this because I use 2-factor authentication for my Google account. If the admin or debbie email has no 2-fact, then you have to add your Google password instead.
If your account has no 2FA, then go to Google and allow your app to use your Gmail service. This option won't be available for 2FA accounts
If you have a 2FA account, then go to Google and generate a secret string for your project.
In Heroku, you can add env variables on the project dashboard, then setting tab, then Reveal Config Vars button and you can add there.
This project is in currently development and all the pages linkage are still in implementation. Please follow the below routes to naviaget through pages.
'/ ' => Home page
'/register ' => Sign up page
'/login ' => Sign in page
'/update ' => Update user detail page ( only visible if user is signed in or signed up)
'/forget ' => Forget password page
'/signout ' => Will log out the user
'/pain ' => Pain input page ( only visible if user is signed in or signed up)
'/report ' => Show pain level route ( only visible if user is signed in or signed up)
User id mandatory.
If the privided userId is wrong, the server will response with an error json
{ "error": "No user found!" }
'/api/pain/:userId/daily ' => Retrieve an array of arrays for daily pain level of a specific user
'/api/pain/:userId/weekly ' => Retrieve an array of arrays for weekly pain level of a specific user
'/api/pain/:userId/monthly ' => Retrieve an array of arrays for monthly pain level of a specific user
'/api/pain/:userId/{timeframe} ' => If the provided timeframe is not valid ( or not one of the daily, weekly and monthly), the server will response with a json like below.
{
"error": "<timeframe from the url> is not a valid timeframe. You can only use daily, weekly and montly instead."
}