- npm start(normal start)
- npm run dev (start with nodemon for restarting it when changes are made)
- npm test (for testing)
- npm run lint(for running linting) If you clone the project, run the npm install command before starting the application with npm start or npm run dev.
npm update - for updating the dependencies of the project
- git clone address
- cd bloglist-frontend // go to cloned repository
- rm -rf .git //remove the git configuration of the cloned application
- npm install //install its dependencies
- npm start
"build:ui": "rm -rf build && cd ../Frontend && npm run build && cp -r build ../Backend",
"deploy:full": "npm run build:ui && git add . && git commit -m uibuild && git push"
Q: "rm -rf build && cd ../Frontend && npm run build && cp -r build ../Backend", what does this command do? A: Let's break down the command step by step:
-
rm -rf build
: This command removes the existingbuild
folder in the backend directory. The-r
flag means to remove the directory and its contents recursively, and the-f
flag forces the removal without prompting for confirmation. -
cd ../Frontend
: This command changes the current directory to theFrontend
folder. The../
notation is used to navigate up one level in the directory hierarchy. -
npm run build
: This command executes the npm script namedbuild
in theFrontend
folder. It is assumed that there is a script defined in thepackage.json
file of theFrontend
repository that performs the build process for the frontend application. -
cp -r build ../Backend
: This command copies thebuild
folder (which was generated in the frontend build process) and its contents from theFrontend
directory to theBackend
directory. The-r
flag indicates a recursive copy, ensuring that the entirebuild
directory with its subdirectories and files is copied.
In summary, this command sequence removes the existing build
folder from the backend, builds the frontend by running the build
script in the frontend repository, and then copies the generated build
folder to the backend directory. This allows you to automate the process of creating a production build of the frontend and integrating it with the backend without requiring manual steps.
node mongo.js password - command for interacting with the database (instead 'password' word paste your password from mongo db)
MongoDb:
url for connection:
mongodb+srv://Roman:<password>
@cluster1.d7mltpu.mongodb.net/?retryWrites=true&w=majority (Replace <password>
with the password for the Roman user)