Giter Site home page Giter Site logo

node-course-final's Introduction

node-course-final

NODE mentoring program project - part 2

Basic scripts

npm start -> this execute index.js file using nodemon npm test -> No implemeted yet npm run start -> it will start the server using pm2 npm run stop -> will stop the server npm run build -> it will compile .ts files into .js for node server usage npm run populate-mongo-db -> run the script to populate mongo db with initial values. Before run this task make sure you build the project first. npm run sql-init-db -> it will applied migrations and seed the database with initial values (user and product)

How to run the project Setting the .env file. The project uses dotenv for setting some configuration. The values you need to place in .env file are:

MONGODB_INITDB_ROOT_USERNAME -> need for running mongo, if you are using sql, skip it MONGODB_INITDB_ROOT_PASSWORD -> need for running mongo, if you are using sql, skip it POSTGRES_PASSWORD POSTGRES_USER POSTGRES_DB

Set up the project by running npm install Once dependencies are installed run npm run build to compile the project, this script will create a build directory that it will be used by npm run start command.

The project include a docker-compose file for running the database and web service. You can use podman or docker, ex. podman compose up -d.

Once the DB container is running we need to run migrations.

Running migrations and seed the database You can run npm run sql-init-db, for running migrations and seed the database with initial values. It will create an admin user and two products.

Running the server Note: If you're running docker-compose, you can skip this step Once you have compilled the ./src files and you have a database running, you can run npm run start to start the server. Server will be running on port 3000

To stop the server, run npm run stop

node-course-final's People

Contributors

alejandrodss avatar

Watchers

 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.