Code Monkey home page Code Monkey logo

e-immigrate's Introduction

Project New Citizen

Project New Citizen is a web application created for the Center for Employment Training Immigration and Citizenship Program (CET-ICP) in collaboration with Code for San Jose.

CET-ICP regularly holds workshops to help immigrants on their paths to become U.S. Citizens, but when they could no longer hold their in-person workshops due to COVID-19 they reached out to Code for San Jose to help move the workshop online.

The purpose of the project is to have users watch an informational video and answer a series of questions so that immigration attourneys and DOJ accredited representatives can help them become U.S. Citizens.

Run Locally

Clone the project

  git clone https://github.com/noelsner/e-immigrate.git

Go to the project directory

  cd e-immigrate

Install dependencies

  npm install

Run MongoDB Locally

In order to run mongoDB locally, you will need to have mongoDB installed in your device.

which mongo

Checks if you have mongoDB installed on your device. It should return a directory path like /usr/local/bin/mongo. If it doesn't, you will need to install mongoDB on your device.

Installing MongoDB

In order to install mongoDB on you device, go to mongoDB manual and follow the instructions.

Connecting to MongoDB

After installing mongoDB, navigate to the backend folder and create a .env file

cd backend

touch .env

In the .env file add the following:

MONGO_URI = mongodb://localhost/test
JWT_KEY = <secret key>

Note: The secret key can be a "string, buffer, or object containing either the secret for HMAC algorithms or the PEM encoded private key for RSA and ECDSA". For more information on jwt, visit JWT Documentation.

Note: test in the line above is the name of the database that you want your application to connect to. You can choose your own name for the database.

Now, still in the backend folder, run the following command in the terminal:

node index.js

or

nodemon index.js

You should see a response as shown below, if mongoDB is connected to your application.

listening on port 5000
MongoDB database connection established successfully

Start the Frontend

From the main project directory

  npm run start

Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.

Update Excel Files

Drag and drop the updated Questionnaire for Upload.xlsx and/or Website Content.xlsx file(s) into the backend folder

In the terminal, from the backend folder, run the following command(s):

node uploadQuestionnaireFromExcel.js
node uploadTranslatedContentFromExcel.js

e-immigrate's People

Contributors

aaa12345678910 avatar darpham avatar jeffersonken19 avatar jmstudiosjoe avatar logan-dang avatar mtw812 avatar nickoelsner avatar prazolpp avatar rollerss avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

e-immigrate's Issues

Start questions UI

start the components for making questions that are very similar to the ones we see now. Have the questions be in a config file for now read in and display a similar UI with yes no responses. Also in the other languages, line height will be key to displaying all languages.

refactor prescreening questions logic branchs, question 1, 2, 3

try to move these 1, 2, 3, questions to the worksheet already and refactor the Question 3 to be just a datepicker and see the other two questions to determine better naming.

Nested components with LogicBranches component Workshop questions lead to lots of nested components so hopefully will reduce complexity of nested components and project structure hierarchy.

User eligibility steps

Before someone can take the workshop they must meet the requirements specified in the survey. Pre questions before the questionaire.

Hubspot expectations/limitations

Go through the apps question form fill out all required info and find a way to make sure the user watches the video first and enters in required info to take the question form. Once done with the form need to find out how do we handle the question form responses, does hubspot give us the results or do we need to go into hubspot and download the data?

refactor language options to not rely on order

language options in both the frontend and backend rely on their specific ordering of the columns in the website content spreadsheet and with the sheet ordering in the questionnaire red flags. need to refactor the uploading scripts to not rely on the ordering of the language options and the sheet ordering.

Instead of collection of options make it into an object by language code key lookup.

Admin Sign Up Route Multiple HTTP responses sent

in routes/admin post to / that creates a new admin user the case a failed create of the Admin object is not handled correctly. Currently, it is doing a HTTP response.status(500).json to inform the caller of the problem but has already responded with a success by the time this code is ever executed. Currently, we are responding with success before the create promise is resolved. Express will complain if this code is executed.

submit user response to db

When user is finished with questionaire and click submit, the response is sent to the backend and to the mongodb for admin page to display at.

  • When user clicks submit, go through each resopnse and if any are answered yes add 'red' if all are no then 'green'

User experience flow

Need to go through the application, watch the video fill out the question form and see what needs to be changed for the most optimal user experience.

routes for handling uploading excel docs

A new admin route that will recieve a file blob, excel document, from the frontend client side computer. It will then go through the scripts for backend/uploadQuestionnaireFromExcel.js & uploadTranslatedContentFromExcel.js. One route for the questionnaire document, another for the website translations or could be in one route up to developer best practices.

Super user admin

allow some orgs to upload their own questionnaire, only see responses from those while super admins can view all questionnaires and all responses

Revisit authorization of protected endpoints

Some of the admin endpoints and those used by dashboard should be accessible only by admins who are logged in. Code in backend/middleware/auth.js makes use of jwt token returned upon successful authentication. We should use it consistently for all endpoints that need protection.

Currently, questionnaire answers are posted by users who are not authenticated. We should come up with a mechanism to validate these are legitimate requests from our UI.

refactor the date validation

When user selects a date, save it to local storage. then when in the workshop portion <Questionnaire component checks the local storage for date check if date is wrong then send them back to screening. Also if at submission has the date check or not for Admin to visibly check.

add code formatter

add Prettierjs or another tool for keeping code formatting consistent.

Revisit Error handling in routes

For example, in the user route, if an error occurs, the request hangs. Instead, should status(500) and return an error message

User login

Allow CET admin user to log into application and see a list of all who have filled out the question form.

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.