From 7b36cf4e027e1e276c2e8f8295ba54799c1ca17e Mon Sep 17 00:00:00 2001 From: Joseph Ditton Date: Tue, 1 Mar 2022 10:02:11 -0700 Subject: [PATCH] remove $ from commands for easy copy paste --- ASDFVM_SETUP.md | 10 +++++----- README.md | 36 ++++++++++++++++++------------------ 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/ASDFVM_SETUP.md b/ASDFVM_SETUP.md index f3089a4..005668f 100644 --- a/ASDFVM_SETUP.md +++ b/ASDFVM_SETUP.md @@ -1,7 +1,7 @@ # ASDFVM Setup 1. Run ```bash -$ git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.8.1 +git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.8.1 ``` 1. Visit this [link](https://asdf-vm.com/guide/getting-started.html#_3-install-asdf) and follow the installation instructions for your OS and terminal. For Windows with WSL and most linux distros you will look at the "Bash & Git" section. For Mac you will look either at the "Bash & Git (macOS)" or the "ZSH & Git" section depending on your default terminal. @@ -13,7 +13,7 @@ $ git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.8.1 ## Installing the NodeJS plugin 1. Install the plugin ```bash -$ asdf plugin add nodejs https://github.com/asdf-vm/asdf-nodejs.git +asdf plugin add nodejs https://github.com/asdf-vm/asdf-nodejs.git ``` ## Installing the Postgres plugin @@ -21,17 +21,17 @@ $ asdf plugin add nodejs https://github.com/asdf-vm/asdf-nodejs.git Mac ```bash -$ brew install gcc readline zlib curl ossp-uuid +brew install gcc readline zlib curl ossp-uuid ``` Ubuntu ``` -$ sudo apt-get install build-essential libssl-dev libreadline-dev zlib1g-dev libcurl4-openssl-dev uuid-dev +sudo apt-get install build-essential libssl-dev libreadline-dev zlib1g-dev libcurl4-openssl-dev uuid-dev ``` 2. Install the plugin ``` -$ asdf plugin-add postgres +asdf plugin-add postgres ``` diff --git a/README.md b/README.md index 57b8098..bcd59ee 100644 --- a/README.md +++ b/README.md @@ -7,19 +7,19 @@ A starter app with Postgres, NestJS, and React IMPORTANT Windows users should setup WSL first before cloning. See [WSL_SETUP.md](/WSL_SETUP.md) This app is designed to used as a starting point for another application so you will want to clone the project into a folder that matches your app. Run ```bash -$ git clone git@github.com:dittonjs/NestStarterApp.git +git clone git@github.com:dittonjs/NestStarterApp.git ``` a Replace your app name with the name of your app, for example ```bash -$ git clone git@github.com:dittonjs/NestStarterApp.git SpyChat +git clone git@github.com:dittonjs/NestStarterApp.git SpyChat ``` Next, go create a remote repository in github (or gitlab, or bitbucket, it doesn't matter) for your new application. Finally, run ```bash -$ bash ./bin/setup_new_project.sh +bash ./bin/setup_new_project.sh ``` and follow the prompts. This script will link the repo to your new repo while maintaining a reference to the starter app repo. This way, if we make changes to the starter app repo, you can still get those changes. @@ -27,7 +27,7 @@ and follow the prompts. This script will link the repo to your new repo while ma To retrieve changes from the starter app run ```bash -$ git pull upstream main +git pull upstream main ``` ## Prerequisites ### VSCode @@ -47,13 +47,13 @@ Make sure your have navigated to the project directory in your terminal. ### Tool versions Install the tool versions by running ```bash -$ asdf install +asdf install ``` ### Install yarn We will use `yarn` instead of `npm` for package managment. To install yarn run ```bash -$ npm install -g yarn +npm install -g yarn ``` ### .env @@ -66,14 +66,14 @@ In your new `.env` file update the values for each key as you would like ### Dependencies To install the both server and client dependencies run ```bash -$ yarn # this is same thing as `yarn install` +yarn # this is same thing as `yarn install` ``` Notice that the `client` folder has its own `package.json` file and its own `node_modules`. If you add dependencies for the client make sure to `cd` into the `client` directory before doing `yarn add` ### Database This application uses Postgres. To setup the database run ```bash -$ yarn db:setup +yarn db:setup ``` This will create the database, run the migrations, and run the seeds for you. @@ -84,7 +84,7 @@ yarn db:migration:create AddContextToRoles # replace this name with a name that ``` Open that migration file and make the changes. Then, when you are ready ```bash -$ yarn db:migrate +yarn db:migrate ``` will run any pending migrations. @@ -97,7 +97,7 @@ If you make changes to the seeds file at `server/database/seeds.ts` the make sur To run the seeds ```bash -$ yarn db:seed +yarn db:seed ``` ### SSL @@ -111,19 +111,19 @@ USE_SSL=true Create a ssl key and certificate and place them in the root directory ```bash -$ openssl req -x509 -newkey rsa:4096 -keyout private-key.pem -out public-cert.pem -sha256 -nodes +openssl req -x509 -newkey rsa:4096 -keyout private-key.pem -out public-cert.pem -sha256 -nodes ``` Enter `US` for the country code. Where this key will only be used for development you can leave all of the rest of information blank. ## Running the app To start the server run ```bash -$ yarn start:dev +yarn start:dev ``` To start the client run ```bash -$ yarn client:watch +yarn client:watch ``` YOU NEED TO RUN EACH OF THESE COMMANDS IN A SEPARATE TERMINAL TAB / WINDOW @@ -137,13 +137,13 @@ On heroku.com create an account. If you don't have the heroku CLI installed you can install it by running. You should only need to do this once on each computer you are working on. ```bash -$ curl https://cli-assets.heroku.com/install.sh | sh +curl https://cli-assets.heroku.com/install.sh | sh ``` ### Login to CLI To log into the CLI run ```bash -$ heroku login +heroku login ``` and follow the prompts. After a while, you maybe be prompted to login again which is fine. @@ -175,16 +175,16 @@ All vars should be named the exact same as they are in the `.env` file. ### Link to Heroku You publish to Heroku using `git`. Run the following command to add the heroku remote ```bash -$ heroku git:remote -a +heroku git:remote -a ``` If your app name in Heroku was `spy-chat` then you would run ```bash -$ heroku git:remote -a spy-chat +heroku git:remote -a spy-chat ``` ## Deploying We finally made it! To deploy your app to Heroku run ```bash -$ git push heroku main +git push heroku main ``` and thats it!