From ded4ecb620641a960032dc5fd6fc6b6481bbfee3 Mon Sep 17 00:00:00 2001 From: Gagan Tunuguntla Date: Wed, 1 Jan 2020 03:40:27 -0500 Subject: [PATCH] Add Local setup guide --- docs/getting-started.md | 12 +++++--- docs/setting-up-locally.md | 59 +++++++++++++++++++++++++++++++++++++- docs/setup.md | 2 +- 3 files changed, 67 insertions(+), 6 deletions(-) diff --git a/docs/getting-started.md b/docs/getting-started.md index 546a151..bb7d49d 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -2,13 +2,17 @@ This document and the following ones will help you set up Cheet Sheet. -### Setup -Click [here](/docs/setup.md) to +### Preliminary Setup +Click [here](/docs/setup.md) to read the necessary prep to run the app locally and deploy it AWS. -### Run Locally +### Set Up and Run Locally +Click [here](/docs/set-up-locally.md) to learn how to setup and run the app on your local machine. This is good for development and testing. -### Deploy to AWS +### Set Up and Deploy to AWS +Click [here](/docs/set-up-remote.md) to learn how to setup and deploy the app to the cloud so that you and others can use it in real life. ### Architecture Overview ### Environment Variable Glossary + +### Questions and Answers diff --git a/docs/setting-up-locally.md b/docs/setting-up-locally.md index cd84bee..84b7af3 100644 --- a/docs/setting-up-locally.md +++ b/docs/setting-up-locally.md @@ -1 +1,58 @@ -# Setting Up Cheet Sheet On Your Local Machine +# Setting Up And Running Cheet Sheet On Your Local Machine + + +## Create Your infrastructure.env File + +1. From the .utils folder run `node main.js create-infra-env` +2. Follow the guided prompt to create `infrastructure.env` +3. Confirm you now have a file in your root folder called `infrastructure.env` + +
What just happened? +

+ To be written +

+
+ +## Build AWS Infrastructure + +1. Run `docker-compose -f docker-compose.deploy.infrastructure.yml up --build -d` +1. Run `docker container exec -it serverless-aws-cdk sh` +1. Run `npm run build` +1. Run `cdk bootstrap` (If you've done this before you don't have to do it again) +1. Run `cdk diff CheetSheetInfrastructureStack-local` to preview what will be deployed +1. Run `cdk deploy CheetSheetInfrastructureStack-local` to begin deployment and say yes to any prompts +1. Once it ran confirm in AWS Cloudformation you have a new stack called `CheetSheetInfrastructureStack-local` with the status `CREATE_COMPLETE` +1. Type in exit to leave the infrastructure deploy environment +1. Run `docker-compose -f docker-compose.deploy.infrastructure.yml down -v` to take down the infrastructure deploy environment + +
What just happened? +

+ To be written +

+
+ +## Create Your .env File +1. From the .utils folder run `node main.js create-infra-env` +1. Follow the guided prompt to create `.env` from `infrastructure.env` +1. Confirm you now have a file in your root folder called `.env` + +
What just happened? +

+ To be written +

+
+ +## Running the App + +1. Now you have everything you need to run the app +1. Run `docker-compose up --build -d` +1. Wait for a minute or two after the command finishes running +1. You can now see the site on http://localhost:4200 :beers: +1. Code changes you now make to the api and ui should happen real time to the app now +1. Run `docker-compose down -v` to take down the app + +
What just happened? +

+ To be written +

+
diff --git a/docs/setup.md b/docs/setup.md index 12f749d..2b89b66 100644 --- a/docs/setup.md +++ b/docs/setup.md @@ -1,4 +1,4 @@ -# Setup and Preparation +# Preliminary Setup and Preparation This is all the preliminary things you will need to do before running the app on your computer or deploying it to AWS.