diff --git a/README.md b/README.md index 55cbb84..189fb4b 100644 --- a/README.md +++ b/README.md @@ -4,13 +4,13 @@ This repo contains a Python Flask web app that will perform live translations fo ## Fork this repo to use -image +image # Build and run locally ``` -virtualenv .app # Create a virtual environment (do this just once in the directory) -source .app/bin/activate # Start virtual environment (do this every time you use a new terminal tab in this directory) +python3 -m venv venv # Create a virtual environment (do this just once in the directory) +source venv/bin/activate # Start virtual environment (do this every time you use a new terminal tab in this directory) ``` ## Installing Dependencies @@ -39,12 +39,12 @@ See the code in `src/translator.py` for the full list of hard-coded dummy transl # Deploying this service to Azure -Create a new Web App and deploy to Azure. Recall the [steps you used to deploy NodeBB to Azure (section "Create a Web App")](https://docs.google.com/document/d/1cC95F2752ZNmAJ_VPjZmEd8UoUhBi7-lQElx6OaZFd0). The process to deploy the translator service is similar, with a few differences: +Create a new Web App and deploy to Azure. Recall the [steps you used to deploy NodeBB to Azure (section "Create a Web App")](https://docs.google.com/document/d/19nnfaVRHDe4-y5zAK9FcPLxEvhuli81sj3FesTLhO3g/edit?usp=sharing). The process to deploy the translator service is similar, with a few differences: 1. You do not need a database / Redis cache, just create a new Web App. 2. For the runtime stack, choose "Python 3.10" instead of NodeJS. 3. App Service Plan: Basic B1 should be sufficient -4. On the "Deployment" tab, make sure to enable "Basic Authentication" at the bottom, then enable "Continuous Deployment" at the top, and connect to your fork of this GitHub repository. You can preview the workflow file, which should look similar to [this file](https://github.com/CMU-313/translator-service/blob/f24/.github/workflows/sample-build.yml) but have your own "app-name" and "publish-profile" at the bottom of the file. +4. On the "Deployment" tab, make sure to enable "Basic Authentication" at the bottom, then enable "Continuous Deployment" at the top, and connect to your fork of this GitHub repository. You can preview the workflow file, which should look similar to [this file](https://github.com/CMU-17313Q/translator-service/blob/f24/.github/workflows/sample-build.yml) but have your own "app-name" and "publish-profile" at the bottom of the file. 5. Once you create the resource, the deployment should ideally work out-of-the-box. Azure can detect that your repo is a Flask app and run it. ## Testing your deployment @@ -56,12 +56,12 @@ Once you have deployed this service, you can access the following link `https:// Now that you have a dummy translator service deployed, you can integrate it into NodeBB by allowing new posts to be translated at creation time and to display a "Translate" button for such posts. To save you the trouble, we are providing the code changes required for this UI. You need two sets of changes, in the back-end (NodeBB repo) and in the front-end (theme repo): -1. https://github.com/CMU-313/NodeBB/compare/f24...f24-p4 -2. https://github.com/CMU-313/nodebb-theme-harmony/compare/f24...f24-p4 +1. https://github.com/CMU-17313Q/NodeBB/compare/f24...f24-p4 +2. https://github.com/CMU-17313Q/nodebb-theme-harmony/compare/f24...f24-p4 You can merge this commit directly if you know how to set up a new remote and perform cherry picking; or you can just look at the diffs above and copy+paste the changes carefully into your own NodeBB repos. These are provided only as suggestions but you are welcome to do something else. -Note that you will have to edit the translator service API URL in your integration: https://github.com/CMU-313/NodeBB/blob/f24-p4/src/translate/index.js#L7 +Note that you will have to edit the translator service API URL in your integration: https://github.com/CMU-17313Q/NodeBB/blob/f24-p4/src/translate/index.js#L7 ## Testing the integration