TW Power Tools gRPC server and frontend.

Clone this repo:

Branches

  1. d2627a2 Add docker.io registry prefix to image names by Adrià Vilanova Martínez · 5 days ago main
  2. 3050d33 Stop saving trace-level logs to /tmp/envoy_info.log by Adrià Vilanova Martínez · 5 days ago
  3. 019a369 fix(deps): update dependency grpc-web to v1.5.0 by Renovate bot · 2 years, 9 months ago
  4. df6d036 fix(deps): update dependency google-protobuf to v3.21.2 by Renovate bot · 2 years, 9 months ago
  5. 8788c16 chore(deps): update dependency json5 to v1.0.2 by Renovate bot · 2 years, 9 months ago

TWPT-server

TWPT-server is the code for the TW Power Tools gRPC server and its frontend.

This repository is under active development, and is not ready yet for production.

Frontend

To serve the frontend for development, follow these instructions:

  1. Run docker-compose -f docker-compose.dev.yml up to start the gRPC API, database and Envoy proxy (which will translate gRPC-Web <-> gRPC).
  2. Run docker exec -i twpt-server_db_1 mysql -u root twpt < schema/common.sql and docker exec -i twpt-server_db_1 mysql -u root twpt < schema/kill-switch.sql.
  3. Run docker exec -it twpt-server_db_1 mysql -u root twpt and enter the following SQL sentence with your data to create the first authorized user: INSERT INTO KillSwitchAuthorizedUser (google_uid, email, access_level) VALUES ('', '{YOUR_EMAIL_ADDRESS}', 10);.
  4. Run docker-compose -f docker-compose.dev.yml restart.
  5. Run npm install.
  6. Run make serve.

Backend

You can run the backend for development purposes by running go run . in the //cmd/serve folder. You may also build its docker image to allow it to interact with the frontend (since it needs Envy (the gRPC-Web proxy) to translate between gRPC and HTTP requests).

Deploying

Use the docker-compose.yml file instead of docker-compose.dev.yml and follow steps 1-4 from the "frontend" section to spin up the backend.

For the frontend, run make deploy in the //frontend folder to deploy the frontend to Firebase.