Projet from msalles-winn
Docker image available at https://hub.docker.com/r/yboyer/winn-project/
-
Server
Node.js
nedb
- InMemory DBMSexpress
- Web frameworkbody-parser
- JSON request playload parser
node-uuid
- UUID genarator
mocha
- Testssupertest
- HTTP assertions
-
Client
angular
jspm
- Angular dependenciessystemjs
- Dynamic module loader
babel
- 6to5 compilermaterial-design-lite
- Google's material design stylegoogle-maps
- Google Maps
gulp
- Task runnerbrowser-sync
- Synced websitesass
- Dynamic style sheet generatorkarma
- Tests on browsers (rendering and methods of Angular components)jasmine
- Tests
-
Production
docker
- App packager
- Latest version of Angular:
V2.0.1
- Docker image size is about 20MB (shipped with
Node.js
) - Lightweight DBMS and subset of MongoDB with
NeDB
- Use of
ECMAScript 6
andECMAScript 7
- NPM scripts to do everything
- Automatic front-end development tasks with
Gulp
- Automatic Docker image build, push and deployment with shell scripts
- No isomorphic support the Angular app (See Universal)
No server-side verifications about the transport object sent by others ways than the built website- See commit 00dd21No checks on the date (eg when the arrival date is earlier than the departure date)- See commit c12ad9 but.... wait.. time travels are allowed ?!- No UX for the pending actions sent by clients
git clone https://github.com/yboyer/winn-project.git
cd winn-project
npm i
npm run build
npm start
docker pull yboyer/winn-project
docker run yboyer/winn-project
npm start [PORT]
to launch the servernpm run build
to build the clientnpm run doc_client
to generate doc for the clientnpm run doc_server
to generate doc for the servernpm run doc
to generate doc for both client and servernpm run test_client
to launch the unit tests for the clientnpm run test_server
to launch the unit tests for the servernpm test
to launch the unit tests for both client and server
./scripts/build.sh
./scripts/push.sh
./scripts/deploy.sh
The server can be started with npm start
from the root or with node server
from the server directory.
It listens from the port 3000
by default but it can be changed by passing the new port by argument.
# npm start [PORT || 3000]
npm start 3005
# or
node server 3005
npm start [PORT]
to launch the servernpm test
to launch the unit tests with Mochanpm run doc
to generate documentation in./doc
You need to fix the
uglify-js
version of thegulp-uglify
dependence. (See client/README.md)
npm run build
to build an optimized version of the application in./dist
npm run serve
to launch a browser sync servernpm run serve:dist
to launch a server on the optimized applicationnpm run test
to launch the unit tests with Karmanpm run test:auto
to launch the unit tests with Karma in watch modenpm run doc
to generate doc in./doc
If gulp-cli
is installed (npm i gulp-cli -g
):
gulp
orgulp build
gulp serve
gulp serve:dist
gulp test
gulp test:auto
- Create a REST API to serve an Transport object.
- A transport object is defined by : an ID (uuid), a title (string), a departure date (datetime), an arrival date (datetime), a departure point (geocode), an arrival point (geocode), a status (PROPOSED, CONFIRMED, RESERVED, CHECKEDIN, CHECKEDOUT).
- Create a GUI with JS framework of your choice, this GUI must be served by the NodeJS server. We access the GUI from the "/gui" URL prefix.
- The transport objects are stored in-memory.
- The GUI contains 2 pages : a list of transports, all informations are presented into a table, update, delete actions in a column, and a page with a form to add or edit a transport.
- We start the server with following command : npm start, do not forget tests (Mocha) and documentation (APIDOCJS.com) !
- Create a docker image with this server
- Use a DBMS to store the transport objects
- Show the transport objects on a Google Map
- Create a deploy script to update a docker image on the server and restart it after tests success
- It must work, easy to launch ;
- Code quality ;
- Tested and Documented ...