Code Monkey home page Code Monkey logo

website's Introduction

Note: This repo was previously forked from wtg/ambulance, but was removed from the fork network by GitHub Support. The former repository is no longer developed, leaving this repo as the most up-to-date version.

Build Status

Installation and Running the Site

This website is built in the MEAN stack (MongoDB, Express.js, Angular.js, and Node.js), and can be deployed using the following steps:

  1. Clone this git repository by running the following command in a Git-enabled terminal:

    • > git clone https://github.com/rpiambulance/website.git ambulance
  2. Navigate into the directory of the application:

    • > cd ambulance
  3. If NodeJS and Bower are both installed on your computer, skip this step.

    • Install NodeJS here.
    • Install Bower through Node Package Manager (npm) by running: npm install -g bower.
  4. Install all necessary dependencies by running the following commands:

    • > bower install
  5. Install mysql and then:

    • Run the sql located in the file .docker/mysql/schema.sql to create database (ambulanc_web) and necessary tables in the DB
    • [ADD INSTRUCTIONS FOR ADDING MEMBER, DEFAULT CREWS]
  6. Install PHP and a webserver (Apache, Nginx) to run it

Development

The site uses Docker to spin up three containers to ease in development which consists of:

  • MySQL container
  • PHP + Apache container
  • phpMyAdmin container

To use this, you will need to install docker and docker-compose. For Windows and MacOS, it's recommended to install the Docker Desktop which contains everything that you need. For a Linux distro, find your OS and follow the install directions for it on this page. You may need to additionally follow the instructions this page to install docker-compose.

Next, you will need to copy a handful of files into place:

cp .env.sample .env
cp .docker/.admin_config.php .
cp .docker/.db_config.php .
cp .docker/.form_config.php .

Once that is done, you just need to run the following command anytime you want to work on the site:

docker-compose up

This starts all three containers, links them together, and makes them accessible on your localhost. The containers have the following access points on the host machine:

This will setup the necessary .{admin,db,form}_config.php files in your site directory. Additionally, when you first start the MySQL container, it will create a user with the following credentials that you can use to login:

  • Username: test
  • Password: test

Production

Similar to the Development, Production can also be run through docker-compose. Setup steps are largely the same, however, you will want to do:

cp .env.sample .env
cp .admin_config.example.php .admin_config.php
cp .db_config.example.php .db_config.php
cp .form_config.example.php .form_config.php

and then edit the four files to have secure values. Once you are ready to run the site, you will run:

docker-compose -f docker-compose.yml up

Where the accessing the site, phpMyAdmin, and MySQL are through the same endpoints as above, using whatever username and password you set in the .env file to access them.

Deployment

The site is deployed live through the use of Travis-CI with all builds being available at https://travis-ci.org/rpiambulance/website. This allows keeping the live site in sync with the code in the repo automatically and without any human intervention, except to keep Travis-CI working, and to occasionally rotate the credentials listed below.

On any pushes to master, Travis-CI will kick off a deploy script which connects to the RPI VPN network, and then uses rsync to push files from the repo to the Union FTP server, where the site is hosted. To do this, it uses five secret variables that are set on Travis-CI under settings for the repo:

  • RPI_FTP_USERNAME
  • RPI_FTP_PASSWORD
  • RPI_VPN_USERNAME
  • RPI_VPN_PASSWORD
  • RPI_VPN_SECRET

The first two variables are used for accessing the Union FTP server. The next three variables deal with logging into RPI's VPN network. The username and password should be the RCS credentials of a current student (preferably the current webmaster's) while the value for the secret can be found at https://afsws.rpi.edu/AFS/dept/cct/public/vpnc/ after logging in. These are then used to configure the vpnc to connect to RPI network, following a similar setup as outlined on the DotCIO Linux VPN instructions.


Credits

This project was created for the RPI Ambulance organization by the Web Technologies Group.

Developers

Copyrights

  • Select photos are copyrighted by David Sparkman and are used with permission from the author.
  • Some photos are copyrighted by Michael Cuozzo and used with permission from the author.

For more information regarding copyrighted works herein contained, please contact [email protected] or [email protected]

website's People

Contributors

alexmattoni avatar cixastra avatar ckegel avatar colton-zecca avatar david-sparky avatar ddbruce avatar jcub avatar justetz avatar lramos15 avatar masterodin avatar tceluzza avatar ymmahmoud avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

website's Issues

Scheduling Coordinator does not have a navigation dropdown

Currently scheduling coordinator has to memorize the hyperlinks needed to modify the schedule and edit the default schedule. These options are prevalent under the admin navigation bar menu and therefore should exist under a specific navigation menu for them.

Fix insecurity mentioned in #56

Per @MasterOdin:

