Scalable NodeJS Framework

හෙනයා

Well-known member
  • May 23, 2014
    16,729
    16,831
    113
    Kottawa
    ගොඩක් කට්ටිය nodejs platform එකේ web/api develop කරන්නෙ යොදා ගන්නෙ express නෙහ්..

    ඊට අමතව තව නැගල යන framework එකක් ගැන කියන්නයි හදන්නෙ..

    ඒක තමා

    NestJS



    ඇත්තම කිව්වොත් express උඩ wrapper එකක් විදිහට තමා මේක හදල තියෙන්නේ.. express දාල config කරන්න ඔනේ සමහරක් දේවල් මේකෙ build in විදිහට තියෙනවා..

    ඒ වගේම මේක scalable framework එකක්.. තව ඉතින් බර බර වචන දාල ගුණ වයල තියෙනව documentation එකේ නම්.. :P

    අනිත් එක මේක ලියල තියෙන්නෙ typescript වලින්. ඒ වගේම මේකෙ follow කරන්නෙ Angular වල modular architecture එක.. ඒ නිසා Angular Developer ලටනම් නියම back end framework එක.. :yes::yes: එක්කෝ universal එක්ක SSR කරන්න පුලුවන්... නැත්තම් දෙක isolated විදිහට පාවිච්චි කරන්න පුලුවන්..

    Angular වල තියෙන OOP + FP + FRP, IOC/DI වගේ concepts මේකෙ පාවිච්චි කරන්න පුලුවන්..

    ඒ වගේම කලින් Spring / .NET වගෙ කරල තියෙනව්නම් pattern එක අල්ලගන්න ලේසි.. annotation / attributes වෙනුවට තියෙන්නෙ decorators.. ගොඩක් ඒවා ඒ විදිහමයි..

    තව තියෙන features ටික මම point wise කියාගෙන යන්නම්..

    --> අනිත් back end framework වල වගේ Controller -> Service/Provider ->Repository/DAO -> DB pattern එක තමයි ගොඩක් වෙලාවට use කරන්නේ.. මීට පරිබාහිරව යන්නත් පුලුවන්...

    --> Global Exception filters දාල exception handle කරන්නත් පුලුවන්.. specific exception throw කරන්නත් පුලුවන්.. ඒවට APIs මේකේ ලියල තියෙනවා..

    --> Guard දාල routes protect කරන්නත් පුලුවන්... (Authentication + Authorization)

    --> Middleware / Interceptors වගේ පොලිස් ඩයල් දාල යන req,res අතරමග නවත්තල දඩ ගහන්නත් පුලුවන්.. :dull:

    --> Authentication / Authorization වලට කෙලින්ම්ම express වල වගේ passport use කරන්න පුලුවන්.. :yes::yes:

    --> SQL DB වලට කෙලින්ම තියෙනව TypeORM එක.. sequelize වගේ.. හැබැයි පොඩ්ඩක් වෙනස්.. :nerd::nerd: Hibernate, EF කලින් use කරල තියෙනවනම් අල්ලගන්න එක ගේමක් නෑ... JPA annotation ටික ඒ විදිහටම එහෙම් පිටින්ම්ම ඒ functionality එකෙන්ම්ම තියෙනවා.. :rofl::rofl: හැබැයි hibernate/DataJPA වලට වඩා පොඩ්ඩක් flexible.. හැබැයි features අතින් ගත්තම් පොඩ්ඩක් අඩුයි.. හැබැයි අවුලක් නෑ.. workarounds තියෙනවා.. :yes::yes:
    typeorm වල migration use කරන්නත් පුලුවන්.. entity class එකට අනුව migration script එක auto generate කරගන්නත් පුලුවන්.. schema එකට කරන changes අනුවත් migration generate කරගන්නත් පුලුවන්..

    ඕනිමනම් sequelize යූස් කරන්නත් පුලුවන්...

    --> Mongo වලට නම් කෙලිනම මුගටියා ඉන්නවා.. :yes::yes: :baffled::baffled:

    --> file upload වලට නම් මල්ටර් use කරල decorators වලින් wrap කරල ලේසි කරල හදල දිල තියෙනවා..

    --> DTO level එකට එහෙම class-validator එකෙන් validation apply කරන්න පුලුවන්.. :yes::yes:

    --> dotenv එකෙන් environment එකට ගැලපෙන විදිහට configurations හදාගන්න පුලුවන්..

    --> Axios wrap කරල response එක Observable වලට transform කරල දෙන HTTP Module එකකුත් තියෙනවා..

    --> MVC වල template engine එකට ඔනේ එකක් යූස් කරන්න පුලුවන්.. doc එකේ නම් දිල තියෙන්නෙ handlebars

    --> පොඩි පොඩි decorators ටිකක් දාල swagger api එක auto generate කරගන්නත් පුලුවන්.. :yes::yes:

    --> GraphQL, Websockets Integrate කරගන්නත් පුලුවන්.. :yes::yes:

    --> Micro-services level එකට යන්නත් පුලුවන්.. මන් නම් තාම NestJS framework එක micro-service විඩිහට යූස් කරල නෑ.. කරපු කෙනෙක් ඉන්නව්නම් කියන්න විස්තර එහෙම... ;);)

    මේ ටික තමා ඉතින් වටින් ගොඩින් එන විස්තර ටික.. තව ගොඩක් දේවල් documentation එකේ තියෙනව බලන්න පුලුවන්.. :):)

    https://docs.nestjs.com

    NestJS යූස් කරල කරපු opensource projects මේකෙන් ගිහින් බලන්න පුලුවන්...

    https://github.com/juliandavidmr/awesome-nestjs#resources

    Try කරල බලන්න :cool::cool:

     

    හෙනයා

    Well-known member
  • May 23, 2014
    16,729
    16,831
    113
    Kottawa
    why is it scalable? :confused: and how?
    scalable wenne application eka misak framwork eka nemei..thats my understanding..framework eka okata adala wenne kohomada?

    A application built upon a scalable framework or whatever scalable technology becomes a scalable application. That's for my understanding :confused:

    Anyway why arguing with two words instead of trying out the framework? :dull:
     
    Last edited:

    kolavari

    Well-known member
  • Aug 11, 2012
    33,746
    1
    25,653
    113
    කැළෑ පොජ්ජේ
    හෙනයා;24636168 said:
    A application built upon a scalable framework or whatever scalable technology becomes a scalable application. That's for my understanding :confused:

    Anyway why arguing with two words instead of trying out the framework? :dull:


    Not arguing, just asking to get it clarified..im not using all the new frameworks :P:rofl:

    Anyway the framork isnt scalable really..u can write scalable apps, its just how u write it..
     
    Last edited: