From 60379c38d8403d47dd2e6badbb3ea8e29461c968 Mon Sep 17 00:00:00 2001 From: Luis-Hebendanz Date: Mon, 30 Oct 2023 17:35:12 +0100 Subject: [PATCH 01/13] Test change --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 1664e7c..bce1d71 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ + # Website Template This repository is a template to build high quality websites as a team. From cc90e6890a25af9f46f16849a58d2d68908ea615 Mon Sep 17 00:00:00 2001 From: Luis-Hebendanz Date: Mon, 30 Oct 2023 17:35:33 +0100 Subject: [PATCH 02/13] Test change fmt --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index bce1d71..1664e7c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,3 @@ - # Website Template This repository is a template to build high quality websites as a team. From 6fdeb403802f9811b642f838ab1c298a31162bf8 Mon Sep 17 00:00:00 2001 From: Luis Date: Tue, 31 Oct 2023 12:28:15 +0100 Subject: [PATCH 03/13] Improved README --- README.md | 239 ++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 152 insertions(+), 87 deletions(-) diff --git a/README.md b/README.md index 1664e7c..e1d65da 100644 --- a/README.md +++ b/README.md @@ -1,120 +1,185 @@ # Website Template -This repository is a template to build high quality websites as a team. -The frontend uses [React NextJS -](https://nextjs.org/) and the backend uses Python with the [Fastapi framework](https://fastapi.tiangolo.com/). To ensure API compatibility between frontend and backend an `openapi.json` file is generated from the Python backend code, which defines the REST API. This `openapi.json` file is then fed into [Orval](https://orval.dev/), which generates Typescript bindings for the Rest API. To ensure code correctness, we use [mypy](https://mypy-lang.org/) to ensure the Python code is correctly statically typed, and [pytest](https://docs.pytest.org/en/7.4.x/) for backend tests. A Continuos Integration (CI) Bot, verifies the code with previously mentioned Quality Assurance (QA) tools and blocks Pull requests if any errors arise. -For dependency management we use the [Nix package manager](https://nixos.org/) to ensure reproducibility. +Welcome to our website template repository! This template is designed to help you and your team build high-quality websites efficiently. We've carefully chosen the technologies to make development smooth and enjoyable. Here's what you can expect from this template: -## Getting Started: Development Environment +**Frontend**: Our frontend is powered by [React NextJS](https://nextjs.org/), a popular and versatile framework for building web applications. -1. Install the Nix package manager by [downloading the nix installer](https://github.com/DeterminateSystems/nix-installer/releases) or executing this command: +**Backend**: For the backend, we use Python along with the [FastAPI framework](https://fastapi.tiangolo.com/). To ensure seamless communication between the frontend and backend, we generate an `openapi.json` file from the Python code, which defines the REST API. This file is then used with [Orval](https://orval.dev/) to generate TypeScript bindings for the REST API. We're committed to code correctness, so we use [mypy](https://mypy-lang.org/) to ensure that our Python code is statically typed correctly. For backend testing, we rely on [pytest](https://docs.pytest.org/en/7.4.x/). -```bash -curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install -``` +**Continuous Integration (CI)**: We've set up a CI bot that rigorously checks your code using the quality assurance (QA) tools mentioned above. If any errors are detected, it will block pull requests until they're resolved. -2. Install direnv by [downloading the direnv package](https://direnv.net/docs/installation.html) or executing this command: +**Dependency Management**: We use the [Nix package manager](https://nixos.org/) to manage dependencies and ensure reproducibility, making your development process more robust. -```bash -curl -sfL https://direnv.net/install.sh | bash -``` +# Getting Started with the Development Environment -3. Clone the repository and cd into it -4. You should see an error message reading like this: +Let's get your development environment up and running: -```bash -direnv: error .envrc is blocked. Run `direnv allow` to approve its content -``` +1. **Install Nix Package Manager**: + - You can install the Nix package manager by either [downloading the Nix installer](https://github.com/DeterminateSystems/nix-installer/releases) or running this command: + ```bash + curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install + ``` -5. Execute `direnv allow` to allow automatically executing the shell script `.envrc` on entering the directory -6. Go to `pkgs/clan-cli` and execute +2. **Install direnv**: + - Download the direnv package from [here](https://direnv.net/docs/installation.html) or run the following command: + ```bash + curl -sfL https://direnv.net/install.sh | bash + ``` -```bash -direnv allow -``` +3. **Clone the Repository and Navigate**: + - Clone this repository and navigate to it. -Then wait for the backend to build -7. To start the backend server then execute: +4. **Allow .envrc**: + - When you enter the directory, you'll receive an error message like this: + ```bash + direnv: error .envrc is blocked. Run `direnv allow` to approve its content + ``` + - Execute `direnv allow` to automatically execute the shell script `.envrc` when entering the directory. -``` -clan webui --reload --no-open --log-level debug -``` +5. **Build the Backend**: + - Go to the `pkgs/clan-cli` directory and execute: + ```bash + direnv allow + ``` + - Wait for the backend to build. -The server will automatically restart if any Python file changes. -8. In a different shell go to `pkgs/ui` and execute +6. **Start the Backend Server**: + - To start the backend server, execute: + ```bash + clan webui --reload --no-open --log-level debug + ``` + - The server will automatically restart if any Python files change. -```bash -direnv allow -``` +7. **Build the Frontend**: + - In a different shell, navigate to the `pkgs/ui` directory and execute: + ```bash + direnv allow + ``` + - Wait for the frontend to build. -Then wait for the frontend to build. -9. To start the frontend, execute: +8. **Start the Frontend**: + - To start the frontend, execute: + ```bash + npm run dev + ``` + - Access the website by going to [http://localhost:3000](http://localhost:3000). -```bash -npm run dev -``` -Visit the website by going to [http://localhost:3000](http://localhost:3000) +# Setting Up Your Git Workflow -## Getting started: Setup Git Workflow +Let's set up your Git workflow to collaborate effectively: -1. Register your Gitea account locally by executing +1. **Register Your Gitea Account Locally**: + - Execute the following command to add your Gitea account locally: + ```bash + tea login add + ``` + - Fill out the prompt as follows: + - URL of Gitea instance: `https://gitea.gchq.icu` + - Name of new Login [gitea.gchq.icu]: `gitea.gchq.icu:7171` + - Do you have an access token? No + - Username: YourUsername + - Password: YourPassword + - Set Optional settings: No -```bash -tea login add -``` - -You will then see a prompt, please fill it out like outlined below: - -``` -? URL of Gitea instance: https://gitea.gchq.icu -? Name of new Login [gitea.gchq.icu]: gitea.gchq.icu:7171 -? Do you have an access token? No -? Username: MyUserName -? Password: ********** -? Set Optional settings: No -``` - -2. First add your changes to git: - - 1. `git add ` your changes - 2. Execute `nix fmt` to lint your files - 3. `git commit -a -m "My descriptive commit message"` +2. **Git Workflow**: + 1. Add your changes to Git using `git add `. + 2. Run `nix fmt` to lint your files. + 3. Commit your changes with a descriptive message: `git commit -a -m "My descriptive commit message"`. 4. Make sure your branch has the latest changes from upstream by executing: + ```bash + git fetch && git rebase origin/main --autostash + ``` + 5. Use `git status` to check for merge conflicts. + 6. If conflicts exist, resolve them. Here's a tutorial for resolving conflicts in [VSCode](https://code.visualstudio.com/docs/sourcecontrol/overview#_merge-conflicts). + 7. After resolving conflicts, execute `git merge --continue` and repeat step 5 until there are no conflicts. +3. **Create a Pull Request**: + - To automatically open a pull request that gets merged if all tests pass, execute: + ```bash + merge-after-ci + ``` + +4. **Review Your Pull Request**: + - Visit https://gitea.gchq.icu and go to the project page. Check under "Pull Requests" for any issues with your pull request. + +5. **Push Your Changes**: + - If there are issues, fix them and redo step 2. Afterward, execute: + ```bash + git push origin HEAD:YourUsername-main + ``` + - This will directly push to your open pull request. + +# Debugging + +When working on the backend of your project, debugging is an essential part of the development process. Here are some methods for debugging and testing the backend of your application: + +## Test Backend Locally in Devshell with Breakpoints + +To test the backend locally in a development environment and set breakpoints for debugging, follow these steps: + +1. Run the following command to execute your tests and allow for debugging with breakpoints: ```bash - git fetch && git rebase origin/main --autostash + pytest -n0 -s --maxfail=1 + ``` + You can place `breakpoint()` in your Python code where you want to trigger a breakpoint for debugging. + +## Test Backend Locally in a Nix Sandbox + +To run your backend tests in a Nix sandbox, you have two options depending on whether your test functions have been marked as impure or not: + +### Running Tests Marked as Impure + +If your test functions need to execute `nix build` and have been marked as impure because you can't execute `nix build` inside a Nix sandbox, use the following command: + +```bash +nix run .#impure-checks +``` + +This command will run the impure test functions. + +### Running Pure Tests + +For test functions that have not been marked as impure and don't require executing `nix build`, you can use the following command: + +```bash +nix build .#checks.x86_64-linux.clan-pytest --rebuild +``` + +This command will run all pure test functions. + +### Inspecting the Nix Sandbox + +If you need to inspect the Nix sandbox while running tests, follow these steps: + +1. Insert an endless sleep into your test code where you want to pause the execution. For example: + + ```python + import time + time.sleep(3600) # Sleep for one hour ``` - 5. Execute `git status` to see if you have a merge conflict. - 6. If so edit the file and fix the conflict. Here is a tutorial how to do so in [vscode](https://code.visualstudio.com/docs/sourcecontrol/overview#_merge-conflicts) - 7. Execute `git merge --continue` and repeat step 5 till there are no conflicts anymore +2. Use `cntr` and `psgrep` to attach to the Nix sandbox. This allows you to interactively debug your code while it's paused. For example: -3. To automatically open up a pull request, that gets merged if all tests pass execute: + ```bash + cntr exec -w your_sandbox_name + psgrep -a -x your_python_process_name + ``` -```bash -merge-after-ci -``` +These debugging and testing methods will help you identify and fix issues in your backend code efficiently, ensuring the reliability and robustness of your application. -4. Go to https://gitea.gchq.icu to the project page, and look under "Pull Requests" if there are any issues with it. -5. If there are issues, fix them and redo step 2. Afterwards execute +# Using this Template -``` -git push origin HEAD:MyUserName-main -``` +To make the most of this template: -to directly push to your open pull request +1. Set up a new Gitea account named `ui-asset-bot`. Generate an access token with all access permissions and set it under `settings/actions/secrets` as a secret called `BOT_ACCESS_TOKEN`. + - Also, edit the file `.gitea/workflows/ui_assets.yaml` and change the `BOT_EMAIL` variable to match the email you set for that account. Gitea matches commits to accounts by their email address, so this step is essential. -## Using this template +2. Create a second Gitea account named `merge-bot`. Edit the file `pkgs/merge-after-ci/default.nix` if the name should be different. Under "Branches," set the main branch to be protected and add `merge-bot` to the whitelisted users for pushing. Set the unprotected file pattern to `**/ui-assets.nix`. + - Enable the status check for "build / test (pull_request)." -Setup two new gitea accounts. -One named `ui-asset-bot`, generate an access token for it with all access permissions and set under `settings/actions/secrets` a secret called `BOT_ACCESS_TOKEN` with the token. -Also edit the file `.gitea/workflows/ui_assets.yaml` and change the `BOT_EMAIL` variable to the email you set for that account. -The second account is called `merge-bot` edit the file `pkgs/merge-after-ci/default.nix` -if the name should be different. -Under Branches set the main branch to protected and add `merge-bot` to whitelisted users for pushing. -Also set an unprotected file pattern to `**/ui-assets.nix`. -Also set the option `Enable Status Check` to `build / test (pull_request)` -Add `merge-bot` and `ui-asset-bot` as collaborators. -Also set the option `Delete pull request branch after merge by default` -Also the the default merge style to `Rebase then create merge commit` +3. Add both `merge-bot` and `ui-asset-bot` as collaborators. + - Set the option to "Delete pull request branch after merge by default." + - Also, set the default merge style to "Rebase then create merge commit." + +With this template, you're well-equipped to build and collaborate on high-quality websites efficiently. Happy coding! \ No newline at end of file From 92afa8d289ce1cafda6b2542513d4a42b31328c8 Mon Sep 17 00:00:00 2001 From: Luis Date: Tue, 31 Oct 2023 12:28:42 +0100 Subject: [PATCH 04/13] nix fmt --- README.md | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e1d65da..5a6f835 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Welcome to our website template repository! This template is designed to help yo **Frontend**: Our frontend is powered by [React NextJS](https://nextjs.org/), a popular and versatile framework for building web applications. -**Backend**: For the backend, we use Python along with the [FastAPI framework](https://fastapi.tiangolo.com/). To ensure seamless communication between the frontend and backend, we generate an `openapi.json` file from the Python code, which defines the REST API. This file is then used with [Orval](https://orval.dev/) to generate TypeScript bindings for the REST API. We're committed to code correctness, so we use [mypy](https://mypy-lang.org/) to ensure that our Python code is statically typed correctly. For backend testing, we rely on [pytest](https://docs.pytest.org/en/7.4.x/). +**Backend**: For the backend, we use Python along with the [FastAPI framework](https://fastapi.tiangolo.com/). To ensure seamless communication between the frontend and backend, we generate an `openapi.json` file from the Python code, which defines the REST API. This file is then used with [Orval](https://orval.dev/) to generate TypeScript bindings for the REST API. We're committed to code correctness, so we use [mypy](https://mypy-lang.org/) to ensure that our Python code is statically typed correctly. For backend testing, we rely on [pytest](https://docs.pytest.org/en/7.4.x/). **Continuous Integration (CI)**: We've set up a CI bot that rigorously checks your code using the quality assurance (QA) tools mentioned above. If any errors are detected, it will block pull requests until they're resolved. @@ -15,21 +15,25 @@ Welcome to our website template repository! This template is designed to help yo Let's get your development environment up and running: 1. **Install Nix Package Manager**: + - You can install the Nix package manager by either [downloading the Nix installer](https://github.com/DeterminateSystems/nix-installer/releases) or running this command: ```bash curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install ``` 2. **Install direnv**: + - Download the direnv package from [here](https://direnv.net/docs/installation.html) or run the following command: ```bash curl -sfL https://direnv.net/install.sh | bash ``` 3. **Clone the Repository and Navigate**: + - Clone this repository and navigate to it. 4. **Allow .envrc**: + - When you enter the directory, you'll receive an error message like this: ```bash direnv: error .envrc is blocked. Run `direnv allow` to approve its content @@ -37,6 +41,7 @@ Let's get your development environment up and running: - Execute `direnv allow` to automatically execute the shell script `.envrc` when entering the directory. 5. **Build the Backend**: + - Go to the `pkgs/clan-cli` directory and execute: ```bash direnv allow @@ -44,6 +49,7 @@ Let's get your development environment up and running: - Wait for the backend to build. 6. **Start the Backend Server**: + - To start the backend server, execute: ```bash clan webui --reload --no-open --log-level debug @@ -51,6 +57,7 @@ Let's get your development environment up and running: - The server will automatically restart if any Python files change. 7. **Build the Frontend**: + - In a different shell, navigate to the `pkgs/ui` directory and execute: ```bash direnv allow @@ -64,12 +71,12 @@ Let's get your development environment up and running: ``` - Access the website by going to [http://localhost:3000](http://localhost:3000). - # Setting Up Your Git Workflow Let's set up your Git workflow to collaborate effectively: 1. **Register Your Gitea Account Locally**: + - Execute the following command to add your Gitea account locally: ```bash tea login add @@ -83,6 +90,7 @@ Let's set up your Git workflow to collaborate effectively: - Set Optional settings: No 2. **Git Workflow**: + 1. Add your changes to Git using `git add `. 2. Run `nix fmt` to lint your files. 3. Commit your changes with a descriptive message: `git commit -a -m "My descriptive commit message"`. @@ -95,12 +103,14 @@ Let's set up your Git workflow to collaborate effectively: 7. After resolving conflicts, execute `git merge --continue` and repeat step 5 until there are no conflicts. 3. **Create a Pull Request**: + - To automatically open a pull request that gets merged if all tests pass, execute: ```bash merge-after-ci ``` 4. **Review Your Pull Request**: + - Visit https://gitea.gchq.icu and go to the project page. Check under "Pull Requests" for any issues with your pull request. 5. **Push Your Changes**: @@ -173,13 +183,15 @@ These debugging and testing methods will help you identify and fix issues in you To make the most of this template: 1. Set up a new Gitea account named `ui-asset-bot`. Generate an access token with all access permissions and set it under `settings/actions/secrets` as a secret called `BOT_ACCESS_TOKEN`. + - Also, edit the file `.gitea/workflows/ui_assets.yaml` and change the `BOT_EMAIL` variable to match the email you set for that account. Gitea matches commits to accounts by their email address, so this step is essential. 2. Create a second Gitea account named `merge-bot`. Edit the file `pkgs/merge-after-ci/default.nix` if the name should be different. Under "Branches," set the main branch to be protected and add `merge-bot` to the whitelisted users for pushing. Set the unprotected file pattern to `**/ui-assets.nix`. + - Enable the status check for "build / test (pull_request)." 3. Add both `merge-bot` and `ui-asset-bot` as collaborators. - Set the option to "Delete pull request branch after merge by default." - Also, set the default merge style to "Rebase then create merge commit." -With this template, you're well-equipped to build and collaborate on high-quality websites efficiently. Happy coding! \ No newline at end of file +With this template, you're well-equipped to build and collaborate on high-quality websites efficiently. Happy coding! From b6e94e6c5c015ce6866d53a75655c61a7720efef Mon Sep 17 00:00:00 2001 From: Luis-Hebendanz Date: Mon, 30 Oct 2023 17:35:12 +0100 Subject: [PATCH 05/13] Test change --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 5a6f835..e640011 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ + # Website Template Welcome to our website template repository! This template is designed to help you and your team build high-quality websites efficiently. We've carefully chosen the technologies to make development smooth and enjoyable. Here's what you can expect from this template: From b6ff4656e345c621b7133cba587708b58f64d251 Mon Sep 17 00:00:00 2001 From: Luis-Hebendanz Date: Mon, 30 Oct 2023 17:35:33 +0100 Subject: [PATCH 06/13] Test change fmt --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index e640011..5a6f835 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,3 @@ - # Website Template Welcome to our website template repository! This template is designed to help you and your team build high-quality websites efficiently. We've carefully chosen the technologies to make development smooth and enjoyable. Here's what you can expect from this template: From 63543aad297b9d410d148aa7e45f2a42cfae0220 Mon Sep 17 00:00:00 2001 From: Luis-Hebendanz Date: Tue, 31 Oct 2023 20:31:31 +0100 Subject: [PATCH 07/13] Changed update-ui-assets to push to IoSL --- pkgs/ui/nix/update-ui-assets.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/ui/nix/update-ui-assets.sh b/pkgs/ui/nix/update-ui-assets.sh index a77780f..e43d037 100755 --- a/pkgs/ui/nix/update-ui-assets.sh +++ b/pkgs/ui/nix/update-ui-assets.sh @@ -31,7 +31,7 @@ nix build '.#ui' --out-link "$tmpdir/result" tar --transform 's,^\.,assets,' -czvf "$tmpdir/assets.tar.gz" -C "$tmpdir"/result/lib/node_modules/*/out . NAR_HASH=$(nix-prefetch-url --unpack file://<(cat "$tmpdir/assets.tar.gz")) -owner=$BOT_NAME +owner=IoSL package_name=$(echo -n "$GITHUB_REPOSITORY" | sed 's/\//-/g') package_version=$NAR_HASH baseurl=$GITHUB_SERVER_URL From 45fc4b8b4c2850d1c7f8da81221064bbf82b5809 Mon Sep 17 00:00:00 2001 From: Luis-Hebendanz Date: Tue, 31 Oct 2023 20:41:16 +0100 Subject: [PATCH 08/13] Changed update-ui-assets to push to IoSL --- pkgs/ui/nix/ui-assets.nix | 4 ++-- pkgs/ui/nix/update-ui-assets.sh | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/pkgs/ui/nix/ui-assets.nix b/pkgs/ui/nix/ui-assets.nix index 261e16b..96265ab 100644 --- a/pkgs/ui/nix/ui-assets.nix +++ b/pkgs/ui/nix/ui-assets.nix @@ -1,5 +1,5 @@ { fetchzip }: fetchzip { - url = "https://gitea.gchq.icu/api/packages/ui-asset-bot/generic/Luis-nextjs-python-web-template/0490isam16py7apig295ji99fjblm44m80b68dv5fbpj3xnvx113/assets.tar.gz"; - sha256 = "0490isam16py7apig295ji99fjblm44m80b68dv5fbpj3xnvx113"; + url = "https://gitea.gchq.icu/api/packages/IoSL/generic/IoSL-service-aware-frontend/1avqlivp7vs693b91ywgzyqgksg781lznf273cvfmjmz8h4sqpp7/assets.tar.gz"; + sha256 = "1avqlivp7vs693b91ywgzyqgksg781lznf273cvfmjmz8h4sqpp7"; } diff --git a/pkgs/ui/nix/update-ui-assets.sh b/pkgs/ui/nix/update-ui-assets.sh index e43d037..0bfc6b1 100755 --- a/pkgs/ui/nix/update-ui-assets.sh +++ b/pkgs/ui/nix/update-ui-assets.sh @@ -17,6 +17,11 @@ if [[ -z "${GITHUB_SERVER_URL:-}" ]]; then exit 1 fi +if [[ -z "${GITHUB_REPOSITORY:-}" ]]; then + echo "Env var GITHUB_REPOSITORY is not set. Please use the repo path here." + exit 1 +fi + DEPS=$(nix shell --inputs-from '.#' "nixpkgs#gnutar" "nixpkgs#gnused" "nixpkgs#curl" "nixpkgs#gzip" -c bash -c "echo \$PATH") export PATH=$PATH:$DEPS From 4700bb09185dd284913dcf39cc1f3a7e86990195 Mon Sep 17 00:00:00 2001 From: ui-asset-bot Date: Tue, 31 Oct 2023 19:54:38 +0000 Subject: [PATCH 09/13] update ui-assets.nix --- pkgs/ui/nix/ui-assets.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/ui/nix/ui-assets.nix b/pkgs/ui/nix/ui-assets.nix index 96265ab..7ddfc49 100644 --- a/pkgs/ui/nix/ui-assets.nix +++ b/pkgs/ui/nix/ui-assets.nix @@ -1,5 +1,5 @@ { fetchzip }: fetchzip { - url = "https://gitea.gchq.icu/api/packages/IoSL/generic/IoSL-service-aware-frontend/1avqlivp7vs693b91ywgzyqgksg781lznf273cvfmjmz8h4sqpp7/assets.tar.gz"; - sha256 = "1avqlivp7vs693b91ywgzyqgksg781lznf273cvfmjmz8h4sqpp7"; + url = "https://gitea.gchq.icu/api/packages/IoSL/generic/IoSL-service-aware-frontend/0sqqfyimj0wlyi8s10bgmd7y1mk71chlniniag3haix1wm0fi62r/assets.tar.gz"; + sha256 = "0sqqfyimj0wlyi8s10bgmd7y1mk71chlniniag3haix1wm0fi62r"; } From 189a20b9eb3bdcf6f60c0a4981e3eb138d1b37c0 Mon Sep 17 00:00:00 2001 From: Luis-Hebendanz Date: Tue, 31 Oct 2023 21:12:55 +0100 Subject: [PATCH 10/13] Test change --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 5a6f835..2a3e2dd 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # Website Template + Welcome to our website template repository! This template is designed to help you and your team build high-quality websites efficiently. We've carefully chosen the technologies to make development smooth and enjoyable. Here's what you can expect from this template: **Frontend**: Our frontend is powered by [React NextJS](https://nextjs.org/), a popular and versatile framework for building web applications. From 22d39dff271e7484c2f56b2a60c7dc78b17d09da Mon Sep 17 00:00:00 2001 From: Luis-Hebendanz Date: Tue, 31 Oct 2023 21:13:33 +0100 Subject: [PATCH 11/13] Test change --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 2a3e2dd..d95f4b7 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,5 @@ # Website Template - Welcome to our website template repository! This template is designed to help you and your team build high-quality websites efficiently. We've carefully chosen the technologies to make development smooth and enjoyable. Here's what you can expect from this template: **Frontend**: Our frontend is powered by [React NextJS](https://nextjs.org/), a popular and versatile framework for building web applications. @@ -195,4 +194,4 @@ To make the most of this template: - Set the option to "Delete pull request branch after merge by default." - Also, set the default merge style to "Rebase then create merge commit." -With this template, you're well-equipped to build and collaborate on high-quality websites efficiently. Happy coding! +With this template, you're well-equipped to build and collaborate on high-quality websites efficiently. Happy coding!. From add7686ebc8cfd543d9e86eaba9bce76dde6bfa8 Mon Sep 17 00:00:00 2001 From: Luis-Hebendanz Date: Wed, 1 Nov 2023 15:57:51 +0100 Subject: [PATCH 12/13] Fixed missing direnv install step in README --- README.md | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index d95f4b7..a07da0d 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,10 @@ Welcome to our website template repository! This template is designed to help yo **Dependency Management**: We use the [Nix package manager](https://nixos.org/) to manage dependencies and ensure reproducibility, making your development process more robust. +## Supported Operating Systems +- Linux +- macOS + # Getting Started with the Development Environment Let's get your development environment up and running: @@ -28,11 +32,18 @@ Let's get your development environment up and running: curl -sfL https://direnv.net/install.sh | bash ``` -3. **Clone the Repository and Navigate**: +3. **Add direnv to your shell**: + - Direnv needs to [hook into your shell](https://direnv.net/docs/hook.html) to work. + You can do this by executing following command: + ```bash + echo 'eval "$(direnv hook zsh)"' >> ~/.zshrc && echo 'eval "$(direnv hook bash)"' >> ~/.bashrc && eval "$SHELL" + ``` + +4. **Clone the Repository and Navigate**: - Clone this repository and navigate to it. -4. **Allow .envrc**: +5. **Allow .envrc**: - When you enter the directory, you'll receive an error message like this: ```bash @@ -40,7 +51,7 @@ Let's get your development environment up and running: ``` - Execute `direnv allow` to automatically execute the shell script `.envrc` when entering the directory. -5. **Build the Backend**: +6. **Build the Backend**: - Go to the `pkgs/clan-cli` directory and execute: ```bash @@ -48,7 +59,7 @@ Let's get your development environment up and running: ``` - Wait for the backend to build. -6. **Start the Backend Server**: +7. **Start the Backend Server**: - To start the backend server, execute: ```bash @@ -56,7 +67,7 @@ Let's get your development environment up and running: ``` - The server will automatically restart if any Python files change. -7. **Build the Frontend**: +8. **Build the Frontend**: - In a different shell, navigate to the `pkgs/ui` directory and execute: ```bash @@ -64,7 +75,7 @@ Let's get your development environment up and running: ``` - Wait for the frontend to build. -8. **Start the Frontend**: +9. **Start the Frontend**: - To start the frontend, execute: ```bash npm run dev From 830211fc36275dbb69854a43e907e64d86206fb9 Mon Sep 17 00:00:00 2001 From: Luis-Hebendanz Date: Wed, 1 Nov 2023 15:58:18 +0100 Subject: [PATCH 13/13] nix fmt --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a07da0d..ba0a1ec 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ Welcome to our website template repository! This template is designed to help yo **Dependency Management**: We use the [Nix package manager](https://nixos.org/) to manage dependencies and ensure reproducibility, making your development process more robust. ## Supported Operating Systems + - Linux - macOS @@ -33,8 +34,10 @@ Let's get your development environment up and running: ``` 3. **Add direnv to your shell**: + - Direnv needs to [hook into your shell](https://direnv.net/docs/hook.html) to work. - You can do this by executing following command: + You can do this by executing following command: + ```bash echo 'eval "$(direnv hook zsh)"' >> ~/.zshrc && echo 'eval "$(direnv hook bash)"' >> ~/.bashrc && eval "$SHELL" ```