RegHack

Automated registration for your events!

Have you ever been confused on how to check in? Are you using a combination of google forms and a spreadsheet and doing it manually? There IS a better way! This node web app is built to help you register AUTOMATICALLY!

Getting Started

Installing Nodejs

Mac

brew update 
brew install node

Windows

cinst nodejs.install

Linux

sudo apt-get install nodejs 
sudo apt-get install npm

Downloading and Configuration

Clone using Github

git clone https://github.com/Hacker719/RegHack

Coniguring the config.js

This is important because the entire program will make and store data based on this. So to do this you need to go to the config.js file. Then you will face the defualt options. You need to include all parts of data you want to record (ex. School, Age, Height etc.) You need to input those, and an example input (to determine between string and integer). There are some special configurations:

  1. First is checked. This will allow you to, see if they are checked in or out and use the QR reader function. To activate set it to false.
  2. Second is email. This will allow you to, mass email the people an html email. To activate set it to a string

An example config.js is:

module.exports = {
    "Name":"John Doe",
    "School":"Berkely College",
    "Grade":12,
    "age":42,
    "email":"joe@gmail.com",
    "checked":false
}

Coniguring the .env file

To configure the .env file you can check a model one at model.env. The basic parts include:

  • MONGO_URL=Your actual mongoDB url with a collection
  • EMAIL_USER=Your gmail email.(you need to configure with other smtp servers inside index.js
  • EMAIL_PASS=Your email password
  • API_KEY=This is any string of numbers and letters that are a basic password for your registration system.

An example is:

MONGO_URL=mongodb+srv://username:password@reghacktest-oeoxh.gcp.mongodb.net/registrationsystem
EMAIL_USER=reghack@gmail.com
EMAIL_PASS=password01
API_KEY=rEgHaks2201

Starting

To start up the app locally, go to the folder, and type:

npm install
node index.js

Then the app should be running on localhost:3000

GET Requests (GUI)

/form

This will give a GUI where you can use the POST /addperson function in a form.


/email

This will give a GUI where you can use the POST /sendmail function in a website.


/people/:apikey

This will give a GUI where you can view all the people and what they are in a table. This also allows the user to use the /clear POST in a GUI.


/reader

This will give a GUI where you can use the POST /checkin function in a website. It scans the QR code to check people in. This QR code can be generated from _id or from the mass email (()b64code()).

POST Requests

/addperson

This is to add a person to the database. You need to include your API key and the parts in your config. You do not include checked. An example for a config above is

{
    "Name":"John Doe",
    "age":42,
    "School":"Stanford",
    "Grade": 13,
    "email":"crackerjack@yopmail.com",
    "key":"your chosen API key"
}

/checkin

This is to change a person's checked value. This lets you know if they are checked "in" or "out". An example one would be:

{
    "id":"John's _id in MongoDB",
    "where":"in",
    "key":"your chosen API key"
}

/sendmail

This is to send a mail to the group. ()b64code() will be replaced with a base 64 url of a QR code that you can scan with the /reader GUI. You can also use ()anyconfigvalue() for that to be displayed. AN example includes:

{
        "subject":"Hello I am a  subject",
        "html":"<p> Hello ()Name() I know your email-()email and school-()School() </p> <img src='()b64code()'>",
        "key":"your chosen API key"
}

/clear

This checked for the key, then clears the entire MongoDB collection, deleteing all data. THIS IS PERMANENT AND DANGEROUS. And example is:

{
        "key":"your chosen API key"
}

Contributers