lms is built upon a npm module webpack, a tool that enables the rapid development of components, templates and pages, so this project requires Node.js v6.11.2+ to be installed locally. A global install of Webpack is also recommended.
To get the project up and running, and view components in the browser, complete the following steps:
- Download and install Node: https://nodejs.org/
- Clone this repo:
git@github.com:nctuwinlab/lms-frontend.git
(SSH) orhttps://github.com/nctuwinlab/lms-frontend.git
(HTTPS) - [Optional] Install Webpack globally:
npm install webpack -g
- [Optional] Install Webpack Dev Server globally:
npm install webpack-dev-server -g
- Install project dependancies:
npm install
- Create the build folder:
mkdir build
- Start the development environment:
npm run dev
- Open your browser and visit http://localhost:8080
When developing components, you may want assets automatically compiled and the browser to refresh automatically. To do this, run the following task:
npm run dev
To create a static instance of this project, run the following task:
npm run build
This will create a bundle file called index.bundle.js
, into which the required files will be created.
Sometimes it’s helpful to know what all these different files are for…
/
├─ app/
│ ├─ index.jsx # Base component of routers and redux
│ │
│ ├─ Actions/ # Redux actions
│ │
│ ├─ Components/ # Components
│ │ ├─ App.jsx # …that render root component
│ │ ├─ Login/ # …that render component login form
│ │ ├─ Nav/ # …that render component navbar
│ │ ├─ Routes/ # …that govern route to every page
│ │ └─ Pages/ # …that render every single page
| |
│ ├─ Reducers/ # Redux reducers
| |
│ └─ css/ # SCSS files
│ ├─ Login/ # css mixin of login form
│ └─ Nav/ # css mixin of navbar
|
├─ node_modules/ # Files required for dynamic builds, created by npm (ignored by Git)
├─ build/ # Public build (ignored by Git)
│
├─ index.html # entry HTML
├─ .gitignore # List of files and folders not tracked by Git
├─ webpack.config.js # Configuration for Gulp tasks
├─ package.json # Project manifest
└─ README.md # This file