Code Monkey home page Code Monkey logo

webvv's Introduction

YAMI Lucas Ouaniche 2018


Sources :

I am working with the AMI library, available on github : https://github.com/FNNDSC/ami .

My development is under the commit f8d659d9b5768d3c82932c7be32fed2c67120b7d done the 24th of may 2018. Previously 63c8ff5d5932b1132bc08ac7f63776fa54c0c938 done the 14th of may 2018.


New node.js server

Install from the git

After cloning the git, dependencies are listed in the package.json . To install what is needed, run :

npm install

New installation

In order to simplify the server code we get rid of everything running AMI examples and AMI compilation.

The easiest way to do that is create a new server. In theory our application can be run from any server, we choose a Node.js server (for 'require', 'let', or ES6 syntax).

mkdir myApplicationName
cd myApplicationName

npm init

npm install express --save

To avoid writing a super long js file, we use the Module behavior with Webpack :

touch webpack.config.js
cd public && touch index.html bundle.js
cd .. && cd src && touch index.js && cd ..

mkdir assets && cd assets && mkdir fonts icons images stylesheets

(general setup, now webpack :)

npm install webpack --save

Architecture of this server

  • node_modules are functional files/folders
  • package.json is the first configuration of the server : dependencies and available commands (in the section "script")
  • index.js is the entry point, contains the configuration of the server (host, port...)
  • webpack.config.js is the configuration of the 'compilation' of our js
  • src are readable .js before being bundled up. See the README.md file inside this folder for more information.
  • public is what we send to the user : html files and the bundle of our .js'

Build the documentation

Documentation has not been pushed on this repository. To build it, run the following command :

yarn doc

A folder out is created. It contains the documentation.

Uses of this server

This server has 2 main purposes

The "bundling" of our .js files

It will stay active and watch for modifications. It can be used to work while we edit files that don't need server to be seen.

Here we can open public/viewer.html without the server and use webpack to update the bundle.js with the final script :

yarn webpack

The server itself, currently doing nothing peculiar (just serves static files)

Use this when you don't work on dev and want to use the server and don't change the sources.

yarn start

Both

Do both, the server is started and watch for modifications

yarn webpack_server

webvv's People

Contributors

tbaudier avatar

Stargazers

Michael Knopke avatar

Watchers

Simon Rit avatar David Sarrut avatar James Cloos avatar Lucas OH avatar  avatar

Forkers

oneorthomedical

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.