Giter Club home page Giter Club logo

express-file-sync-tool's Introduction

Express File Sync Tool

Exploring use of Express-js as a platform for detecting new-files in a target folder, processing them, and sending specific file data using REST for storage in a back-end file system and/or database.

Expections

  • This is an exploration and is not intended for production or trustworthy use.
  • Files that change in configured source folder(s) defined using ENV files will be processed and parsed for specific data using a regex.
  • Processed file data that meets RegEx criteria will be stored in a separate file on the 'server' (database) instance.
  • Processed file data that meets RegEx criteria will be submitted to the 'server' (database) using HTTP POST.
  • Future design and implementation of a more robust solution will be derived (at least in part) from work done in this repository.

Goals Achieved

  • Can detect new files in configured location and read-in file data.
  • Can format file data suitable for storing in database records.
  • Client-side can send a POST REST message to a configured server address properly.
  • Server-side can process new file data and store in a logfile, appending data.
  • Server-side can receive POST data from configured client, process the data, and store in a local MongoDB collection.
  • MongoDB driver used for CRUD (although no update nor delete was done)

Lessons Learned

  • Avoid mixing server-side and client-side code into a single project whenever possible due to confusing (complex) code execution path logic overlaps.
  • Consider a different language/platform so users don't have to install NPM or other 'web' dependencies.
  • Don't try to close a MongoDB Client right after operating on it (uses Promises), instead close the client with a separate operation if necessary.

Going Forward

  • Find out what database file structure is needed for storing data e.g. MDF (preferred)? XLSX (less-preferred)? Other?
  • Determine the minimim user-input needed to configure the client and server apps to get them talking to each other.
  • Design a UI that will serve as a 'server side' control panel.
  • Design a UI that will serve as a 'client side' display, or create a unified UI that could do either, possibly based on configuration.

express-file-sync-tool's People

Contributors

nojronatron 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.