How I Set up Production Node.js Project (2024)

Поділитися
Вставка
  • Опубліковано 3 січ 2025

КОМЕНТАРІ • 12

  • @mohamedyoussef8835
    @mohamedyoussef8835 2 місяці тому +1

    Great help. Thank You.

  • @slooibba0169
    @slooibba0169 4 місяці тому +1

    Thank you !!

  • @kocourekkocourek-pq2tm
    @kocourekkocourek-pq2tm Місяць тому +1

    Hi Alex, please could you show us how to set up .npmrc file create your own npm package registry with github actions and use in another project.

    • @alexrusin
      @alexrusin  Місяць тому

      I have a similar video on creating npm packages. It uses turborepo: ua-cam.com/video/SGSCAHVKqmc/v-deo.html

  • @madmaxdev
    @madmaxdev 4 місяці тому +1

    Node has --watch flag that is similar to nodemon, so no need for extra dependency. And i think drizzle ORM is pretty good.

    • @alexrusin
      @alexrusin  4 місяці тому

      I don't think it works very well with typescript though, at least with node 20. Yep, that is correct. Drizzle is a good ORM as well. I even have a poll about about ORMs where Drizzle is included: ua-cam.com/users/postUgkxHC64JNlrMFwHoB_5jHNTCfAYLh9o4uHS

  • @deepak5074
    @deepak5074 4 місяці тому +3

    I think its time to move biome from eslint for linting. What do you say sir?

    • @alexrusin
      @alexrusin  4 місяці тому +1

      It definitely looks faster than ESLint and Prettier. I gotta check it out.

  • @2005bgva
    @2005bgva 4 місяці тому

    Hi Alex, thanks for video. One question: why do you instal dotenv-cli like dev dependencie and not dependency? if you doen not install like a dependency how know from where to obtain .env configuration?

    • @alexrusin
      @alexrusin  4 місяці тому +1

      When you deploy your app to production you normally will put your env variables into the environment. It really depends where you deploy. If you are using AWS ECS you will put it in your task definition. If you are using docker compose, there's a specific environment property (or you can just put those variables in the Dockerfile as args and populate them during the build time). In some instances you can deploy your app on a server and use PM2, then you can use .env file to for the app to pick up your environment variables. In that case you can update your package.json file to have dotenv-cli as a regular dependency. You will want to create (update) your run script to use dotenv-cli.

    • @2005bgva
      @2005bgva 4 місяці тому

      @@alexrusin Thanks