Giter Site home page Giter Site logo

nikkithought / mean-development-guide-2021 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from manjeshpv/mean-development-guide-2021

0.0 1.0 0.0 89 KB

Mongo/MySQL/Node/Express/

Home Page: https://manjeshpv.github.io/mean-development-guide-2021/

License: Apache License 2.0

JavaScript 100.00%

mean-development-guide-2021's Introduction

Tools of Trade

  • Start with github
  • Installling Git
  • Installing WebStorm

Folder structure

  • start with a console.log(‘hello world’);
  • run with res.json({ message: “hello world” })
  • Using webstorm for nodejs backend projects
  • .ediorconfig
  • Unhandled errors and rejections
  • ES6
  • Typescript
  • ts-node-dev
  • request-promise
  • express-middlewares & config/express.js
  • routes.js & Modularity with express routers
  • components folder
  • eslint 6.8.0
  • using dotenv for environment file
  • Inspired by generator-angular-fullstack developed by Google, Yeoman

Writing First Test Case

  • mocha spec file for unit tests
  • unit tests vs integration test vs api tests
  • mocha service.spec.js for functional tests
  • mocha controller.spec.js for express api tests with supertest
  • nyc for test coverage
  • devDependencies vs Dependecies
  • what is package-lock.json
  • using scripts section in package json
  • what is license
  • nodemon for restarting as soon code changes
  • how webstorm save developer time with autosave feature and nodemon restart the code
  • browsersync vs livereload

Writing first controller

  • REST Api standards
  • sinatra standards from naming functions in controller
  • service.js for functions with async and not using req, res objects
  • unit.js for simple javascript without async
  • Promise vs Async

Keeping the code clean

  • eslint – global module
  • eslint local devDependency
  • eslintrc file
  • airbnb
  • es6 vs normal javascript
  • Semantic commit messages

Dealing with databases

  • mysql2
  • sequelize orm
  • migrations
  • seeding
  • .sequelizerc
  • Sequelize best practices

Crons & Scheduled Jobs

  • Do not run email/notifications crons on midnight
  • cron vs ttl events
  • best and worst delay with crons, achieving realtime processing with websockets using redis kue, rabbitmq
  • cron over code vs http api
  • how nginx logs help to monitor and improve performance of cron jobs
  • Cron job performance issues & Dividing long running cron jobs
  • cron job boot up time vs api based crons without per request boot
  • using amazon sns for cron jobs
  • unifying cron jobs with event processing
  • keeping log of failed cron jobs and get alerts to debug, fix and rerun
  • gronit vs cron logs with cron

Monitoring

  • API response time with simple-api-response-logger
  • Runtime errors with Sentry
  • Logging with winston
  • Logging cron executions time metrics

Performance at Production

  • Disable logs as much as possible in production
  • use PM2
  • Pm2 cluster mode & scaling with pm2

Integrations

  • building webhooks with node-webhooks
  • lambda

Interact with servers/services using you own npm modules

  • creating your first npm package
  • npm package for easy integrations
  • nodejs developers feel using npm module is easy. compared to reading api documentation
  • Example: Your marketing-server(website) creates a lead in sales-server(lead management system) – instead of sharing a common db

Socket.io for comments/chats – Realtime

  • eventlistners
  • socketio client for angular
  • socket io config with express
  • enabling websocket support in nginx

CI/CD - Quality Checks

  • Github Actions
  • Drone CI

Pull Request Reviews

  • Write github issues link or asana task link in github commit
  • codecov for code coverage
  • drone for running tests and submitting report to codecov
  • in memory db to improve test run performance
  • sinon to stub integrations tests
  • nyc & istanbul for test coverage
  • precommit-hook to run basic quality checks before commit & eslint

Staging Environment for Product and Business Teams to test

  • staging prefix for servers
  • avoiding production data in staging to avoid hacks

Easy Deployement with CapRover

  • captain-definition file
  • create a app in caprover
  • adding caprover link to github webhooks for autodeploy on gith push

UI

  • Integrate your angular project with OAuth 2.0

UX

Documentation

  • Asana(Free)
  • Github Markdown/Github Pages

References:

mean-development-guide-2021's People

Contributors

manjeshpv avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.