From b2c2fa5c8f20208c2350609aa2bfa1f1e8daa6b0 Mon Sep 17 00:00:00 2001 From: Brandon Yang Date: Wed, 16 Apr 2025 14:29:35 -0400 Subject: [PATCH 1/3] fixing readme, added and got rid of some documentation --- README.md | 29 +++-------------------------- 1 file changed, 3 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index df2792f..c630769 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,6 @@ ### **How to Set up the Local Development Enviroment** 1. Download relevant repos: ``` -git clone https://github.com/mirrulations/mirrulations-website.git git clone https://github.com/mirrulations/API.git ``` - Clone the query functions in the API repo by running `git submodule update --init` @@ -24,32 +23,14 @@ git clone https://github.com/mirrulations/API.git - This will remake the symlink from docker to CLI - We think this was caused by the fix to the docker malware issue earlier in the semester. -3. Install the prerequisites npm libraries -``` -npm install dotenv vite -npm install react react-dom react-router-dom -npm install bootstrap -npm install -D @vitejs/plugin-react -``` -4. Launch the API, navigate to the API repo and run the following commands +3. Launch the API, navigate to the API repo and run the following commands ``` sam build sam local start-api ``` If you make changes to template.yaml, run sam validate to check for errors and sam build to implement the changes. - Take note of your api gateway link for later, you can see it in the output under “Mounting ApiFunction at {GATEWAY_URL_HERE} [GET, OPTIONS]” - -5. Launch the Website -- Create a file named “.env” - - Type “VITE_GATEWAY_API_URL={GATEWAY_URL}” - - Your Gateway URL is the output from the last step, it might look something like “http://127.0.0.1:3000/dummy” -- Save the file and run this command -``` -npm run dev -``` - ### How to Launch just the API - If any changes have been made to `template.yaml`, run `sam validate` to check for errors. - Make sure to install [Docker](https://www.docker.com/get-started/) @@ -88,12 +69,8 @@ The `samconfig.toml` file stores configuration parameters for SAM CLI deployment - Use `sam delete` when done to avoid leaving resources up, which might incur costs. ## Running Tests -- Make a python virtual environment. - - `python -m venv .venv` - - `source ./.venv/bin/activate` - - `pip install -r requirements.txt` -- cd to endpoints specifically and run `python -m pytest ../tests/handler_test.py` - - I do not know why the tests don't work in other directories, here's a [stackoverflow link](https://stackoverflow.com/questions/45154583/pytest-running-from-parent-directory) that might have the answers. +- cd to the root specifically and run `pylint --rcfile=./tests/.pylintrc $(git ls-files '*.py') + - Here's a [stackoverflow link](https://stackoverflow.com/questions/45154583/pytest-running-from-parent-directory) that might help you if you get stuck. This README has been adapted to utilize the automated deployment features of AWS SAM, making it easier and faster to manage your deployments. From e9e3d3f390c440e0520b0e422879cf3b50f466cc Mon Sep 17 00:00:00 2001 From: Brandon Yang Date: Mon, 21 Apr 2025 13:45:30 -0400 Subject: [PATCH 2/3] added back the pytest --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index c630769..34970b5 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,11 @@ The `samconfig.toml` file stores configuration parameters for SAM CLI deployment - Use `sam delete` when done to avoid leaving resources up, which might incur costs. ## Running Tests +- Make a python virtual environment. +- `python -m venv .venv` +- `source ./.venv/bin/activate` +- `pip install -r requirements.txt` +- cd to endpoints specifically and run `python -m pytest ../tests/handler_test.py` - cd to the root specifically and run `pylint --rcfile=./tests/.pylintrc $(git ls-files '*.py') - Here's a [stackoverflow link](https://stackoverflow.com/questions/45154583/pytest-running-from-parent-directory) that might help you if you get stuck. From ede2ea041dfcb775f8231d063f1c3f952a711ca1 Mon Sep 17 00:00:00 2001 From: Brandon Yang Date: Mon, 21 Apr 2025 14:09:57 -0400 Subject: [PATCH 3/3] fixing the pytest section --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 34970b5..6bf6e75 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,7 @@ The `samconfig.toml` file stores configuration parameters for SAM CLI deployment - `pip install -r requirements.txt` - cd to endpoints specifically and run `python -m pytest ../tests/handler_test.py` - cd to the root specifically and run `pylint --rcfile=./tests/.pylintrc $(git ls-files '*.py') - - Here's a [stackoverflow link](https://stackoverflow.com/questions/45154583/pytest-running-from-parent-directory) that might help you if you get stuck. +- Here's a [stackoverflow link](https://stackoverflow.com/questions/45154583/pytest-running-from-parent-directory) that might help you if you get stuck. This README has been adapted to utilize the automated deployment features of AWS SAM, making it easier and faster to manage your deployments.