![Page 1: Meetup 24/3/2016 - Node.js User Group Belgium](https://reader033.vdocuments.us/reader033/viewer/2022042906/589b56d11a28ab606f8b4a09/html5/thumbnails/1.jpg)
Stefan Pante@stefanpante
![Page 2: Meetup 24/3/2016 - Node.js User Group Belgium](https://reader033.vdocuments.us/reader033/viewer/2022042906/589b56d11a28ab606f8b4a09/html5/thumbnails/2.jpg)
Node.js at Digipolis: Experiences and lessons learned24/03/2016
![Page 3: Meetup 24/3/2016 - Node.js User Group Belgium](https://reader033.vdocuments.us/reader033/viewer/2022042906/589b56d11a28ab606f8b4a09/html5/thumbnails/3.jpg)
The Node.js Team
![Page 4: Meetup 24/3/2016 - Node.js User Group Belgium](https://reader033.vdocuments.us/reader033/viewer/2022042906/589b56d11a28ab606f8b4a09/html5/thumbnails/4.jpg)
A-stad
![Page 5: Meetup 24/3/2016 - Node.js User Group Belgium](https://reader033.vdocuments.us/reader033/viewer/2022042906/589b56d11a28ab606f8b4a09/html5/thumbnails/5.jpg)
Stack
![Page 6: Meetup 24/3/2016 - Node.js User Group Belgium](https://reader033.vdocuments.us/reader033/viewer/2022042906/589b56d11a28ab606f8b4a09/html5/thumbnails/6.jpg)
A-profiel (user app)
meldingene-loket notificati
on redactie ... helpcenter
cart(betalen) search stadspla
n
Civilian/Employee
![Page 7: Meetup 24/3/2016 - Node.js User Group Belgium](https://reader033.vdocuments.us/reader033/viewer/2022042906/589b56d11a28ab606f8b4a09/html5/thumbnails/7.jpg)
Centrale Reference Systems
A-profiel (user app)
meldingene-loket notificati
on redactie ... helpcenter
cart(betalen) search stadspla
n
Civilian/Employee
![Page 8: Meetup 24/3/2016 - Node.js User Group Belgium](https://reader033.vdocuments.us/reader033/viewer/2022042906/589b56d11a28ab606f8b4a09/html5/thumbnails/8.jpg)
Good Ideas1. Reusable modules
![Page 9: Meetup 24/3/2016 - Node.js User Group Belgium](https://reader033.vdocuments.us/reader033/viewer/2022042906/589b56d11a28ab606f8b4a09/html5/thumbnails/9.jpg)
Good Ideas1. Reusable modules
2. Basic application structure
![Page 10: Meetup 24/3/2016 - Node.js User Group Belgium](https://reader033.vdocuments.us/reader033/viewer/2022042906/589b56d11a28ab606f8b4a09/html5/thumbnails/10.jpg)
Good Ideas1. Reusable modules
2. Basic application structure
3. Code Quality
![Page 11: Meetup 24/3/2016 - Node.js User Group Belgium](https://reader033.vdocuments.us/reader033/viewer/2022042906/589b56d11a28ab606f8b4a09/html5/thumbnails/11.jpg)
1. Reusable modules
![Page 12: Meetup 24/3/2016 - Node.js User Group Belgium](https://reader033.vdocuments.us/reader033/viewer/2022042906/589b56d11a28ab606f8b4a09/html5/thumbnails/12.jpg)
New Application
User Service
Apache Solr
Notification Service
![Page 13: Meetup 24/3/2016 - Node.js User Group Belgium](https://reader033.vdocuments.us/reader033/viewer/2022042906/589b56d11a28ab606f8b4a09/html5/thumbnails/13.jpg)
Modules● Communication and Authorization
![Page 14: Meetup 24/3/2016 - Node.js User Group Belgium](https://reader033.vdocuments.us/reader033/viewer/2022042906/589b56d11a28ab606f8b4a09/html5/thumbnails/14.jpg)
Modules● Communication and Authorization
● Common tasks: mailing, response handling…
![Page 15: Meetup 24/3/2016 - Node.js User Group Belgium](https://reader033.vdocuments.us/reader033/viewer/2022042906/589b56d11a28ab606f8b4a09/html5/thumbnails/15.jpg)
Modules● Communication and Authorization
● Common tasks: mailing, response handling…
● Wrapper around existing modules, with specific
configuration
![Page 16: Meetup 24/3/2016 - Node.js User Group Belgium](https://reader033.vdocuments.us/reader033/viewer/2022042906/589b56d11a28ab606f8b4a09/html5/thumbnails/16.jpg)
Astad module was born
![Page 17: Meetup 24/3/2016 - Node.js User Group Belgium](https://reader033.vdocuments.us/reader033/viewer/2022042906/589b56d11a28ab606f8b4a09/html5/thumbnails/17.jpg)
All dependencies you’d ever need
![Page 18: Meetup 24/3/2016 - Node.js User Group Belgium](https://reader033.vdocuments.us/reader033/viewer/2022042906/589b56d11a28ab606f8b4a09/html5/thumbnails/18.jpg)
Everything initialised and exposed on Express app
![Page 19: Meetup 24/3/2016 - Node.js User Group Belgium](https://reader033.vdocuments.us/reader033/viewer/2022042906/589b56d11a28ab606f8b4a09/html5/thumbnails/19.jpg)
Disadvantages● Hard to maintain (versioning difficult)
![Page 20: Meetup 24/3/2016 - Node.js User Group Belgium](https://reader033.vdocuments.us/reader033/viewer/2022042906/589b56d11a28ab606f8b4a09/html5/thumbnails/20.jpg)
Disadvantages● Hard to maintain (versioning difficult)
● Many unused dependencies
![Page 21: Meetup 24/3/2016 - Node.js User Group Belgium](https://reader033.vdocuments.us/reader033/viewer/2022042906/589b56d11a28ab606f8b4a09/html5/thumbnails/21.jpg)
Disadvantages● Hard to maintain (versioning difficult)
● Many unused dependencies
● Scripts, cron jobs…
![Page 22: Meetup 24/3/2016 - Node.js User Group Belgium](https://reader033.vdocuments.us/reader033/viewer/2022042906/589b56d11a28ab606f8b4a09/html5/thumbnails/22.jpg)
Disadvantages● Hard to maintain (versioning difficult)
● Many unused dependencies
● Scripts, cron jobs…
● Required intrinsic knowledge
![Page 23: Meetup 24/3/2016 - Node.js User Group Belgium](https://reader033.vdocuments.us/reader033/viewer/2022042906/589b56d11a28ab606f8b4a09/html5/thumbnails/23.jpg)
![Page 24: Meetup 24/3/2016 - Node.js User Group Belgium](https://reader033.vdocuments.us/reader033/viewer/2022042906/589b56d11a28ab606f8b4a09/html5/thumbnails/24.jpg)
![Page 25: Meetup 24/3/2016 - Node.js User Group Belgium](https://reader033.vdocuments.us/reader033/viewer/2022042906/589b56d11a28ab606f8b4a09/html5/thumbnails/25.jpg)
Astad Module
![Page 26: Meetup 24/3/2016 - Node.js User Group Belgium](https://reader033.vdocuments.us/reader033/viewer/2022042906/589b56d11a28ab606f8b4a09/html5/thumbnails/26.jpg)
Astad Module
Astad-Solr Astad-User Astad-Request ...
![Page 27: Meetup 24/3/2016 - Node.js User Group Belgium](https://reader033.vdocuments.us/reader033/viewer/2022042906/589b56d11a28ab606f8b4a09/html5/thumbnails/27.jpg)
Many modules were created
![Page 28: Meetup 24/3/2016 - Node.js User Group Belgium](https://reader033.vdocuments.us/reader033/viewer/2022042906/589b56d11a28ab606f8b4a09/html5/thumbnails/28.jpg)
Only use what you need,Dependencies are explicit!
![Page 29: Meetup 24/3/2016 - Node.js User Group Belgium](https://reader033.vdocuments.us/reader033/viewer/2022042906/589b56d11a28ab606f8b4a09/html5/thumbnails/29.jpg)
Easier to test!Each module = one concern
![Page 30: Meetup 24/3/2016 - Node.js User Group Belgium](https://reader033.vdocuments.us/reader033/viewer/2022042906/589b56d11a28ab606f8b4a09/html5/thumbnails/30.jpg)
Disadvantages● Still cumbersome to update dependencies
with git tags
![Page 31: Meetup 24/3/2016 - Node.js User Group Belgium](https://reader033.vdocuments.us/reader033/viewer/2022042906/589b56d11a28ab606f8b4a09/html5/thumbnails/31.jpg)
Disadvantages● Still cumbersome to update dependencies
with git tags
● BUG = Manually updating package.json of
dependents
![Page 32: Meetup 24/3/2016 - Node.js User Group Belgium](https://reader033.vdocuments.us/reader033/viewer/2022042906/589b56d11a28ab606f8b4a09/html5/thumbnails/32.jpg)
(Sinopia)
![Page 33: Meetup 24/3/2016 - Node.js User Group Belgium](https://reader033.vdocuments.us/reader033/viewer/2022042906/589b56d11a28ab606f8b4a09/html5/thumbnails/33.jpg)
Our very own private NPM repository
![Page 34: Meetup 24/3/2016 - Node.js User Group Belgium](https://reader033.vdocuments.us/reader033/viewer/2022042906/589b56d11a28ab606f8b4a09/html5/thumbnails/34.jpg)
~ Allows patch variations
![Page 35: Meetup 24/3/2016 - Node.js User Group Belgium](https://reader033.vdocuments.us/reader033/viewer/2022042906/589b56d11a28ab606f8b4a09/html5/thumbnails/35.jpg)
2. Basic application structure
![Page 36: Meetup 24/3/2016 - Node.js User Group Belgium](https://reader033.vdocuments.us/reader033/viewer/2022042906/589b56d11a28ab606f8b4a09/html5/thumbnails/36.jpg)
Basic application structure● Quickly start developing
![Page 37: Meetup 24/3/2016 - Node.js User Group Belgium](https://reader033.vdocuments.us/reader033/viewer/2022042906/589b56d11a28ab606f8b4a09/html5/thumbnails/37.jpg)
Basic application structure● Quickly start developing
● Uniformity and familiarity
![Page 38: Meetup 24/3/2016 - Node.js User Group Belgium](https://reader033.vdocuments.us/reader033/viewer/2022042906/589b56d11a28ab606f8b4a09/html5/thumbnails/38.jpg)
Skeleton app● Git repository to fork
![Page 39: Meetup 24/3/2016 - Node.js User Group Belgium](https://reader033.vdocuments.us/reader033/viewer/2022042906/589b56d11a28ab606f8b4a09/html5/thumbnails/39.jpg)
Skeleton app● Git repository to fork
● Basic uniform file structure
![Page 40: Meetup 24/3/2016 - Node.js User Group Belgium](https://reader033.vdocuments.us/reader033/viewer/2022042906/589b56d11a28ab606f8b4a09/html5/thumbnails/40.jpg)
Skeleton app● Git repository to fork
● Basic uniform file structure
● Most used modules included
![Page 41: Meetup 24/3/2016 - Node.js User Group Belgium](https://reader033.vdocuments.us/reader033/viewer/2022042906/589b56d11a28ab606f8b4a09/html5/thumbnails/41.jpg)
Disadvantages● Still some basic configuration required
![Page 42: Meetup 24/3/2016 - Node.js User Group Belgium](https://reader033.vdocuments.us/reader033/viewer/2022042906/589b56d11a28ab606f8b4a09/html5/thumbnails/42.jpg)
Disadvantages● Still some basic configuration required
● Some apps need frontend, others don’t
![Page 43: Meetup 24/3/2016 - Node.js User Group Belgium](https://reader033.vdocuments.us/reader033/viewer/2022042906/589b56d11a28ab606f8b4a09/html5/thumbnails/43.jpg)
Disadvantages● Still some basic configuration required
● Some apps need frontend, others don’t
● Need to remove unused dependencies
![Page 44: Meetup 24/3/2016 - Node.js User Group Belgium](https://reader033.vdocuments.us/reader033/viewer/2022042906/589b56d11a28ab606f8b4a09/html5/thumbnails/44.jpg)
![Page 45: Meetup 24/3/2016 - Node.js User Group Belgium](https://reader033.vdocuments.us/reader033/viewer/2022042906/589b56d11a28ab606f8b4a09/html5/thumbnails/45.jpg)
Yeoman Generator(s)● Asks basic questions
![Page 46: Meetup 24/3/2016 - Node.js User Group Belgium](https://reader033.vdocuments.us/reader033/viewer/2022042906/589b56d11a28ab606f8b4a09/html5/thumbnails/46.jpg)
Yeoman Generator(s)● Asks basic questions
● Conditionally load dependencies,
file structure
![Page 47: Meetup 24/3/2016 - Node.js User Group Belgium](https://reader033.vdocuments.us/reader033/viewer/2022042906/589b56d11a28ab606f8b4a09/html5/thumbnails/47.jpg)
Yeoman Generator(s)● Asks basic questions
● Conditionally load dependencies,
file structure
● Basic config taken care of
![Page 48: Meetup 24/3/2016 - Node.js User Group Belgium](https://reader033.vdocuments.us/reader033/viewer/2022042906/589b56d11a28ab606f8b4a09/html5/thumbnails/48.jpg)
yo astad Please specify your project name: “A-stad”Do you need a frontend for this project : (Y/n) “Y”
![Page 49: Meetup 24/3/2016 - Node.js User Group Belgium](https://reader033.vdocuments.us/reader033/viewer/2022042906/589b56d11a28ab606f8b4a09/html5/thumbnails/49.jpg)
![Page 50: Meetup 24/3/2016 - Node.js User Group Belgium](https://reader033.vdocuments.us/reader033/viewer/2022042906/589b56d11a28ab606f8b4a09/html5/thumbnails/50.jpg)
![Page 51: Meetup 24/3/2016 - Node.js User Group Belgium](https://reader033.vdocuments.us/reader033/viewer/2022042906/589b56d11a28ab606f8b4a09/html5/thumbnails/51.jpg)
3. Code quality
![Page 52: Meetup 24/3/2016 - Node.js User Group Belgium](https://reader033.vdocuments.us/reader033/viewer/2022042906/589b56d11a28ab606f8b4a09/html5/thumbnails/52.jpg)
Testing● Ensure functionality is correct
![Page 53: Meetup 24/3/2016 - Node.js User Group Belgium](https://reader033.vdocuments.us/reader033/viewer/2022042906/589b56d11a28ab606f8b4a09/html5/thumbnails/53.jpg)
Testing● Ensure functionality is correct
● Test robustness of methods
![Page 54: Meetup 24/3/2016 - Node.js User Group Belgium](https://reader033.vdocuments.us/reader033/viewer/2022042906/589b56d11a28ab606f8b4a09/html5/thumbnails/54.jpg)
Testing● Ensure functionality is correct
● Test robustness of methods
● Tests allow refactoring
![Page 55: Meetup 24/3/2016 - Node.js User Group Belgium](https://reader033.vdocuments.us/reader033/viewer/2022042906/589b56d11a28ab606f8b4a09/html5/thumbnails/55.jpg)
![Page 56: Meetup 24/3/2016 - Node.js User Group Belgium](https://reader033.vdocuments.us/reader033/viewer/2022042906/589b56d11a28ab606f8b4a09/html5/thumbnails/56.jpg)
Testing without Control● Easy to cheat
![Page 57: Meetup 24/3/2016 - Node.js User Group Belgium](https://reader033.vdocuments.us/reader033/viewer/2022042906/589b56d11a28ab606f8b4a09/html5/thumbnails/57.jpg)
Testing without Control● Easy to cheat
● Tests are neglected
![Page 58: Meetup 24/3/2016 - Node.js User Group Belgium](https://reader033.vdocuments.us/reader033/viewer/2022042906/589b56d11a28ab606f8b4a09/html5/thumbnails/58.jpg)
Automated testing● No deploys without tests
● PR’s are not approved when tests fail
![Page 59: Meetup 24/3/2016 - Node.js User Group Belgium](https://reader033.vdocuments.us/reader033/viewer/2022042906/589b56d11a28ab606f8b4a09/html5/thumbnails/59.jpg)
Other measures● Coding guidelines:JSLint, ESLint
● Code Reviews during PR, min 2 other dev’s.
![Page 60: Meetup 24/3/2016 - Node.js User Group Belgium](https://reader033.vdocuments.us/reader033/viewer/2022042906/589b56d11a28ab606f8b4a09/html5/thumbnails/60.jpg)
Conclusion● Reusable modules
● Basic application structure
● Code Quality
![Page 61: Meetup 24/3/2016 - Node.js User Group Belgium](https://reader033.vdocuments.us/reader033/viewer/2022042906/589b56d11a28ab606f8b4a09/html5/thumbnails/61.jpg)
ConclusionLearning from your mistakes allows for continuous
improvement and enables you to write better code.
![Page 62: Meetup 24/3/2016 - Node.js User Group Belgium](https://reader033.vdocuments.us/reader033/viewer/2022042906/589b56d11a28ab606f8b4a09/html5/thumbnails/62.jpg)
Questions?