GithubHelp home page GithubHelp logo

utdallasepics / caccc_resource_database Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 6.0 7.94 MB

Code for UTD EPICS resource database project for CACCC

JavaScript 45.88% CSS 3.06% Handlebars 48.95% PowerShell 0.93% Shell 0.86% Dockerfile 0.32%

caccc_resource_database's Issues

Safety checks

If something doesn't exist, server shouldn't crash but should instead return a message to the front end.

Abbreviated state column

No more overly crowded state columns (with full state name text in one narrow column)
Default selected 'TX' value for ease of use

Rework orchestration

Node code should not be managing database, nor should it require the user to have a TTY open (running from the bat file)
Mongo service should be started via npm script, and build system should use npm scripts to manage node_modules instead of them being committed to git

Example: npm run server
in package.json:
"scripts": {
"server": "concurrently 'mongod --config ./mongo.conf' 'node server.js'"
}
Alternatively, mongod can be configured as a service.
Remove associated orchestration and config code from server.js, paths should be set via .env instead of as flags

Stretch goals/future features

  • submission of referrals should be separated from editing.
  • create a "view" for resources, where we can view an overview of everything (possibly including viewing of referral statistics here)
  • referral view UI should be better than an alert!
  • delete specific attachments
  • node docker image
  • cleaner error communication - all pages should support displaying an error message and we should always return a message to the user

Asyncify stuff

Instead of using sync operations (eg fs.readdirSync), use asynchronous operations to prevent blocking on IO. Look at async/await syntax.

RESTify API

Tight coupling between views and API makes it hard to reason about what is happening. Instead of GET requests for everything, those should be limited to loading of pages. Updates and deletions should be performed as individual requests that do not reload the whole page, but instead update small chunks such as displaying a success/error dialog.

Possibly look into Vue/Nuxt or similar framework for the frontend to help with conceptual/organizational separation of frontend/backend. You can go with either an SPA or a static site for the frontend.

Clean up syntax

Several areas could use splats instead of manual assignment, eg the insertRecord function in resourceController could be expressed better as

resource = {... req.body, processResouceType(req.body.resourceType), resourceReferrals = 0} etc

Fix deployment method

Current deployment and update depends on cloning this repository in its entirety, including the whole node_modules folder. This is generally considered Bad Practice.

Ask Taz about Github releases and the proper way to handle dependencies.

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.