Project description:

This website is created for a food charity organization, we try to make the process of signing up as a member to be easier. People can signup as donators or beneficiaries. A donator can donate food items in the website; a beneficiary can see what food items are available to get.
The website uses Json Web Token to authenticate users, there is an access token for the users to access the protected content after they have logged in. They will only see the content which matches with their donator roles or beneficiary roles.


Technology used:

A full stack application, using AngularJS for the frontend, Node.js and Express for the backend, MongoDB for the database, and Json Web Token for user authentication.


Application features:
  • All the fields are required in the signup and login form
  • When the users trying to signup or login to the website, they are required to fill in all the fields in the signup form and the login form. If the fields are empty or not in the correct format, the fields will be highlighted in red to alert the users.


  • Create the role database when the application starts, encrpyt the users' password before saving the users
  • The application will create a role database with the role ID and role name, the users can signup as either a donator role or a beneficiary role. When the users signup, they get to choose which role they would like to be, after they had submitted the signup form, it will find which roles they had chosen and will match them with the role ID, it will also encrypt their password with the "Bcrypt" middleware before saving their data into the database.


  • Authorize users using Json Web Token and show content depends on the users' roles
  • If the user 's login email and password are found in the database, the Json Web Token will sign the user as an authenticated user. The authenticated user will be assigned an access token to access protected content. The website will be reloaded after a successful login, the user will be able to see the personal profile, and access to either the donate page or the beneficiary page.


  • Ensure correct data is entered in the donation form
  • The donation form contains fields for the users to input the food item and the quantity of food item to donate, the food item field cannot be null, and the quantity of food item must be at least 1. If the users try to submit the form without matching the requirements, an error message will show in the frontend.


  • Fetch all the food items available from the database and redeem them with a voucher code
  • All the food items saved in the database, they come with a automatic generated voucher code. The beneficiary can see all the food items available to be redeemed, and redeem them with the voucher code of the food item.