Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expose local web server using ngrok #43

Merged
merged 11 commits into from
Jun 7, 2024
Merged

expose local web server using ngrok #43

merged 11 commits into from
Jun 7, 2024

Conversation

leozhang14
Copy link
Collaborator

Notion Ticket Link:

https://www.notion.so/uwblueprintexecs/e2d9163a2f8c436bbb36172066753d40?v=9518aa1af04b4478b3d5e840f4ffcc7f&p=850e4246e7d74065826f1de8203d5457&pm=s

Summary:

  • Added ngrok implementation so devs have a public URL to hit
  • Tested backend endpoints with cURL
  • Will install ngrok on docker compose up --build
  • Devs must register for their own ngrok account and add their authtoken as an environment variable
  • Run ngrok http http://localhost:5001 to open the ngrok interface

Expected result:

  1. Rebuilding docker container and running docker compose up --build
  2. Run ngrok http http://localhost:5001 to open the ngrok interface (public URL logged in terminal)
  3. Public URL should be able to be accessed with cURL GET and POST requests

Ongoing/Incomplete:

  • Still need to do a thorough cURL testing of the endpoints (ik how to do them now - will be done by june 5th, 2024)
  • Also need to figure out authorization for hitting endpoints

Questions/Notes for Matt:

  • In the Dockerfile in the backend / typescript folder, I changed the EXPOSE line to expose 5001 instead of 5000 (line 27)
  • It was previously exposing 5000, but that didn't seem to have an effect, so I just changed it to 5001.
  • I set most things related to the backend to port 5001 instead of 5000 (see changes)
  • I'm not sure how to run a linter (see checklist below)?

Checklist

  • [y] My PR name is descriptive and in imperative tense
  • [y] My commit messages are descriptive and in imperative tense. My commits are atomic and trivial commits are squashed or fixup'd into non-trivial commits
  • [?] I have run the appropriate linter(s)
  • [y] I have requested a review from the PL, as well as other devs who have background knowledge on this PR or who will be building on top of this PR

@leozhang14 leozhang14 requested a review from mat-ng June 4, 2024 02:43
@mat-ng
Copy link
Collaborator

mat-ng commented Jun 5, 2024

Great work! I tested it out with ngrok and the port forwarding works! Let me know if you guys need any help with the remaining work you mentioned (API testing, etc.). I left a few other PR comments for you guys to address.

Additionally, I'll answer some of the questions/notes you left for me:

In the Dockerfile in the backend / typescript folder, I changed the EXPOSE line to expose 5001 instead of 5000 (line 27)
It was previously exposing 5000, but that didn't seem to have an effect, so I just changed it to 5001.

Thanks for doing that. You're right, the EXPOSE instruction just helps document which port the app intends to use (for documentation and other purposes), but doesn't actually publish to the port. As such, you're correct about it not "affecting anything" and it was good to change it to 5001 so it's consistent throughout our repo.

I set most things related to the backend to port 5001 instead of 5000 (see changes)

Thanks for making this change too. I remember from the first work session that a good number of people had issues with their port 5000, so we can just switch to running our backend on port 5001 for convenience reasons.

I'm not sure how to run a linter (see checklist below)?

In our first work session, remember we ran a linter that checked our repo for formatting, etc. (see here). Just run that linter again to ensure that your changes don't have any additional linting errors. You can ignore the existing linting errors caused by other files in the repo.

@leozhang14
Copy link
Collaborator Author

  1. Ran the linter (which is why some of the unrelated files got minor changes in indentation, spacing, etc.)
  2. Deleted the ngrok container in docker-compose.yml
  3. Deleted .DS_Store file

Copy link
Collaborator

@mat-ng mat-ng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice, this is going to be massively helpful for some upcoming tickets!

docker-compose.yml Outdated Show resolved Hide resolved
.DS_Store Outdated Show resolved Hide resolved
@leozhang14 leozhang14 merged commit bb3a4a3 into main Jun 7, 2024
@leozhang14 leozhang14 deleted the ngrok branch June 7, 2024 01:34
leozhang14 added a commit that referenced this pull request Jun 11, 2024
* Integrated Ngrok

Adjusted docker-compose.yml to run ngrok using my personal authentication token

* add environment variable for ngrok authtoken

* Add ngrok set-up instructions in README.md

* updating ngrok authtoken as variable / exposing port 5001 for backend

* environment variable for ngrok authtoken instead of hardcoding

* typo

* update readme

* delete ngrok container

* Delete .DS_Store

* run linter

---------
leozhang14 added a commit that referenced this pull request Jul 9, 2024
* basic table and filter created w/ chakra

Co-authored-by: Jordan Kok Ee Hsin <[email protected]>

* expose local web server using ngrok (#43) (#45)

* Integrated Ngrok

Adjusted docker-compose.yml to run ngrok using my personal authentication token

* add environment variable for ngrok authtoken

* Add ngrok set-up instructions in README.md

* updating ngrok authtoken as variable / exposing port 5001 for backend

* environment variable for ngrok authtoken instead of hardcoding

* typo

* update readme

* delete ngrok container

* Delete .DS_Store

* run linter

---------

* basic table and filter created w/ chakra

Co-authored-by: Jordan Kok Ee Hsin <[email protected]>

* basic table and filter created w/ chakra

Co-authored-by: Jordan Kok Ee Hsin <[email protected]>

* created table and filtering using chakra

* adding navbar template

* installing Tailwind + updating Navbar template to be closer to Figma design + routing for Navbar (temp)

* uncommenting subLabel - please note .eslintrc.js rules ignoring require-default-props,  no-unused-prop-types, and react-in-jsx-scope

* center navbar components + improve spacing + rename template names to don efficace specific fields

* Navbar linking/routing + Updating navbar to be like Figma design

* fixed navbar spacing and link color - reorganized/simplified dashboard/donations/account stack

* adding comments + changing Don Efficace. text to a link to homepage

* bottom border early

* adding tab indicator, reformatted dashboard/donations/acc-mgmt into tabs instead of boxes

* making tab indicator responsive + adding rules back to eslintr (reverting previous changes) + small touch ups to navbar + deleting tailwind config as it is unused

* adding browserrouter to layout.tsx

* touch up

* adding linter changes

* fixing merge conflicts with main based on pr comments from Matt

* merge conflict changes

* fixing merge conflicts

* fix app.tsx routes

* fix merge conflicts

---------

Co-authored-by: pahu2353 <[email protected]>
Co-authored-by: Jordan Kok Ee Hsin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants