Skip to content

Web application / portal that algorithmically connects teachers peer-to-peer using geolocation. Built using React, Redux, Node, Sequelize, PostgreSQL. About the program https://wemakepeace.org/peace-letter-program/

License

Notifications You must be signed in to change notification settings

wemakepeace/wmpapp

Repository files navigation

WMP application

Portal that connects teacher peer to peer, and facilitates a letter exchange program between school classes

Getting Started

To get a copy of the project up and running, clone the repo. See deployment for notes on how to deploy the project on a live system.

Prerequisites

This project requires that you have the following utilities available globally in your execution environment:

Node
Nodemon
Postgres / psql

Configuration

Postgres

When connecting to postgres, you will need to create a db with the name wmp. You can use the following command to initiate a psql session:

psql

...if this command fails for the following reason psql: FATAL: database "<username>" does not exist, then you can connect to any existing db and go from there. To get the list of available databases, you can type psql -l. You should see some output with the list of available dbs. Assuming you have one with the name postgres, you could run the following command to connect to psql:

psql -d postgres

From there, you should be able to run the following command to create the wmp db:

CREATE DATABASE wmp;

Creating a .env file

You will also need to create a .env file in the root of the repository. This should be based on the .env.example file that is also located in the root of the repository. You will need to either get accurate values from an Admin of the repo, or create some of your own in order for the app to function as expected.

Installation

Run the following commands in order to install the npm dependencies and start the app up locally. This will start a local server, that will connect to your locally running postgres db, and also start up a client and automatically open the client in your browser.

npm install
npm run start:dev

To see the seed data in the database after the startup, connect to the wmp db and go from there, e.g.:

psql -d wmp
select * from [tablename];

BDD Testing

npm run test

About the app

Features

Login

Token based login. Email is username and password needed.

Forgot password

Link with token gets sent to email (if email exist in database), and user can reset password by clicking link as long as token remains valid. Sends email notification if password is changed for security measure.

Signup

Only emails that have not been registered before. Validates passwords (Minimum 8 characters).

Create teacher profile

Teacher details: First name, last name, email, phone number

Account Settings

Change password: Requires current password, and sends email notification if password is changed for security measure.

Delete account: GDPR compliant. User can delete all information. Deleting teacher profile will also delete all classes registered by teacher, and set the status of any current exchanges (that are not completed) to ‘cancelled’, and notify the teachers of the exchanging classes via email.

Register class

Teacher can register as many classes as they wish, and teacher can manage their enrolled classes in the same teacher profile. Class details: Class name, size, age group (8-9 or 10-11), term School details: School name, address, zip, city, country

Initiate Exchange

The teacher can initiate an exchange for a registered class. This is done on the Overview page. The app will look for a matching class based on the age group and the term. A class will not be matched with a class from the same country. If there are more than one matching class, the app will find the class furthest that has been matched.

When a class is initiates an exchange, there are two possible scenarios:

  1. Match is made: If there is a class match, the exchange status will be set to ‘PENDING’, and the two teachers of the exchanging classes will be emailed and given one week to confirm the participation. This can be done on the Overview page by clicking a button that says ‘Confirm Participation’. Once both teachers confirm, the exchange status will be set to ‘CONFIRMED’ and the teachers will be granted access to the materials. The materials will then be available under the main menu. In the case that one of the teachers of a match does not confirm the participation, that class will be removed from that exchange, and the exchange status will be set to ‘INITIATED’ so that the class that did confirm will keep the opportunity to be matched with a different class.

  2. A match is not made: If there is not a matching class registered already, the initiating class will be associated with a new exchange and the status will be set to ‘INITIATED’. This means that if another class signs up that matches the criteria, they will be matched with this class.

Materials

If a class is enrolled in a confirmed exchange, the teacher will have access to the materials needed. The instructions for each letter as well as a downloadable template can be found on the Materials page.

Help

Basic Q&A. Has a support messaging feature.

Deployment

AWS EC2 instance, RDS/PostgreSQL database, S3 data storage

Built With

Feedback

We welcome any feedback, on product or code or both! Please email exhange@wemakepeace.org

Authors

  • Kris Alnes - Initial work - kjalnes

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

About

Web application / portal that algorithmically connects teachers peer-to-peer using geolocation. Built using React, Redux, Node, Sequelize, PostgreSQL. About the program https://wemakepeace.org/peace-letter-program/

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published