What are the best practices for MEAN stack web development ?
Rupesh Krishna Jha

Rupesh Krishna Jha @rupeshiya

About: Aspiring Full Stack Web developer and Open Source Contributor.

Location:
Bhubaneswar,India
Joined:
Jun 23, 2018

What are the best practices for MEAN stack web development ?

Publish Date: Jan 26 '19
15 14

Comments 14 total

  • James Allen
    James AllenJan 26, 2019

    On the subject of replacing parts of MEAN, also replace Express with Nestjs (it wraps Express under-the-hood, but aligns with your Angular code!)

    • Rupesh Krishna Jha
      Rupesh Krishna JhaJan 26, 2019

      Thanks @james ,I will definately give it a try .

    • Sagar Bhattacharya
      Sagar BhattacharyaJan 27, 2019

      I tried nestjs , but felt it restricts a user into learning nest and it's pattern, while express gives a user a freehand into understanding nodejs , nest is more like angular styled nodejs which seems very restrictive on the server side and I felt not much of an advantage

      • James Allen
        James AllenJan 27, 2019

        While Nestjs is a framework and it does have its own approach to things, you can still interface directly with the underlying express instance.

        I suggest exploring dependency injection on your server side, it was the 2nd reason I chose to start with Nestjs (1st again being it aligns so well with my Angular code!)

  • Rupesh Krishna Jha
    Rupesh Krishna JhaJan 26, 2019

    thanks @artemix , Since I don't have much experience with RDBMS so can you please share some resource where I can read the code of the project implemented with RDBMS like MySql etc. and can learn from those projects .

  • Sagar Bhattacharya
    Sagar BhattacharyaJan 27, 2019
    1. Following a good style-guide

    2. Keeping the code functional and simple

    3. Understanding the difference between arrow function , function with function keyword , a basic understanding of this.

    4. Be aware of the event the node or web environment provide

    5. Avoiding duplicate code as much as possible , even if you feel you are duplicating code try to create a common service and as soon as you done with that remove duplicate code.

    6. Proper Error Handling on priority

    7. Understanding critical points of memory leak

    8. If their are some tasks like cron-jobs if possible run them as a separate micro-service called jobs totally outside of the application scope

    9. Use observables and behaviour subject for handling event change and try to avoid timeout as much as possible

    10. Divide the project into modules and identify the scope of services

    11. Learn aggregation.

    12. Learn about capped and ttl collection

    13. Proper Index Creation is must for giving performance boost

    14. Config must be properly developed

    15. Caching should be learnt on priority and various caching strategy available analysed

    16. Don't block the event loop.

    17. Refactor your code , avoid duplicates and write unit test cases

    18. Learn basics about ec2-instances , remote deployment , linux environment , docker.

    19. Git skills are a must

    20. Learn to create local packages and use them

    21. Learn about creating micro-services

    22. Please try and keep upgrading the node , angular version

    23. MongoDb atlas must be given a try

  • Sagar Bhattacharya
    Sagar BhattacharyaJan 27, 2019

    MongoDb is a real dbms , it's non-relational and have bson based structure , it has support for lookups , aggregation , indexing ( Select , Insert , Update and Delete ) and with latest stream api it now also supports triggers , and the whole benefit of mongo is of not having a fixed structure and it's flexibility. We cannot compare orange and apple and say one is not a fruit based on the other one's definition

  • Rupesh Krishna Jha
    Rupesh Krishna JhaJan 27, 2019

    Thanks a lot @artemix for sharing this resources !!

  • Lars Wächter
    Lars WächterJan 27, 2019

    I find this quite helpful:
    github.com/i0natan/nodebestpractices

Add comment