Code Monkey home page Code Monkey logo

nova's Introduction

NOVA Project README

Network of Verified Accountability

Directory Structure:

novaweb - Main project directory
novaweb**/src** - Directory for all source code
novaweb/src/main**/java** - Directory for all Java source code
novaweb/src/main**/webapp** - Directory for all web source code

docker - Directory for docker files

How to import to your IDE

This project uses a dependency manager tool known as Maven. Maven allows you to define configurations within an XML file that can automatically be shared with other developers, ensuring that each developer's environment is setup just like every other developer's environment. Maven takes care of importing all JARs for you automatically (such as JDBC Connector).

Maven also allows you to use any IDE that supports importing Maven based projects. Eclipse and IntelliJ allow you to import Maven projects.

To setup your local development environment for NOVA, you'll only need to configure your Tomcat server after you import the project. That's it. The instructions below are for Eclipse, but could be extended to IntelliJ.

  1. Clone this repo to your local machine.

  2. Open a new workspace in Eclipse. Ensure you create a workspace folder in a folder different from the repo

  3. Choose Import projects...

  4. Choose Maven -> Existing Maven Projects

  5. Browse for the cloned repo. Make sure it is selected and click Finish

    And you're done. Now you just need to setup your local Tomcat server.

  6. Choose File -> New -> Other

  7. Search for Server

  8. Under server type, select Tomcat v8.5 Server

  9. Browse for the directory where Tomcat v8.5 is located

  10. Click Finished

  11. Right click on the project directory, choose Maven -> Update Project -> OK

Files you need to change

It's important that after importing the project, you change some specific files. The requirements are below:
  1. novaweb/src/main/resources/config/hibernate.cfg.xml.example - You'll need to copy this file to the same directory and rename it to hibernate.cfg.xml.private. Then, change the required lines in order to connect to the database.

At this point, you should be able to run the project on your local Tomcat server you configured earlier. In the Run As menu, choose Run on Server. Then choose Finish.

nova's People

Contributors

jake-hansen avatar bknutson77 avatar gomezem avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

nova's Issues

Account for users

Description
When a user with the capability to view the accountability tab, they should be able to account for members who need to be accounted for.

Solution
Backend and frontend functionality is created to successfully account for individuals.

Attempting to create a new account leads to "email not available" error

When attempting to create a new account, the message "Email not available." is shown, even if the provided email is available to be used.

The correct functionality should be that the "Email not available." message is only shown when the email address is already in use for an existing user. Otherwise, the email address is considered valid and an account should be created.

The correct functionality was originally present before merging #34, so I'm hoping just some slight modifications are required.

Here is a screenshot of the current functionality after "Create Account" is pressed.

image

Sensitive pages are accessible without being logged in

Some pages that should be protected by being logged in are currently accessible without being logged in.

For example, by navigating to novaemergency.live/novaweb/accountability.jsp, you are presented with all of the options for accountability without being logged in.

This is unintended behavior since sensitive pages that involve modifying items in the database should require a user to be logged in first.

To fix this, a check should be done before loading a page to see if a user is authenticated or not. If they are not authenticated, they should be redirected to the home page.

Search for students/faculty

Description
In the NOVA project documentation it states that there should be a way for first responders to search for students and faculty and display their status as well as their name and emergency contacts.

Solution
Implement search mechanism on the first responder page.

First Responder Updates

Description
In the NOVA project specification, it states there should be a way for first responders to send status updates about the situation.

Solution
The backend functionality should be added that allows first responders to send status updates. Students, Faculty, and Administrators' views should correspondingly show the latest status updates.

Change register functionality to only be accessible by administrators

Problem: Currently, any user visiting the application can request a new user account with any group privilege. This implementation was intentional, as it was designed to be used for testing. With this in mind, this feature has been pushed to develop and should be migrated to administrator only functionality as soon as possible.

Solution: Remove the register button from the login modal, and only allow the register modal to show while an administrator is logged in. This will prevent any user from registering with any group since they don't have the privilege to.

