Giter Site home page Giter Site logo

bhallibhai / asset-management Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 9.25 MB

Asset Management Dashboard is a full MERN stack application for the management of assets and shipments of assets (including all CRUD operations) with a modular structure and centralized dashboard. Formerly known as Product Management Portal.

License: MIT License

JavaScript 92.48% HTML 0.36% CSS 0.25% TypeScript 6.92%

asset-management's Introduction

Asset Management Dashboard

Asset Management Dashboard is a full MERN stack application for the management of assets and shipments of assets (including all CRUD operations) with a modular structure and centralized dashboard. Formerly known as Product Management Portal.

Frontend language Backend language Stack

Motivation

This project was developed in collaboration with Evolution Engineering & Energy Technologies as a central dashboard for the management and tracking of company assets and shipments. The goal was to build a custom application that would help to replace and amalgamate the fragmented, 3rd party management solutions currently in use. Prior to this application, the company did not have a reliable way to track and maintain history, status, rental assignment, or ownership (among other details) of these products.

Features

  • Central dashboard with global search
  • Listing, filtering, and creation of assets and shipments
  • Map views for asset locations and shipment routes
  • Support for file attachments to shipments
  • Error-checking and schema validation of assemblies
  • "Shopping cart"-style tools for creating and managing assemblies and shipments

Live Demo

A live demo can be found here.

You may use the following credentials to log in:

Username: jsmith
Password: password1

Note: The live demo is hosted on a free Heroku server which shuts down after 30 minutes of inactivity (and deletes files with it).

  • You may need to refresh the page multiple times to allow the server to start before login or API calls can go through
  • Some attachments may show up under a shipment's details, but attempting to view them results in a spinner because Heroku deleted the files as temporary
    • To test attachment functionality, upload a new attachment and immediately view it

Demo video / project overview: YouTube

Build status

Build Status

Technology

Frontend
Backend

Screenshots

Login

Login screen

User Profile

User profile

Dashboard (sidebar open)

Dashboard with sidebar open

Global Search

Dashboard page with search bar and results

Search Details

Search details page with table of search results

All Assets (list view)

Table with list of all assets in the system

All Assets (map view)

A map of assets / markers based on their locations alongside a table with list of all assets in the viewport of the map

Asset Details

Page displaying properties of a single asset in a clean way with a timeline of its associated events

Assembly Manager

Assembly manager and creator tool as a table of assets and a floating "shopping cart"-style widget

All Shipments

Table with list of all shipments in the system, organized by their status

Shipment Details

Page displaying properties of a single shipment in a clean way with a map of the shipment's route and a table of the items contained in the shipment

Shipment Creator (Submission Dialog)

Shipment creator tool with a submission dialog listing the source and destination locations of the shipments and possible overrides on the location properties

Installation

Further details may be found in the frontend folder README.md and the backend folder README.md.

Node.js version >= 14 is required to run the API server due to the usage of optional chaining.

The package.json file in the root project directory provides a few convenience scripts atop the normal ones. The simplest way to get started is to run

npm run-script launch

which will install all frontend and backend dependencies, build the frontend, run the server, and serve the frontend production code at port 3000 (by default) on localhost.

Building without running can be accomplished by running

npm run-script build

To manually launch the frontend from the frontend directory, ensure dependencies are installed with npm install, then a development build can be launched using npm start and a production build can be built using npm run-script build and served using serve -s [build directory] -l [port].

To manually launch the backend server from the backend directory, ensure dependencies are installed with npm install, then the server can be started with either node server.js for a single invocation, or nodemon server.js for restarting the server when files are updated.

Both the frontend and the backend expect .env files with necessary values to run. See here for the example frontend .env and here for the example backend .env.

Dependencies
  • If you wish to utilize data caching for the API server, ensure you have a Redis server setup and running, and its URL in the backend .env file (see sample .env)

Usage

  • Users must manually be created in the database in order to log in, there is currently no user creation implementation
  • Sample data is provided and can be loaded into the database using the provided /load POST endpoints of each collection
  • Additional assets, assemblies, and shipments can all be created through the GUI

Considerations

Authentication

  • The method by which users are currently authenticated is not suitable for production and all instances of user identification in the frontend will need to be retooled (for example user name display and how users are tied to the assets they create)
  • The team chose to forego a robust authentication system due to the company utilizing SSO / Microsoft Active Directory as their primary user authentication strategy and integration was deemed outside the scope of the project
  • The current method is a very simple check against passwords that are stored in the database in plaintext
    • If the user is successfully authenticated, the server sends back an encrypted JSON object that the user sends back in the body of all PATCH or POST requests in order to authorize themselves
    • This encrypted object is simply stored in LocalStorage and while it is somewhat secure due to its encryption, it is not suitable for production, nor is plaintext password storage
  • Additionally, API routes are not thoroughly protected from unauthenticated users
  • When this refactor is completed, any frontend page using the custom useLocalStorage hook and any backend page using the encrypt/decrypt functions and/or PATCH/POST endpoints that use the value req.body.user will need to be updated for the new authentication scheme

Database

  • It's likely that the usage of the database is the area of the project where the most optimization could occur
  • For one, the data we are storing is pretty highly relational but we have chosen to use MongoDB (a NoSQL database)
    • This structure required us to store ObjectId references and populate() them at query time (similar to a SQL JOIN, which NoSQL database are not optimized for)
    • This both complicated our queries and likely hampers performance
  • It's possible this could be remedied by denormalizing the database
    • However, the nature of the data — in particular, the recursive relationship between assets and assemblies (parents in the same collection) — may make a SQL database, such as PostgreSQL, more desirable
  • As a result of this additional complexity, the major POST and PATCH endpoints of both modules generally perform many queries in order to properly update all the circular references, children, etc.
    • These complex endpoints are wrapped in transactions in order to ensure atomicity and mitigate some of the problems
    • However, the current logic is fairly complex, likely still has errors, and may not be as performant as it could be

Styling and Reponsiveness

  • The current styling is not optimized for phones or other small screens
  • While some responsive components (such as Material-UI's Grid) and CSS properties such as flex where used throughout the project, many pages and elements still do not render correctly on small screens

API Reference

Frontend

Frontend components are documented throughout the project using inline comments, JSDoc, and prop-types.

Backend

The backend server API documentation is written in OpenAPI and hosted at /api-docs of the server URL using SwaggerUI.

Contributors

License

License: MIT

Full license available here.

asset-management's People

Contributors

bhallibhai avatar

Watchers

 avatar

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.