Skip to content
/ vvp Public
forked from Team-6-Project-2/vvp

Viktoriias Vax Passport Group Project #2 Team 6

License

Notifications You must be signed in to change notification settings

jonesjsc/vvp

 
 

Repository files navigation

Viktoriias Vax Password Group Project #2 Team 6

Project Overview

This app allows you to track your vaccine record, and share it anonymous with anyone (or any agency) that requires proof of vaccination. (Except for the part about how this is just an academic exercise)

View Demo

To view demo click on this link: (Heroku Demo Link)

Getting Started Locally

To get the Node server running locally:

  • Clone this repo (GIT)
  • Install Nodejs on your Mac (Download)
  • npm install to install all required dependencies
  • load the .sql file locally and make sure the credentials match up.
  • node server.js to start the node application.

Code Overview

Dependencies

  • express - Fast, unopinionated, minimalist web framework (for servers) for node.
  • handlebars - andlebars provides the power necessary to let you build semantic templates effectively with no frustration
  • mysql2 - MySQL client for Node.js with focus on performance. Supports prepared statements, non-utf8 encodings, binary log protocol, compression, ssl much more
  • sequelize - Sequelize is a promise-based Node.js ORM tool for Postgres, MySQL, MariaDB, SQLite and Microsoft SQL Server
  • express-session - session middleware for express
  • dotenv - Loads environment variables from .env file
  • date-fns - provides the most comprehensive, yet simple and consistent toolset for manipulating JavaScript dates in a browser & Node.js
  • bcrypt - A library to help you hash passwords
  • nodemailer - Send e-mails from Node.js

Dev Dependencies

  • nodmon - nodemon will watch the files in the directory in which nodemon was started, and if any files change, nodemon will automatically restart your node application.

Application MVC Structure

  • server.js - The entry point to our application for the customer user type.
  • /views - Applications template files using handlebars.
  • /public - All public facing assets are in this directory.
  • /models - The application models for use with ORM.
  • /db - Starter database files.
  • /controllers - Most of the application's logic for requests and responses are done in this directory as well as routes
  • /config - Database configuration.

Tasks performed / practiced in this acedemic exercise

  • purchase custom domain name
  • setup office365 email with 1 vanity username (viktoriia)
  • upgrade heroku instance to hobby instance so we can run certs against an app that's deployed to a custom domain name
  • Enabled automated certification management link

Things Learned

GMAIL has a feature called "task-specific email addresses". In short, if your email address is [email protected], with GMAIL you can also get email at [email protected]. GMAIL will accept pretty much anything after the plus, and route that to the USERNAME. This is particularly useful for testing emails and making sure that emails are being sent properly.

However

When validation is unique is enabled in MYSQL on EMAIL addresses - MYSQL (or Sequalize?) is resolving [email protected] and [email protected] and NOT UNIQUE. Which makes sense on one hand, because we know these emails will land in the same inbox. But on the otherhand, the strings are obviously very unique.

Validating DOMAIN NAME at SENDGIRD when GODADDY is DNS - instructions are incorrect and time was spent untangling that sendgrid/docs#6530

API Routes

Method Route Description
POST /api/user/login Logs user in - expects JSON object formatted:
{
"email": "EMAIL",
"password": "PASSWORD"
}
POST /api/user/logout Logs user out - expects JSON object formatted:
{
"email": "EMAIL"
}
POST /api/email Sends email out - expects JSON object formatted:
{
"emailTo": "EMAIL RECIPIENT",
"emailSubject": "EMAIL SUBJECT",
"emailBody": "EMAIL BODY"
}
POST /api/users Creates a user - expects JSON object formatted:
{
"first_name": "FIRST NAME",
"last_name": "LAST NAME",
"zipcode": "ZIPCODE",
"email": "EMAIL",
"password": "PASSWORD"
}
POST /api/vaxxs Adds a vaxx to a user - expects JSON object formatted:
{
"vaxx_name": "VAXX NAME",
"description": "DESCRIPTION",
"date_created": "DATE",
"user_id": "user_id"
}
PUT /api/vaxxs/:id Updated a vaxx given a vaxx id - expects JSON object formatted:
{
"vaxx_name": "VAXX NAME",
"description": "DESCRIPTION",
"date_created": "DATE"
}

Team Members

  • Viktoriia Midor
  • Stefan Podzinski
  • Jason Jones

About

Viktoriias Vax Passport Group Project #2 Team 6

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • CSS 41.4%
  • JavaScript 32.8%
  • Handlebars 25.8%