performance review app

This repo holds 2 projects, front-end & backend code for the sample performance review app. The front-end is written in Angular. The backend is a Node.js project which runs on Express.js middleware. MongoDB is used for managing data of this app. It could be easily moved to a popular RDBMS (ex: MySQL) as the Angular app is totally independent of the tech stack used for the backend. The front-end consumes REST APIs.

The entire project was done with a mobile-first design approach. Angular AuthGuards are used to protect routes that require authentication. JWT tokens are used for authentication. Passwords are hashed before they are inserted to the DB.

For the most part the project uses actual service calls (no service returns mock data) & real data coming from the DB. The only feature which doesn't employ actual api call is the updates to performance reviews.

Instructions for setting up the project can be found below.

Pre-Requisites

  • install mongodb
  • Once you setup MongoDB, start the mongod service & create the DB like so:
# start mongodb
mongo start
# create db
use chocodb

Running backend

  • install dependencies: npm install
  • start backend server: npm run dev
  • confirm if the backend is running:

Running Front-End

Front-end routes

API end-points

MongoDB CLI commands

# use this command to be able to invoke apis from front-end
use chocodb

# check this after creating employees/reviews
show collections

# view all doucments/records in a collection
db.users.find()
db.reviews.find()

# WARING! removes all records
db.reviews.remove({})

# WARNING! drops a collection
db.reviews.drop()

Screens

  • landing page for employees employee landing

  • admin dashboard: managing employees dashboard manage employees

Improvements

  • introduce user role in JWT payload. Then it could used to distinguish employees and admin. Currently this is done by looking at the username, admin. This will help if we decide to have multiple admin users.
  • Create a common component to display error messages. Backend errors could be translated into friendly messages & shown in UI.
  • The above component could be designed to accept:
    • severity levels: (ex: info, warning, success, error) &
    • Soft or Hard notifications. Soft would disappear on its own; Hard notifications needs to be closed by user.
    • example: https://hamzeen.github.io/ngToast/
  • following types of testing needs to be added, unit tests, api tests & integration/UI automation tests.
    • Some Recommendations:
      • unit tests: Jasmine
      • api tests: postman scripts
      • UI Automation/Integration tests: Codecept / Protractor

CREDITS

Splash image on the app was retreived from unsplash. All its credits are attributed to the original photographer, Gio Almonte.