remove $ from commands for easy copy paste

This commit is contained in:
Joseph Ditton 2022-03-01 10:02:11 -07:00
parent fc4a758426
commit 7b36cf4e02
2 changed files with 23 additions and 23 deletions

View File

@ -1,7 +1,7 @@
# ASDFVM Setup # ASDFVM Setup
1. Run 1. Run
```bash ```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. 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 ## Installing the NodeJS plugin
1. Install the plugin 1. Install the plugin
```bash ```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 ## Installing the Postgres plugin
@ -21,17 +21,17 @@ $ asdf plugin add nodejs https://github.com/asdf-vm/asdf-nodejs.git
Mac Mac
```bash ```bash
$ brew install gcc readline zlib curl ossp-uuid brew install gcc readline zlib curl ossp-uuid
``` ```
Ubuntu 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 2. Install the plugin
``` ```
$ asdf plugin-add postgres asdf plugin-add postgres
``` ```

View File

@ -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) 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 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 ```bash
$ git clone git@github.com:dittonjs/NestStarterApp.git <YourAppName> git clone git@github.com:dittonjs/NestStarterApp.git <YourAppName>
``` ```
a a
Replace your app name with the name of your app, for example Replace your app name with the name of your app, for example
```bash ```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. Next, go create a remote repository in github (or gitlab, or bitbucket, it doesn't matter) for your new application.
Finally, run Finally, run
```bash ```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. 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 To retrieve changes from the starter app run
```bash ```bash
$ git pull upstream main git pull upstream main
``` ```
## Prerequisites ## Prerequisites
### VSCode ### VSCode
@ -47,13 +47,13 @@ Make sure your have navigated to the project directory in your terminal.
### Tool versions ### Tool versions
Install the tool versions by running Install the tool versions by running
```bash ```bash
$ asdf install asdf install
``` ```
### Install yarn ### Install yarn
We will use `yarn` instead of `npm` for package managment. To install yarn run We will use `yarn` instead of `npm` for package managment. To install yarn run
```bash ```bash
$ npm install -g yarn npm install -g yarn
``` ```
### .env ### .env
@ -66,14 +66,14 @@ In your new `.env` file update the values for each key as you would like
### Dependencies ### Dependencies
To install the both server and client dependencies run To install the both server and client dependencies run
```bash ```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` 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 ### Database
This application uses Postgres. To setup the database run This application uses Postgres. To setup the database run
```bash ```bash
$ yarn db:setup yarn db:setup
``` ```
This will create the database, run the migrations, and run the seeds for you. 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 Open that migration file and make the changes. Then, when you are ready
```bash ```bash
$ yarn db:migrate yarn db:migrate
``` ```
will run any pending migrations. 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 To run the seeds
```bash ```bash
$ yarn db:seed yarn db:seed
``` ```
### SSL ### SSL
@ -111,19 +111,19 @@ USE_SSL=true
Create a ssl key and certificate and place them in the root directory Create a ssl key and certificate and place them in the root directory
```bash ```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. 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 ## Running the app
To start the server run To start the server run
```bash ```bash
$ yarn start:dev yarn start:dev
``` ```
To start the client run To start the client run
```bash ```bash
$ yarn client:watch yarn client:watch
``` ```
YOU NEED TO RUN EACH OF THESE COMMANDS IN A SEPARATE TERMINAL TAB / WINDOW 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. 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 ```bash
$ curl https://cli-assets.heroku.com/install.sh | sh curl https://cli-assets.heroku.com/install.sh | sh
``` ```
### Login to CLI ### Login to CLI
To log into the CLI run To log into the CLI run
```bash ```bash
$ heroku login heroku login
``` ```
and follow the prompts. After a while, you maybe be prompted to login again which is fine. 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 ### Link to Heroku
You publish to Heroku using `git`. Run the following command to add the heroku remote You publish to Heroku using `git`. Run the following command to add the heroku remote
```bash ```bash
$ heroku git:remote -a <your app name> heroku git:remote -a <your app name>
``` ```
If your app name in Heroku was `spy-chat` then you would run If your app name in Heroku was `spy-chat` then you would run
```bash ```bash
$ heroku git:remote -a spy-chat heroku git:remote -a spy-chat
``` ```
## Deploying ## Deploying
We finally made it! To deploy your app to Heroku run We finally made it! To deploy your app to Heroku run
```bash ```bash
$ git push heroku main git push heroku main
``` ```
and thats it! and thats it!