This only prevents the button from showing up to sign up for a crew, but there's nothing stopping someone from still just hitting the API directly and signing up, but that's also because there's absolutely no checks being done. An issue should probably be made about that.

PHP session expires prematurely

The PHP session appears to be getting destroyed prematurely causing the user to get logged out even though they haven't been inactive for five days.
php session

Scheduling coordinator doesn't get a menu

It has been brought to my attention that the scheduling coordinator doesn't get access to a special menu with links to modify schedule and edit default schedule, instead they're required to manually type in the urls to gain access.

Edit Member doesn't work consistently

If you were to edit a member and make them a driver lets say, to take that away you have to check, uncheck, check, uncheck. One simple uncheck doesn't seem to work and allows the user to keep their position. This has caused confusion with many people using this feature.

Changing own password UI bug

When changing one's password, the system shows a message about the passwords not matching, even though they do.

Modify Schedule not working

The new changes to the way night crew's allowing going backwards or forward seems to have caused a regression with Modify Schedule.

DOB validation for sign ups

Require person be 18 to sign up for night crew. Allow for sign up for games/events but with a different name style on event page.

Form validation for Edit Member

We need form validation for the edit member page as people are submitting forms without password or dobs and it causes them to not appear in the edit member pages. This needs to be fixed ASAP as it makes it hard to get many new members emails. This also applied to Add Member!

Highlight goes away on night crew action

Any action done on the night crew page, such ass viewing last weeks schedule, signing up, or dropping a shift causes the highlighted day to go away as the crew is re-rendered

Fix uses of session_start($_GET['id'])

session_start pre 7.0 didn't accept any parameters and post 7.0 accepts an array to override session INI directives. It looks like the code is trying to set the session ID to use if psased one via the $_GET superglobal ($_GET['session_id']), which you'd accomplish via the session_id function instead which does accept a parameter that allows you to set an ID to use (so long as you call it before session_start).

You would therefore most likely want to change all instances of:

session_start($_GET['session_id']);

to be:

session_id($_GET['session_id']);
session_start();

The same thing applies for the places that use the $_POST superglobal as well.

Expiration not working

There seems to be a javascript issue when moving to the expiration page.

TypeError: Cannot read property 'concat' of undefined

Create docker/vagrant file for spinning up local development

Also would help including example .db_config.php and .admin_config.php` files as well as .sql file containing site schema so someone doesn't need to reverse engineer what's in them if they wanted to develop the site locally to contribute patches.

Additionally, this would be useful in knowing the exact versions of PHP, MySQL, Apache/Nginx configuration, etc. as the README.md's instructions are out-of-date.

Invalid Captcha Domain

The captcha is unusable on multiple pages, and is giving the error:
ERROR for site owner:
Invalid domain for site key

image

image

image

Calendar remembering what month you were in

For our calendar if you scroll to a specific month and click an event once you click back then you will be forced to return to the current month. It should save what month you were on before clicking the event.

Edit Member is full of Date FMT errors

If you look in the console after submitting changes to edit a member there are tons of angular date format errors. These probably are also a part of our dating issues.

Add support for PHPMailer

mail() has been disabled due to many security issues with it so now PHPMailer with authentication must be used. I think we should implement in a way that calling a simple function will allow us to send email pretty much like normal so that we can re-enable a lot of the forms which we disabled when mail() stopped being supported.

Syncing Event Calendar with Google Calendar

It is probably one of the most requested features I get from people familiar with the old version of this site. It would be nice if the website could sync with google calendar so that people could see how their schedule fits in with our events.

Member navbar stays after user clicks logout

The navbar that is specific for signed in users still appears and everything works after the user click log out, which leads me to believe that logging out doesn't work correctly.

Member List Mailto:

Member list mailto links for general membership section not filling in correctly. Upper tables work.

Additional membership statuses needed to align with SOPs

SOPs currently define Active, Inactive and Admin. Suggest adding Admin and "archive" status to align with SOPs.

Active, Inactive are permitted to sign up for everything. Admin for only civil side events. "Archive" is for previous members no longer participating in the organization.

Home page events list option

Currently the website only shows events for which signups are disabled. Would like to have a separate toggle switch on create events page to have front facing events while still allowing for sign ups.

SOPs Misnamed

The SOG dropdown is currently named "SOP", which should be changed to reflect NYS guidelines

Clicking Home Logs you out

If you are just browsing on the website and click the home tab, when you click back to members you will have been logged out and have to log back in.

Edit Member list is completely empty

The upgrade to PHP 7.2 caused the edit member page to no longer list the members correctly and nothing is listed there anymore. The edit member page is an extremely helpful tool which we use on a daily basis. This should be fixed ASAP.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.