Node - Boilerplate Back : Express, Jwt, Mongo, Sequelize (Beta)
6.7K
This project is a Node stack that can be ran as a standalone BackEnd. Or in a fullstack with another repo of your choice (ex: Vue, Swift).
Quick links :
| Subject | Informations |
|---|---|
| Available | |
| Architecture | Layered Architecture : everything is separated in layers, and the upper layers are abstractions of the lower ones, that's why every layer should only reference the immediate lower layer (vertical modules architecture with Repository and Services Pattern) |
| Server | Node >= v14 LTS Express - body-parser - compression - CORS - method-override gulp 4 - nodemon |
| DataBase | Mongo 4.x LTS - mongoose - User, Crud, Seed, Gridf upload, Options (auth, ssl ..) Sequelize - PostgreSQL, MySQL, SQLit 4.x (option - crud Task example) JOI - Models & Repository for database code abstraction |
| Testing | Jest - SuperTest - Coverage & Watch example of mocha with gulp available |
| Security | passport-jwt - JWT Stateless bcrypt - zxcvbn - Passwords SSL - Express / Reverse Proxy (must be activated, otherwise => plain text password) |
| API | jsend - Default answer wrapper (helper) : status, message, data or error Helper: default errors handling : formatted by the controller, Custom ES6 errors for other layers |
| Upload | Mongo gridfs - mongoose-gridfs - Multer - Sharp - Image stream example, all contentType, image video .. |
| Logs | winston - morgan custom example available |
| CI | Travis CI - Drone.io |
| Linter | ESLint - ecmaVersion 10 (2019) |
| Developer | Coveralls - Code Climate - Dependency status - Dependabot - Snyk standard-version / semantic-release - commitlint - commitizen - @weareopensource/conventional-changelog |
| Dependencies | npm |
| Deliver | Docker & Docker-compose |
| In reflexion | |
| Documentation | Swagger Docco |
| Developer | uses v8's builtin debug and inspect options |
| API | evolution & version guideline |
Make sure you have installed all of the following prerequisites on your development machine:
It's straightforward (you can use yarn if you want)
git clone https://github.com/weareopensource/node.git && cd Node
npm i
npm start or npm run serve to run a dev server. Available at http://localhost:3000/.npm run prod to run a prod server. Available at http://localhost:3000/npm run debugnpm testnpm run test:watchnpm run test:coveragenpm run seed:devnpm run seed:prodnpm run seed:mongodump be careful to not upload sample in public reponpm run seed:mongorestore create or update data based on _id, no purgenpm run seed:mongodropnpm run generate:sslCertsnpm run lintnpm run commitnpm run release -- --first-release standard version, changelog, tag & choose version number : -- --release-as 1.1.1GITHUB_TOKEN=XXXXX npm run release:auto semantic release, changelog, tag, release require repositoryUrl conf in package.jsondocker run --env WAOS_NODE_db_uri=mongodb://host.docker.internal/WaosNodeDev --env WAOS_NODE_host=0.0.0.0 --rm -p 3000:3000 weareopensource/nodeif you want to build yourself : docker build -t weareopensource/node .
docker-compose upThe default configuration is : config/defaults/development.js
The other configurations : config/defaults/*.js overwrite the default configuration, you can create your own.
We take into account all system environment variables defined under the form WAOS_VUE_<path_toVariable>. A script turns under the hood those system environment variables into an object, infering paths from the varialbles name, merged to the configuration defined on config/defaults to regenerate the config.
So configuration avalable on config/defaults/development file are overidable. You can for instance define the app name by defining those system environment variables :
WAOS_NODE_app_title='my app =)'
This work is based on MEAN.js and more precisely on a fork of the developers named Riess.js. The work being stopped we wished to take it back, we want to create updated stack with same mindset "simple", "easy to use". The toolbox needed to start projects, but not only with Node and Angular ...
Today, we dreams to create Backs/Fronts, aligns on feats, in multiple languages, in order to allow anyone to compose fullstack on demand (React, Angular, VusJS, Node, Nest, Swift, Go). Feel free to discuss, share other kind of bricks, and invite whoever you want with this mindset to come help us.
Feel free to help us ! :)
Content type
Image
Digest
Size
150.2 MB
Last updated
over 6 years ago
docker pull weareopensource/node