Skip to content

Commit

Permalink
Add Local setup guide
Browse files Browse the repository at this point in the history
  • Loading branch information
gugzkumar committed Jan 1, 2020
1 parent 9bf3a5a commit ded4ecb
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 6 deletions.
12 changes: 8 additions & 4 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
59 changes: 58 additions & 1 deletion docs/setting-up-locally.md
Original file line number Diff line number Diff line change
@@ -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`

<details><summary>What just happened?</summary>
<p>
To be written
</p>
</details>

## 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

<details><summary>What just happened?</summary>
<p>
To be written
</p>
</details>

## 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`

<details><summary>What just happened?</summary>
<p>
To be written
</p>
</details>

## 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

<details><summary>What just happened?</summary>
<p>
To be written
</p>
</details>
2 changes: 1 addition & 1 deletion docs/setup.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down

0 comments on commit ded4ecb

Please sign in to comment.