|
@@ -12,7 +12,7 @@ This page of the docs outlines how to get **Websurfx** up and running in a devel
|
|
|
- [NixOS Dev Shell using Nix Flake](#nixos-dev-shell-using-nix-flake-)
|
|
|
- [Local Development with Docker Compose](#local-development-with-docker-compose-)
|
|
|
- [Project Commands](#project-commands)
|
|
|
-+ - [Environment Variables](#environment-variables)
|
|
|
+ - [Environment Variables](#environment-variables)
|
|
|
- [Git Strategy](#git-strategy)
|
|
|
- [Flow](#git-flow)
|
|
|
- [Branches](#git-branch-naming)
|
|
@@ -57,7 +57,7 @@ $ npm i -g stylelint
|
|
|
$ npm i -g stylelint stylelint-config-standard postcss-lit
|
|
|
```
|
|
|
|
|
|
-> **Note**
|
|
|
+> [!Note]
|
|
|
> In the above command the dollar sign(**$**) refers to running the command in privileged mode by using utilities `sudo`, `doas`, `pkgexec`, or any other privileged access methods.
|
|
|
|
|
|
- `Cargo-watch` installed on your system which will allow you to auto-build the project when any checks occur in the source code files in the codebase (`websurfx` directory). Before you install `cargo-watch` on your system, make sure you have `cargo` installed on your system. To install `cargo-watch` run the following command:
|
|
@@ -69,7 +69,7 @@ cargo install cargo-watch
|
|
|
- `Git` installed on your system. The installation instructions for this can be found [here](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git).
|
|
|
- Finally, The latest version of `Docker` is installed on your system which will be used to avoid introducing unexpected issues when working on the project. The installation instructions for this can be found [here](https://docs.docker.com/engine/install/).
|
|
|
|
|
|
-> **Note**
|
|
|
+> [!Note]
|
|
|
> For **rolling release Linux distributions (distros)**, the above-mentioned required packages except for `stylelint` and `cargo-watch` can also be installed via the distro-specific package manager.
|
|
|
>
|
|
|
> **For Example:**
|
|
@@ -149,7 +149,7 @@ Once you have finished running the above command, Websurfx should now be served
|
|
|
|
|
|
This section covers how to use and set up the Gitpod development environment for working on the project.
|
|
|
|
|
|
-> **Note**
|
|
|
+> [!Note]
|
|
|
> By default the project only supports the Vscode **IDE/Editor** for Gitpod.
|
|
|
|
|
|
#### Launching Gitpod
|
|
@@ -310,13 +310,13 @@ Before you start working on the project. You will need the following packages in
|
|
|
$ npm i -g stylelint
|
|
|
```
|
|
|
|
|
|
-> **Note**
|
|
|
+> [!Note]
|
|
|
> In the above command the dollar sign(**$**) refers to running the command in privileged mode by using utilities `sudo`, `doas`, `pkgexec`, or any other privileged access methods.
|
|
|
|
|
|
- `Git` installed on your system. The installation instructions for this can be found [here](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git).
|
|
|
- Finally, The latest version of `Docker` is installed on your system which will be used to avoid introducing unexpected issues when working on the project. The installation instructions for this can be found [here](https://docs.docker.com/engine/install/).
|
|
|
|
|
|
-> **Note**
|
|
|
+> [!Note]
|
|
|
> For **rolling release Linux distributions (distros)**, the above-mentioned all required packages can also be installed via the distro-specific package manager.
|
|
|
>
|
|
|
> **For Example:**
|
|
@@ -355,7 +355,7 @@ If you have followed the above section then you should have a cloned repository
|
|
|
$ docker compose -f dev.docker-compose.yml up
|
|
|
```
|
|
|
|
|
|
-> **Note**
|
|
|
+> [!Note]
|
|
|
> In the above command the dollar sign(**$**) refers to running the command in privileged mode by using utilities `sudo`, `doas`, `pkgexec`, or any other privileged access methods.
|
|
|
|
|
|
Once you have finished running the above command, Websurfx should now be served on the address http://127.0.0.1:8080. Hot reload is enabled, so making changes to any of the files will trigger the project to be rebuilt.
|
|
@@ -366,13 +366,12 @@ Once you have finished running the above command, Websurfx should now be served
|
|
|
|
|
|
- `cargo build`: Builds the project.
|
|
|
|
|
|
-> **Note**
|
|
|
+> [!Note]
|
|
|
> When you build the project first time with the above command it will require the app to compile every dependency in the project which will then be cached on your system. So when you compile the app next time it will only compile for the new changes.
|
|
|
|
|
|
-+ `cargo run`: Starts the app and serves the project on http://127.0.0.1:8080.
|
|
|
+- `cargo run`: Starts the app and serves the project on http://127.0.0.1:8080.
|
|
|
|
|
|
-
|
|
|
-> **Important**
|
|
|
+> [!Important]
|
|
|
> You must run the build command first.
|
|
|
|
|
|
#### Development
|
|
@@ -458,10 +457,10 @@ When you submit your pull request, include the required info, by filling out the
|
|
|
- If any dependencies were added, explain why it was needed, and state the cost. associated, and confirm it does not introduce any security, privacy, or speed issues
|
|
|
- Optionally, provide a checklist of all the changes that were included in the pull request.
|
|
|
|
|
|
-> **Important**
|
|
|
+> [!Important]
|
|
|
> Make sure to fill all the required/mandatory sections of the pull request as filling them helps us distinguish between spam pull requests and legitimate pull requests.
|
|
|
|
|
|
-> **Note**
|
|
|
+> [!Note]
|
|
|
> The pull request template contains comments in the following form `<!-- -->` which are used to provide a guide on what should be provided under each heading of the template. These comments are never rendered when the pull request is either created or updated and hence anything provided in such comments is never displayed.
|
|
|
|
|
|
## Resources for Beginners
|
|
@@ -498,7 +497,7 @@ For Rust, CSS, JS, HTML, Git, and Docker- you'll need an IDE (e.g. [VSCode](http
|
|
|
|
|
|
Linting is done using [Cargo Clippy](https://doc.rust-lang.org/clippy/) and [StyleLint](https://stylelint.io/) or [ESLint](https://eslint.org/). Also, linting is run as a git pre-commit hook.
|
|
|
|
|
|
-> **Important**
|
|
|
+> [!Important]
|
|
|
> All lint checks must pass before any PR can be merged.
|
|
|
|
|
|
Styleguides to follow:
|
|
@@ -509,7 +508,7 @@ Styleguides to follow:
|
|
|
|
|
|
## Application Structure
|
|
|
|
|
|
-> **Important**
|
|
|
+> [!Important]
|
|
|
> We follow the Unix style naming conventions for all the files and folders in the project (except for all files under the `themes` and `colorschemes` folder in the frontend's source code which requires that the names of the files and folders should be in lowercase and the words be separated with a hyphen.) which includes the name of the files and folders should be in lowercase and every word should be separated with an underscore.
|
|
|
|
|
|
**Files in the root of the codebase:** `./`
|
|
@@ -541,30 +540,42 @@ Styleguides to follow:
|
|
|
./public/
|
|
|
โโโ robots.txt # Robots file for the Website.
|
|
|
โโโ images # Images for the Website.
|
|
|
-โโโ static # The directory containing all the UI handlers.
|
|
|
-โ โโโ cookies.js # Handles the loading of saved cookies.
|
|
|
-โ โโโ error_box.js # Handles the toggling functionality of the error box on the search page.
|
|
|
-โ โโโ index.js # Functions to handle the search functionality of the search bar.
|
|
|
-โ โโโ pagination.js # Functions to handle the navigation between the previous and next page in the search page.
|
|
|
-โ โโโ search_area_options.js # Changes the search options under the search bar in the search page according to the safe search level set using the URL safesearch parameter.
|
|
|
-โ โโโ settings.js # Handles the settings and saving of all the settings page options as a cookie.
|
|
|
-โ โโโ colorschemes # A folder containing all the popular colorscheme files as CSS files.
|
|
|
-โ โโโ themes # A folder containing all the popular theme files as CSS files.
|
|
|
-โโโ templates # Folder containing all the template files for the different pages on the website.
|
|
|
- โโโ 404.html # A 404-page template.
|
|
|
- โโโ about.html # An about page template.
|
|
|
- โโโ bar.html # A template for the search bar.
|
|
|
- โโโ cookies_tab.html # A template for the cookies tab for the settings page.
|
|
|
- โโโ engines_tab.html # A template for the engines tab for the settings page.
|
|
|
- โโโ footer.html # A footer template for all pages.
|
|
|
- โโโ general_tab.html # A template for the general tab for the settings page.
|
|
|
- โโโ header.html # A header template for all pages.
|
|
|
- โโโ index.html # A home page template.
|
|
|
- โโโ navbar.html # A navbar template for the header template.
|
|
|
- โโโ search.html # A search page template.
|
|
|
- โโโ search_bar.html # A search bar template specifically for the search page.
|
|
|
- โโโ settings.html # A settings page template.
|
|
|
- โโโ user_interface_tab.html # A template for the user interface tab for the settings page.
|
|
|
+โโโ static # The directory containing all the UI handlers.
|
|
|
+ โโโ cookies.js # Handles the loading of saved cookies.
|
|
|
+ โโโ error_box.js # Handles the toggling functionality of the error box on the search page.
|
|
|
+ โโโ index.js # Functions to handle the search functionality of the search bar.
|
|
|
+ โโโ pagination.js # Functions to handle the navigation between the previous and next page in the search page.
|
|
|
+ โโโ search_area_options.js # Changes the search options under the search bar in the search page according to the safe search level set using the URL safesearch parameter.
|
|
|
+ โโโ settings.js # Handles the settings and saving of all the settings page options as a cookie.
|
|
|
+ โโโ colorschemes # A folder containing all the popular colorscheme files as CSS files.
|
|
|
+ โโโ themes # A folder containing all the popular theme files as CSS files.
|
|
|
+```
|
|
|
+
|
|
|
+**Fronted Maud HTML Framework Source:** `./src/templates/`
|
|
|
+
|
|
|
+```
|
|
|
+./src/templates/
|
|
|
+โโโ mod.rs # A module file for the rust project.
|
|
|
+โโโ partials # A folder containing the code for partials for the views.
|
|
|
+โ โโโ bar.rs # Provides partial code for the search bar.
|
|
|
+โ โโโ footer.rs # Provides partial code for the footer section.
|
|
|
+โ โโโ header.rs # Provides partial code for the header section.
|
|
|
+โ โโโ mod.rs # A module file for the rust project.
|
|
|
+โ โโโ navbar.rs # Provides partial code for the navbar inside the header section.
|
|
|
+โ โโโ search_bar.rs # Provides partial code for the search bar present in the search page.
|
|
|
+โ โโโ settings_tabs # A folder containing all the partials for the settings page tabs.
|
|
|
+โ โโโ cookies.rs # Provides partial code for the cookies tab.
|
|
|
+โ โโโ engines.rs # Provides partial code for the engines tab.
|
|
|
+โ โโโ general.rs # Provides partial code for the general tab.
|
|
|
+โ โโโ mod.rs # A module file for the rust project.
|
|
|
+โ โโโ user_interface.rs # Provides partial code for the user interface tab.
|
|
|
+โโโ views # A folder containing the code for the views.
|
|
|
+ โโโ about.rs # Provides code for the about page view.
|
|
|
+ โโโ index.rs # Provides code for the homepage view.
|
|
|
+ โโโ mod.rs # A module file for the rust project.
|
|
|
+ โโโ not_found.rs # Provides code for the 404 page view.
|
|
|
+ โโโ search.rs # Provides code for the search page view.
|
|
|
+ โโโ settings.rs # Provides code for the settings page view.
|
|
|
```
|
|
|
|
|
|
**Backend Source:** `./src/`
|
|
@@ -601,12 +612,13 @@ Styleguides to follow:
|
|
|
โ โโโ aggregator.rs # Provides code aggregate and fetches results from the upstream engines.
|
|
|
โ โโโ mod.rs # A module file for the rust project.
|
|
|
โ โโโ user_agent.rs # Provides a helper function to allow random user agents to pass in the server request code to improve user privacy and avoiding detected as a bot.
|
|
|
-โโโ server # A folder that holds code to handle the routes for the search engine website.
|
|
|
- โโโ mod.rs # A module file for the rust project.
|
|
|
- โโโ router.rs # Provides functions to handle the different routes on the website.
|
|
|
- โโโ routes # A folder that contains code to handle the bigger route for the website.
|
|
|
- โโโ mod.rs # A module file for the rust project.
|
|
|
- โโโ search.rs # Provides the function to handle the search route.
|
|
|
+โโโ server # A folder that holds code to handle the routes for the search engine website.
|
|
|
+โ โโโ mod.rs # A module file for the rust project.
|
|
|
+โ โโโ router.rs # Provides functions to handle the different routes on the website.
|
|
|
+โ โโโ routes # A folder that contains code to handle the bigger route for the website.
|
|
|
+โ โโโ mod.rs # A module file for the rust project.
|
|
|
+โ โโโ search.rs # Provides the function to handle the search route.
|
|
|
+โโโ templates # A module that provides and handles Maud HTML framework source code for the search engine website (subfolders and files are explained in the above frontend section.)
|
|
|
```
|
|
|
|
|
|
## Development Tools
|