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

feat: add site configuration #137

Open
oSumAtrIX opened this issue Jul 4, 2023 · 0 comments
Open

feat: add site configuration #137

oSumAtrIX opened this issue Jul 4, 2023 · 0 comments
Labels
Feature request Requesting a new feature that's not implemented yet

Comments

@oSumAtrIX
Copy link
Member

oSumAtrIX commented Jul 4, 2023

Issue

The website provides a download page for ReVanced Manager. The API returns a list of tools. Because the API can be changed, the tool names can also be changed. The website would not know, which tool to provide as a download. In other words, the website is the end application that has to break agnostics, but can not as of now.

Solution

Add a configuration to the website. The configuration would specify, which tool to provide as a download, which support links to highlight and similar. In the scenario above, an example configuration could look like this:

{
 "download": "revanced-manager"
}

The configuration would specify the tool named "revanced-manager" as a download. The name would be used to find the download link from the APIs response list of tools the following way:

api.tools[configuration.download].download

Additional context

  • It may be useful, to add a frontend to the website, similarly to the API configuration in the same location as the API configuration, as the configuration is client side. This would also be useful, because if someone intends to change the API url, they might also need to update the websites configuration to match the API. For example the API might only include a tool named "some-tool", so as a download the website would provide the download link to "some-tool".
  • Since the API configuration uses the API url specified in the .env file by default, the site configuration must also originate from the .env file. At build time, the configuration can then be generated from the .env file. In other words, the default values for the site configuration should not be hardcoded into the source code, just like the API url isn't.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature request Requesting a new feature that's not implemented yet
Projects
Status: Backlog
Development

No branches or pull requests

2 participants