Current view of login modal with register link:

image

Current view of register modal:

image

Change student view theming for better visibility

Issue: I noticed that the cards for the student view have a dark background and could be hard to see for some users.

Solution: The titles of the cards should keep a dark background with light text, for visibility and to stick with the overall theme, but the body of the cards should have a light background with dark text. This will be similar to what theme is present currently for the card divs on the account page.

Here is an example of one of the cards that would need to be changed.

<div class="card text-white bg-dark mb-3">
<div class="card-header"><h5>Law Enforcement/EMS Updates</h5></div>

Each card on the index page, similar to above, would be changed to the following:

<div class="card mb-3">
   <div class="card-header bg-dark text-light"><h5>Law Enforcement/EMS Updates</h5></div>

By making this change, the appearance would go from this:

image

To this:

image

Logging in with an incorrect username/password leads to an exception

When logging in with a bad username/password combination, an error page shows with an IndexOutOfBoundsException. This is not intended functionality.

When attempting to login with a bad username/password combination, the user should be redirected back to the login modal and shown a message that states the username/password is incorrect.

The correct functionality was originally present before #34 was merged, so I'm hoping just some slight modifications are required.

The screenshot below shows the exception:

image

Separate hibernate class mappings from hibernate config file

Problem: The hibernate.cfg.xml.example file contains the mapping for the classes that have hibernate annotations. Because this file needs to be copied during the import of the project and renamed to hibernate.cfg.xml.private in order for Git not to track the file, any new classes made that are referenced by the hibernate file will not automatically be updated in the .private file. This creates an extra burden on anyone working on the project and makes it harder to collaborate when pulling changes.

<mapping class="datamodel.User" />
<mapping class="datamodel.Group" />
<mapping class="datamodel.Session" />

Solution: There should be a way to separate the hibernate config and the hibernate mapping for classes. Ideally, the hibernate config file should only contain the username and password for the database, and another file should contain the mappings for all the hibernate classes.

Context: See comment below in PR #30

Note: There is a slight change you would need to make to your local repo if this PR is merged. Currently, the project retrieves all hibernate configuration information from the hibernate.cfg.xml.private file which is based upon hibernate.cfg.xml.example, both of which are in novaweb/src/main/resources/config. The reason why the .private extension is used is because it flags the file as private, which lets Git know to never commit the file. This is important since the file contains secret information such as the database username and password. That is why during the initial clone of the repo, you must copy the .example config file to the .private file and add the username, password, and database URL.

Take out input functionality from the Account page

Issue
Right now a user can input information into a text box on the Student Account page.
This information should be set and cannot be changed by the student.

Solution
Steps to reproduce the behavior:

  1. Sign in as [email protected]
  2. Go to 'Account'
  3. Click 'Test'
  4. Clicking 'Test' results in an option for user input

Expected behavior
Should not be able to enter information into the Student view of account.

Screenshots
image

Test cases

Test cases need to be added to the project in the directory /src/test/. This will ensure the project is functioning as intended.

Add emergency contact functionality

Feature

Part of NOVA's specification is that there exists a way for students to add emergency contacts to their profile in order for emergency responders and staff members to have information about whom to contact during an emergency.

Solution

The ability to add, remove, change, and view emergency contacts should be added to the backend. This would be done by using the existing DAO style to create a way to add, remove, and change emergency contacts in the database. A Servlet would also need to be added as a way to retrieve emergency contacts from the database.

Self Status Reporting

Description
The NOVA project specification states that there should be a way for users to self report their own status.

Solution
The backend functionality should be implemented to allow users to report their status. The user should be notified if their status was successfully reported or not.

Add Emergency Contact

Description
NOVA needs a way for users to add an emergency contact.

Solution
Each account will be capable of adding an emergency contact to their profile page.

Should an admin who is creating an account also include the emergency contact information?
I will for now add it to the profile page and see what my team thinks about the other option.

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.