- DotComChat (REFERENCE: WORKSHOP.md)
- Summarise the WORKSHOP.md in bullet points?
- Explain the project in bullet points?
- Summarise the Technical Details in bullet points?
- What all is needed for running the project in bullet points?
- What is MongoDB database and collection name, in bullet points? Copy -> notes.txt
- Which frontend file has the backend uri endpoint? Copy -> notes.txt
- CLI - Check if Copilot in the CLI is installed running
github-copilot-cli -V
- NO - Install Copilot in the CLI by running -
./scripts/install-copilot-cli.sh
- Run ??
- NO - Start Copilot in the CLI by running -
./scripts/start-copilot-cli.sh
- NO - Install Copilot in the CLI by running -
- Open -
code_copilot_cli_1
ORcode ./scripts/copilot_cli_1.sh
-> Explain -> Run -run_copilot_cli_1
OR./scripts/copilot_cli_1.sh
- ?? Check if node and npm is installed?
- ?? Check if Mongodb service running use service command?
- Open -
code_copilot_cli_2
ORcode ./scripts/copilot_cli_2.sh
-> Explain -> Run -run_copilot_cli_2
OR./scripts/copilot_cli_2.sh
- ?? Print first 10 Mongodb database sample_airbnb and collection listingsAndReviews
- CLI
- Split Terminal
backend_npm_start
&frontend_npm_start
OR In Foldersbackend
andfrontend
-npm start
first on backend and then on frontend.
- DotComChat (REFERENCE: WORKSHOP.md) -
- In Section Workshop's Different Developer Activities, summarise Activity 1 in bullet points?
- In Section Workshop's Different Developer Activities, Activity 1, summarise the fix / requirement for Activity 1 in bullet points?
- What are different Frontend React Paths available? Copy -> notes.txt
- What are different backend endpoints exposed and unexposed? Copy -> notes.txt
- Open -
code_copilot_cli_3
ORcode ./scripts/copilot_cli_3.sh
-> Explain -> Run -run_copilot_cli_3
OR./scripts/copilot_cli_3.sh
- ?? Get request to http://localhost:8080/api/model with query string search = url encoded UWS Brownstone Near Central Park and store the beautified response in file response.json
- ?? In response.json print the key id inside listingsAndReviews array
- CallOut - Database Model's id identified as "102995"
- Step - Open a new tab and copy the React App's URL. Then change the path to
/listings/102995
- Open -
code_copilot_cli_4
ORcode ./scripts/copilot_cli_4.sh
-> Explain -> Run -run_copilot_cli_4
OR./scripts/copilot_cli_4.sh
- ?? Get request to http://localhost:8080/api/model/102995 and store the beautified response in file listing.json
- Open -
code_copilot_cli_5
ORcode ./scripts/copilot_cli_5.sh
-> Explain -> Run -run_copilot_cli_5
OR./scripts/copilot_cli_5.sh
- ?? Put request to http://localhost:8080/api/model/102995 with JSON data {"name": "UWS Brownstone Prime"}
- Step - Refresh the tab React App's URL and the path to
/listings/102995
to see the updated name
- DotComChat (REFERENCE: WORKSHOP.md) - Can you list all the bullet points from Activity 2?
- CallOut - IP2Location to be used
- CallOut - Local Geo Location Database is available for this workshop
- CallOut - We already have put placeholder for you, under the
/backend/geolocation
to build the code and local geolocation database being available - IdeChat - Share example nodejs geo location packages?
- IdeChat - Does npm have packages using IP2LOCATION?
- IdeChat - From ip2location NodeJs - Query geolocation information from Local BIN database
- IdeChat - Share the link to npm ip2location-nodejs documentation - https://www.npmjs.com/package/ip2location-nodejs
- Step - IP2Location Developer Documentation - Query geolocation information from BIN database - https://ip2location-nodejs.readthedocs.io/en/latest/quickstart.html#query-geolocation-information-from-bin-database
- Step -
code_geoloc_test
OR Open the/backend/geolocation/test-logic.js
- CallOut - Geo Location File Path -
./geolocation/IP2LOCATION-LITE-DB3.BIN
- Step -
run_geoloc_test
OR run the/backend/geolocation/test-logic.js
- Step -
code_backend_geo_IP2Loc
OR Open the\backend\geolocation\IP2Location.js
Search in the fileSTART:TODO
, and select the code block below it- CallOut - Keep the file
test-logic.js
open in a Tab, for appropriate context to built - DevPrompt - //Find the geolocation using the IP input from the local file, and return ip and city
- Dev
Window+I
Cmd+I
->/doc
- CallOut - Keep the file
- Step -
code_backend_controller
OR Open the/backend/app/controllers\model.controller.js
Search in the fileSTART:TODO
, and select the code block below it- Dev
Window+I
Cmd+I
->/explain
- Dev
- IdeChat (REFERENCE: WORKSHOP.md) - Which frontend file has the backend uri endpoint?
- Step -
code_frontend_http-common
OR Open/frontend/src/http-common.js
- Step - Uncomment and pass the different location's "x-forwarded-for-ip" headers to the backend
- Step - Refresh the React App's URL to see if you seeing Geo Location based listing
- Open -
code_branch_push
ORcode ./scripts/git_branch_push.sh
-> Explain -> Run -run_branch_push
OR./scripts/git_branch_push.sh
- Create a new branch and push to Origin - DotComPR - Let us run
/summary
to the GitHub Copilot generate the summary for us out of the box
- Step - Inside
/backend
folder, runnpm test
to show testing running - CallOut -
code_backend_routes
OR Open the\backend\app\routes\model.routes.js
- Search and highlight
// Retrieve a single Listing with id
and explain we need to test id102995
- Search and highlight
// Retrieve all Listings
and explain Geo Location Endpoint
- Search and highlight
- Step
code_backend_tests
OR Open the\backend\test\endpoint.test.js
filerun_backend_tests
OR Run insidebackend
folder -npm test
- Step - Test Case 1: Check if id=102995, has been correctly updated
- Step - Search -
//Test Case 1 - TODO:
- Dev -
Window+I
Cmd+I
->/tests unit test - GET /api/model/{id} where id=102995, parse JSON response.text, and check name="UWS Brownstone Prime"
- Step -
run_backend_tests
OR Run insidebackend
folder -npm test
- Step - Search -
- Step - Test Case 2: Geo Location Check
- Step - Search -
//Test Case 2 - TODO:
- Dev -
Window+I
Cmd+I
->/tests unit test - GET /api/model/ set x-forwarded-for-ip header 8.210.96.219, parse JSON response.text, and loop through array listingsAndReviews
- Dev -
//expect to check listing.address for market=Hong Kong
- Step -
run_backend_tests_done
OR Run insidebackend
folder -npm test
- Step - Search -