Doguhan Uluca
Technical Fellow at
@duluca
We're hiring, including fully remote positions!
Sandbags of Complexity
Template Project
Sample Project
Presentation
API
Business
Persistence
Best Practices
IDE
Patterns
Libraries
Testing
Angular
Express.js
Node.js
MongoDB
VS Code
npm
GitHub
jasmine
TypeScript
CI
Docker
Node
TypeScript
duluca/minimal-node-web-server
duluca/minimal-node-build-env
Lightweight and efficient JavaScript runtime, using an event-driven, non-blocking I/O model
Runs everywhere
TypeScript
Covers the
JavaScript Feature Gap
Monorepo structure
lemon-mart-server
├───bin
├───web-app (default Angular setup)
├───server
│ ├───src
│ │ ├───models
│ │ ├───public
│ │ ├───services
│ │ ├───v1
│ │ │ └───routes
│ │ └───v2
│ │ └───routes
│ └───tests
│ package.json
│ README.md
Configuring a Node project with TypeScript
$ mkdir server
$ cd server
$ npm init -y
$ npm i -g mrm-task-typescript-vscode
$ npx mrm typescript-vscode
Generated Files for Server
server
│ .gitignore
│ .nycrc
│ .prettierignore
│ .prettierrc
│ example.env
│ jasmine.json
│ package-lock.json
│ package.json
│ pull_request_template.md
│ tsconfig.json
│ tsconfig.src.json
│ tslint.json
│
├───.vscode
│ extensions.json
│ launch.json
│ settings.json
│
├───src
│ index.ts
│
└───tests
│ index.spec.ts
│ tsconfig.spec.json
Verify Project
server
│
├───dist
│ index.js
│ index.js.map
$ npm test
Docker
Covers the Configuration Gap
Branch
Merge
Branch
Merge
Ship
FROM
SETUP
COPY
CMD
FROM
Operating Environment
FROM
FROM
FROM
scratch
nginx
alpine
FROM
SETUP
Security
Dependencies
Operating Environment
Host OS
Docker
Runtime
Container
Web Server
App
FROM
SETUP
COPY
Security
Dependencies
Operating Environment
Compiled Code
Assets
FROM
SETUP
COPY
Security
Dependencies
Operating Environment
Compiled Code
Assets
Host OS
Docker
Runtime
Docker Image
Web Server
App Code
Host OS
Docker
Runtime
minimal-nginx-web-server
nginx
Angular
/dist
/usr/src/app
FROM
SETUP
COPY
CMD
Security
Dependencies
bit.ly/npmScriptsForDocker
Express
body-parser
cors
morgan
passport
Fast, unopinionated, minimalist web framework for Node.js
Vast plugin eco-system
Mongo
mongodb
document-ts
Document-oriented database with dynamic JSON-like schemas
Mature, performant and capable