Some useful links to help you find what you need.
As a end user of a NodeJs
Occasion and gift tracker application
I want to use the application on the web and mobile devices like this one π
So That I don't have to use sticky notes, third party calendar apps, and paper notes to keep up with birthdays, wedding anniversaries, and other important dates and the gifts supplied for these events.
Disclaimer The steps and procedures in this project were performed using Visual Studio Code
, NodeJS
, Express
web framework, and MongoDB
. For data dependencies, libraries, and code editing choose any environment you are most comfortable and familiar with.
Nodejs
from here on your local developer environment. Express
from here. The steps and procedures are the same for this project.Install MongoDB
In a VSCode
terminal type the command npm install MongoDB -- save
. This installs the MongoDB so you can use it in your project. To verify MongoDB installed correctly type the command npm mongodb --version
. Below is a screen shot of correctly installed MongoDB.
VSCode
and start a new project. Detailed steps cand be found here
Refer to the section titled "Create Project in Visual Code".MongoDB Atlas
cloud account to store and save persistent data. Use this tutorial to create the account. Mongo Atlas
cluster.
const update = document.querySelector('#update-button')
const deleteButton = document.querySelector('#delete-button')
const messageDiv = document.querySelector('#message')
update.addEventListener('click', _ => {
fetch('/quotes', {
method: 'put',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
name: 'Sally',
quote: 'Birthday, CakePoper, 2012.'
})
})
VSCode
terminal type the command node server.js
, or whatever you named your server file. Node
is the application that starts your server and allow it to communicate with a web browser. Below is a screen shot of NodeJS
running and connected to a database.localhost:3000
. Localhost is the application and 3000 is the port number assigned to the application. Use this opportunity to thoroughly test the application. Fixing bugs and errors is easier locally than when the application is fully deployed.Once the local testing confirms all bugs, logical errors, and syntax problems are fixed deploy to hosting service so the application can be access from an internet connection.
Create, or login to a Heroku account.
Click "New"
>> Create new app
. Input app name. Heroku will provide a notification if the app name does not meet their requirements. Choose US region
>> create app icon.
Connect the app to your GitHub repo. Input the repo name to connect.
Ensure Enable Automatic Deploys
and Deploy Branch
are clicked to automate the updates from GitHub.