{"id":20037839,"url":"https://github.com/openedx/frontend-app-learner-portal-enterprise","last_synced_at":"2025-05-05T06:31:38.606Z","repository":{"id":37790128,"uuid":"210382969","full_name":"openedx/frontend-app-learner-portal-enterprise","owner":"openedx","description":"Enterprise Learner Portal","archived":false,"fork":false,"pushed_at":"2024-04-12T23:26:55.000Z","size":18614,"stargazers_count":10,"open_issues_count":36,"forks_count":17,"subscribers_count":66,"default_branch":"master","last_synced_at":"2024-04-13T20:34:22.325Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/openedx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2019-09-23T14:57:34.000Z","updated_at":"2024-04-15T07:35:06.420Z","dependencies_parsed_at":"2024-03-18T18:52:27.282Z","dependency_job_id":"5fb6ebaf-e5de-4b15-a863-a8d2c4889ca2","html_url":"https://github.com/openedx/frontend-app-learner-portal-enterprise","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openedx%2Ffrontend-app-learner-portal-enterprise","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openedx%2Ffrontend-app-learner-portal-enterprise/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openedx%2Ffrontend-app-learner-portal-enterprise/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openedx%2Ffrontend-app-learner-portal-enterprise/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openedx","download_url":"https://codeload.github.com/openedx/frontend-app-learner-portal-enterprise/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224428808,"owners_count":17309588,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T10:23:16.122Z","updated_at":"2024-11-13T10:23:16.760Z","avatar_url":"https://github.com/openedx.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# frontend-app-learner-portal-enterprise\n\n![Build Status](https://github.com/openedx/frontend-app-learner-portal-enterprise/actions/workflows/ci.yml/badge.svg)\n\n# Purpose\nThe edX learning platform's frontend for enterprise learners.\n\n# Getting Started\n\n## Setup for development\n\nEnsure you have gone through [Onboarding for devs](https://openedx.atlassian.net/wiki/spaces/ENG/pages/12550298/Developer+Onboarding)\n\nClone this repo: `git clone https://github.com/openedx/frontend-app-learner-portal-enterpise.git`\n\nInstall nodejs (using nvm maybe a good idea to be able to switch node versions and because there is an .nvmrc file that will be usable by nvm)\n\nTo run the project, first install dependencies\n\n`$ nvm use` # will install/setup node needed for this project. Install the specified version (nvm Will help you do that)\n`$ npm i`   # will install deps\n\nthen, start the dev server:\n\n`$ npm start`\n\nVisit http://localhost:8734\n\nAt this point, it will ask you to login. Use the user indicated in devstack (edx@example.com, edx). When logged in, expect to see a 404 since we are not setup.\n\nOur goal is to setup a enterprise customer, obtains its slug, then visit it such as http://localhostL8734/{enterprise_slug}\n\nNow quickly check the `.env.development` file for which services are used by the application. e.g. `LMS_BASE_URL='http://localhost:18000'` . We will get back to this.\n\n\n## Serving production builds\n\nDuring production builds, the NPM script ``npm run build`` is executed, which runs the production Webpack configuration (``webpack.prod.config.js``) to generate output files in the ``dist`` directory. However, these output files cannot be loaded directly into the browser. Instead, to preview a production build locally, these output files must be served via a server that can associate any URL route to the ``index.html`` entry-point of the application. The ``@openedx/frontend-build`` package supports a ``serve`` command, which runs the generated production output from Webpack with a Node.js Express server.\n\nTo serve a production build, the build must include the appropriate environment variables. The custom ``webpack.prod.config.js`` file in this project attempts to load all environment variables configured via the Git-ignored ``.env.private`` file, such that the production build can point to localhost URLs, etc.\n\nRelevant commands:\n* ``npm run serve``: Serves the output files from the ``dist`` directory on the ``PORT`` environment variable defined in the ``.env.development`` file.\n* ``npm run build:serve``: Executes ``npm run build``, followed by serving those generated assets in one command.\n* ``npm run build:with-theme:serve``: Executes ``npm run build:with-theme`` (i.e., utilizes custom brand package), followed by serving those generated assets in a single command.\n\n## Setup test users and data\n\nAn enterprise portal will need a couple of roles: The Enterprise customer, and at least one learner account.\n\nNext we will setup a `test-enterprise` customer who will have learners associated with it (Details at [The Enterprise management commands](https://github.com/openedx/edx-enterprise/blob/master/enterprise/management/commands/seed_enterprise_devstack_data.py#L47)):\n\n - Ensure the Enterprise Integration flag is enabled in devstack [see this link](https://github.com/openedx/edx-platform/blob/0e2b612c1fb4f3e385f3004801aa5b5ed0221eda/lms/envs/devstack.py#L331). Set the flag `ENABLE_ENTERPRISE_INTEGRATION` to True if it isn't already\n - From the devstack directory, restart lms using `make lms-restart` for applying changes\n - Seed test data:\n   - Go into the lms shell:\n   ```$ cd \u003cdevstack_dir\u003e\n      $ make lms-shell\n      $ ./manage.py lms seed_enterprise_devstack_data\n   ```\n - Go to http://localhost:18000/admin/enterprise/ and login as edx/edx\n - If you can see an `Enterprise` section in the admin page you are all set so far, otherwise stop and ask someone!\n - Next, ensure the Learner portal is enable for this Enterprise user:\n    - Visit http://localhost:18000/admin/enterprise/enterprisecustomer/\n    - Click on 'Test-enterprise' customer\n    - Check the box `Enable Learner Portal` and hit `Save`\n\n\n## Get familiar with learner and customer accounts\n\nIn this section you will:\n * Locate the enterprise customer test-enterprise in the Django admin page for enterprise\n * Learn how to navigate to the admin portal for that customer and view learner accounts setup during previous steps\n\n* Visit http://localhost:18000/admin/enterprise/ : the Django admin portal for enterprise\n* Login as edx/edx\n* Visit the `Enterprise Customers` link, it should be http://localhost:18000/admin/enterprise/enterprisecustomer/\n    * Locate the `slug` for the customer named 'Test enterprise'\n    * This is probably `test-enterprise`\n    * The `slug` is used as a url path to visit the enterprise portal for this customer, more on that later\n* Now click on the `Test Enterprise` user link\n* Click on `Manage learners` to view learner accounts\n* This page should list at least one learner account like test-enterprise_learner_1@example.com (username), password is the same as `edx` user\n\n\n\n## Use learner portal with the edx-enterprise stack\n\n* Log out of any users if you logged in previously, or use a new incognito window, and browse to http://localhost:8734/test-enterprise\n* The `test-enterprise`, you will note, is the slug for this enterprise customer\n* Login as a learner, using `test-enterprise_learner_1@example.com` account, you may need to re-browse to page http://localhost:8734/test-enterprise/\n* You can now go to 'Find a Course' and enroll in courses\n\nYou are now in the Learner portal for the enterpriser customer `Test Enterprise`, as a learner!\n\n## Next up: enroll one or more learners into your own course!\n\nIt is very useful to create multiple courses and enroll the learners into them for testing\n\nFor this, an easy way is to use the Studio! Usually at http://localhost:18010\n\n* Once there, create a course using the Create Course button\n* Once course is created, click 'View Live' to see the course\n* Grab the course id from the url which will be similar to: http://localhost:18010/course/course-v1:testinguniversity+cs111111+summer2020\n  * In this case the course id is `course-v1:testinguniversity+cs111111+summer2020`\n* Now use the `Manage learners` page described in an earlier section, to enroll one or more learners into this course! See [get-familiar-with-learner-and-customer-accounts](#get-familiar-with-learner-and-customer-accounts) for how to do this.\n\n## Setup enterprise stack for local changes\n\nYou need this, if you need to make changes to the API endpoints or anything else in edx-enterprise project\n\nWe have edx-enterprise Django module running inside of the LMS (which is started by devstack). Refer to [Devstack Doc](https://github.com/openedx/devstack) for details. This is what serves endpoints used by the application. To make changes, you will replace that available install of edx-enterprise with your local version\n\n* Setup devstack if not already and at least have the `lms` service running. Typically cd'ing to the devstack folder, and running `make dev.up` or `make dev.nfs.up` will do it\n* Ensure you can browse to LMS at least, http://localhost:18000\n\n* Sync edx-enterprise into the src/ folder of your work folder (e.g. ~/work/src/edx-enterprise)\n* Ensure this env var is set in your env for the docker mount to be located correctly, e.g.,: `DEVSTACK_WORKSPACE=/Users/$USER/work` , in your shell config file\n* Either start new shell or run `exec \"$SHELL\"` for changes to take effect in the shell\n* Start backend services needed (refer to .env.development file). Refer to [Devstack Doc](https://github.com/openedx/devstack) for details\n\nIf all worked you should be able to navigate to http://localhost:18000/admin/enterprise/\nBut wait, it won't work yet. As long as you get some reasonable response here, you are good (probably a login page).\n\n\n#### Making changes to edx-enterprise stack locally\n\nMake any changes in edx-enterprise stack then\n\n* In your devstack folder run\n  ```\n  $ make lms-shell\n  $ pip install -e /edx/src/edx-enterprise\n  $ exit # back to regular shell\n  ```\n  This will uninstall the published edx-enterprise package and instead install your local copy from src.\n\n* Now any changes you make to edx-enterprise should reflect your changes\n* If you do not see your changes, restart lms and wait some time:\n  ```\n  $ make lms-restart\n  ```\n\n### Presubmission\n\nAlways run `npm run lint` before submission. We may want a precommit hook at some point. To fix lint issues, run `npm run lint -- --fix`\n\n### Testing\n\nTesting is supported with Jest and Enzyme. To run tests, use:\n\n`npm test`\n\n### Debugging\n\n#### With built-in VSCode embedded debugger\n\nThis is nice if you want to use VScode built in debugger and also make changes and reload and try again.\n\nIn VSCode, click on the Debug button to the left toolbar\n\nGo to add configuration and select type 'chrome'\n\nVScode will generate a file in .vscode/launch.json that looks like this, edit it as shown to your desired url\n\n```\n{\n    // Use IntelliSense to learn about possible attributes.\n    // Hover to view descriptions of existing attributes.\n    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387\n    \"version\": \"0.2.0\",\n    \"configurations\": [\n        {\n            \"type\": \"pwa-chrome\",\n            \"request\": \"launch\",\n            \"name\": \"Launch Chrome against localhost\",\n            \"url\": \"http://localhost:8734/test-enterprise\",\n            \"webRoot\": \"${workspaceFolder}\"\n        }\n    ]\n}\n```\n\nSave this file. It is already gitignore so no worries about accidental checkin.\n\n\nNow you can just hit the run button that says 'Launch Chrome ...' and you can now put breakpoints in your code and get embedded VSCode debugging! \n\nYou can create more configs later if you want more than one url (such as different enterprise slug) to test with.\n\n\n#### With chrome\n\nJust fire up chrome devtools as usual and put breakpoints! You can also edit directly from chrome devtools by enabling local folder support.\n\nin brief:\n\nnpm run debug-test \n\nThen chrome://inspect in chrome along with debugger in the code to trigger a breakpoint?\n\n### Routes\n\nThis micro-frontend application consists of the following URL routes:\n\n| Route                                                                  | Description                                                                                                                                                                                                                                                                                             |\n|------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| http://localhost:8734/                                                 | The main entry point for the Enterprise Learner Portal. Detects which enterprise(s) you're linked to and redirects you to the appropriate dashboard page for a specific enterprise.                                                                                                                     |\n| http://localhost:8734/:enterpriseSlug                                  | The dashboard page for a specific enterprise customer. Displays all course enrollments for a learner associated with that enterprise.                                                                                                                                                                   |\n| http://localhost:8734/:enterpriseSlug/search                           | The search page for a specific enterprise customer. Shows all enrollable courses associated with that enterprise's content catalogs. Utilizes Algolia as a hosted search provider.                                                                                                                      |\n| http://localhost:8734/:enterpriseSlug/course/:courseKey                | The course page with information about the course and provides a way for learners to enroll using their enterprise's subsidy (e.g., subscription license, codes).                                                                                                                                       |\n| http://localhost:8734/:enterpriseSlug/licenses/:activationKey/activate | The license activation page allows new learners who have an assigned license to activate their license.                                                                                                                                                                                                 |\n| http://localhost:8734/r/:redirectPath                                  | This route allows deep linking to a specific page within the Enterprise Learner Portal (i.e., the redirect path) without yet knowing an enterprise slug. This route is helpful to send generic links to pages within the Enterprise Learner Portal in marketing, support, account management scenarios. |\n\n### Code layout / components\n\nTODO/WIP\n\n### Required reading\n\n* edX\n  * [Onboarding for devs](https://openedx.atlassian.net/wiki/spaces/ENG/pages/12550298/Developer+Onboarding)\n  * [Devstack Doc](https://github.com/openedx/devstack)\n  * [Enterprise docs](https://openedx.atlassian.net/wiki/spaces/SOL/pages/997654609/Hitchhiker+s+Engineer+s+Guide+to+the+Enterprise+Ecosystem)\n  *\n* External\n  * [ReactJS](https://reactjs.org/)\n\n## License\n\nThe code in this repository is licensed under the AGPLv3 unless otherwise\nnoted.\n\nPlease see `LICENSE \u003cLICENSE\u003e`_ for details.\n\n## Contributing\n\nContributions are very welcome.  Please read `How To Contribute`_ for details.\n\n.. _How To Contribute: https://openedx.org/r/how-to-contribute\n\nThis project is currently accepting all types of contributions, bug fixes,\nsecurity fixes, maintenance work, or new features.  However, please make sure\nto have a discussion about your new feature idea with the maintainers prior to\nbeginning development to maximize the chances of your change being accepted.\nYou can start a conversation by creating a new issue on this repo summarizing\nyour idea.\n\n## Getting Help\n\nIf you're having trouble, we have discussion forums at\nhttps://discuss.openedx.org where you can connect with others in the community.\n\nOur real-time conversations are on Slack. You can request a `Slack\ninvitation`_, then join our `community Slack workspace`_.  Because this is a\nfrontend repository, the best place to discuss it would be in the `#wg-frontend\nchannel`_.\n\nFor anything non-trivial, the best path is to open an issue in this repository\nwith as many details about the issue you are facing as you can provide.\n\nhttps://github.com/openedx/frontend-app-learner-portal-enterprise/issues\n\nFor more information about these options, see the `Getting Help`_ page.\n\n.. _Slack invitation: https://openedx.org/slack\n.. _community Slack workspace: https://openedx.slack.com/\n.. _#wg-frontend channel: https://openedx.slack.com/archives/C04BM6YC7A6\n.. _Getting Help: https://openedx.org/community/connect\n\n##  The Open edX Code of Conduct\n\nAll community members are expected to follow the `Open edX Code of Conduct`_.\n\n.. _Open edX Code of Conduct: https://openedx.org/code-of-conduct/\n\n## Reporting Security Issues\n\nPlease do not report security issues in public. Please email security@openedx.org.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenedx%2Ffrontend-app-learner-portal-enterprise","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenedx%2Ffrontend-app-learner-portal-enterprise","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenedx%2Ffrontend-app-learner-portal-enterprise/lists"}