### Install Project Dependencies Source: https://github.com/foxminchan/lawknowledge/blob/main/README.md Navigate to the project root and install all necessary dependencies using pnpm. ```bash pnpm install --force ``` -------------------------------- ### Serve Documentation Source: https://github.com/foxminchan/lawknowledge/blob/main/README.md Starts a local server to view the project's documentation. ```bash npx nx serve docs ``` -------------------------------- ### Start Monitoring System Source: https://github.com/foxminchan/lawknowledge/blob/main/apps/clients/docs/docs/ref/observability.mdx To start the monitoring system, navigate to the `deploys/docker` directory and run this command. This command uses docker-compose to bring up all the observability tools defined in the `docker-compose.o11y.yml` file in detached mode. ```bash docker-compose -f docker-compose.o11y.yml up -d ``` -------------------------------- ### Run the Website Application Source: https://github.com/foxminchan/lawknowledge/blob/main/README.md Start the website development server in production mode using Nx. ```bash npx nx serve website --prod ``` -------------------------------- ### Download and Install Helm Source: https://github.com/foxminchan/lawknowledge/blob/main/apps/clients/docs/docs/deploy/k8s.mdx Installs the Helm package manager on your system. Ensure you have curl installed. ```bash curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 chmod 700 get_helm.sh ./get_helm.sh ``` -------------------------------- ### Run the Authentication Service Source: https://github.com/foxminchan/lawknowledge/blob/main/README.md Start the Authentication Service in production mode using Nx. ```bash npx nx serve auth-svc --prod ``` -------------------------------- ### Install LawKnowledge Chart Source: https://github.com/foxminchan/lawknowledge/blob/main/apps/clients/docs/docs/deploy/k8s.mdx Installs the LawKnowledge application using the Helm chart with the release name 'law-knowledge'. ```bash helm install law-knowledge law-knowledge/law-knowledge ``` -------------------------------- ### Run the Law Service Source: https://github.com/foxminchan/lawknowledge/blob/main/README.md Start the Law Service in production mode using Nx. ```bash npx nx serve law-svc --prod ``` -------------------------------- ### Run SonarQube Docker Container Source: https://github.com/foxminchan/lawknowledge/blob/main/apps/clients/docs/docs/arch/cicd.mdx This command starts a SonarQube Docker container, making it accessible on port 9000. Ensure Docker is installed and running. ```bash docker run -d --name sonarqube -p 9000:9000 sonarqube ``` -------------------------------- ### Run the API Gateway Source: https://github.com/foxminchan/lawknowledge/blob/main/README.md Start the API Gateway service in production mode using Nx. ```bash npx nx serve api-gateway --prod ``` -------------------------------- ### Install NX CLI Source: https://github.com/foxminchan/lawknowledge/wiki/Development-Setup Install the NX CLI globally using npm or pnpm. This command is essential for managing NX workspaces. ```bash npm install -g nx ``` ```bash pnpm global add nx ``` -------------------------------- ### Set Up Infrastructure with Nx Source: https://github.com/foxminchan/lawknowledge/blob/main/README.md Uses Nx to set up the project's infrastructure. This command is for deployment and environment setup. ```bash npx nx up pulumi ``` -------------------------------- ### Clone the LawKnowledge Repository Source: https://github.com/foxminchan/lawknowledge/blob/main/README.md Clone the project repository to your local machine to begin setup. ```bash git clone https://github.com/foxminchan/LawKnowledge ``` -------------------------------- ### Execute Project Scripts Source: https://github.com/foxminchan/lawknowledge/blob/main/README.md Provides a template for running various project scripts like build, clean, init, prepare, start, and stop observability. Replace '' with the desired script. ```bash # Run the script ./ ``` -------------------------------- ### Example Commit Messages Source: https://github.com/foxminchan/lawknowledge/wiki/Commit-Guideline Illustrates various commit types including feature, fix, documentation, style, refactoring, testing, and chores. ```bash git commit -m "feat: add hat wobble" ``` ```bash git commit -m "fix: remove error message" ``` ```bash git commit -m "docs: explain hat wobble" ``` ```bash git commit -m "style: hat wobble" ``` ```bash git commit -m "refactor: share logic between 4d3d3d3 and flarhgunnstow" ``` ```bash git commit -m "test: ensure Tayne retains clothing" ``` ```bash git commit -m "chore: add Oyster build script" ``` -------------------------------- ### Example Commit Message Source: https://github.com/foxminchan/lawknowledge/wiki/Versioning-Guidelines Use this format for commit messages to clearly indicate the type of change and reference related issues or pull requests. ```git feat: Add new section on advanced usage (#123) ``` -------------------------------- ### Jenkins Pipeline Script for LawKnowledge Project Source: https://github.com/foxminchan/lawknowledge/blob/main/apps/clients/docs/docs/arch/cicd.mdx This Jenkinsfile defines the CI/CD pipeline for the project, handling main branch deployments and pull request checks. It utilizes Nx for monorepo management and nx-cloud for distributed caching and task execution. It also includes stages for starting build agents. ```jenkinsfile pipeline { agent none environment { NX_BRANCH = env.BRANCH_NAME.replace('PR-', '') } stages { stage('Pipeline') { parallel { stage('Main') { when { branch 'main' } agent any steps { sh "pnpm install" sh "npx nx-cloud start-ci-run --stop-agents-after='build'" sh "npx nx format:check" sh "npx nx affected --base=HEAD~1 -t lint --parallel=3 & npx nx affected --base=HEAD~1 -t test --parallel=3 --configuration=ci & npx nx affected --base=HEAD~1 -t build --parallel=3" } } stage('PR') { when { not { branch 'main' } } agent any steps { sh "pnpm install" sh "npx nx-cloud start-ci-run --stop-agents-after='build'" sh "npx nx format:check" sh "npx nx affected --base origin/${env.CHANGE_TARGET} -t lint --parallel=2 & npx nx affected --base origin/${env.CHANGE_TARGET} -t test --parallel=2 --configuration=ci & npx nx affected --base origin/${env.CHANGE_TARGET} -t build --parallel=2" } } stage('Agent1') { agent any steps { sh "pnpm install" sh "npx nx-cloud start-agent" } } stage('Agent2') { agent any steps { sh "pnpm install" sh "npx nx-cloud start-agent" } } stage('Agent3') { agent any steps { sh "pnpm install" sh "npx nx-cloud start-agent" } } } } } } ``` -------------------------------- ### Get Initial Jenkins Admin Password Source: https://github.com/foxminchan/lawknowledge/blob/main/apps/clients/docs/docs/arch/cicd.mdx Retrieves the initial administrator password for a Jenkins Docker container. Replace with the actual ID of your Jenkins container. ```bash docker exec -it cat /var/jenkins_home/secrets/initialAdminPassword ``` -------------------------------- ### Build and Run the Search Service Source: https://github.com/foxminchan/lawknowledge/blob/main/README.md Build the Search Service using Nx, then navigate to its directory and run the Python main script. ```bash npx nx build search-svc && cd apps/api/search-svc/search-svc && python main.py ``` -------------------------------- ### Serve the Auth Service Source: https://github.com/foxminchan/lawknowledge/blob/main/apps/clients/docs/docs/start.mdx Run the Authentication Service in production mode using the Nx serve command. ```bash # For the Auth Service npx nx serve auth-svc --prod ``` -------------------------------- ### Serve the API Gateway Source: https://github.com/foxminchan/lawknowledge/blob/main/apps/clients/docs/docs/start.mdx Run the API Gateway service in production mode using the Nx serve command. ```bash # For the API Gateway npx nx serve api-gateway --prod ``` -------------------------------- ### View Dependency Graph Source: https://github.com/foxminchan/lawknowledge/blob/main/README.md Generates and displays the dependency graph for the entire project using Nx. ```bash npx nx dep-graph ``` -------------------------------- ### Build and Run Chat Service Source: https://github.com/foxminchan/lawknowledge/blob/main/README.md Builds the chat service and runs its main Python script. Ensure you are in the correct directory. ```bash npx nx build chat-svc && cd apps/api/chat-svc/chat-svc && python main.py ``` -------------------------------- ### Test Website End-to-End Source: https://github.com/foxminchan/lawknowledge/blob/main/README.md Runs end-to-end tests for the website component of the project. ```bash npx nx test website-e2e ``` -------------------------------- ### Navigate and List Scripts Source: https://github.com/foxminchan/lawknowledge/blob/main/apps/clients/docs/docs/start.mdx Navigates to the tools/scripts directory and lists the available shell scripts. ```bash cd tools/scripts && ls ``` -------------------------------- ### Serve the Law Service Source: https://github.com/foxminchan/lawknowledge/blob/main/apps/clients/docs/docs/start.mdx Run the Law Service in production mode using the Nx serve command. ```bash # For the Law Service npx nx serve law-svc --prod ``` -------------------------------- ### Navigate and List Scripts Source: https://github.com/foxminchan/lawknowledge/blob/main/README.md Navigates to the scripts directory and lists available shell scripts for project management. ```bash # Navigate to the scripts directory cd tools/scripts && ls ``` -------------------------------- ### Build and Run Diagram as Code Source: https://github.com/foxminchan/lawknowledge/blob/main/README.md Builds the Diagram as Code tool and runs its main Python script. Used for generating diagrams. ```bash npx nx build dac && cd assets/dac/dac && python main.py ``` -------------------------------- ### Execute Project Script Source: https://github.com/foxminchan/lawknowledge/blob/main/apps/clients/docs/docs/start.mdx Executes a project script. Replace '' with the actual script name (e.g., build.sh, clean.sh). ```bash ./ ``` -------------------------------- ### Test Auth Service End-to-End Source: https://github.com/foxminchan/lawknowledge/blob/main/apps/clients/docs/docs/start.mdx Runs end-to-end tests for the Auth Service. ```bash npx nx test auth-svc-e2e ``` -------------------------------- ### Test Search Service End-to-End Source: https://github.com/foxminchan/lawknowledge/blob/main/apps/clients/docs/docs/start.mdx Runs end-to-end tests for the Search Service. ```bash npx nx test search-svc-e2e ``` -------------------------------- ### Run ArgoCD Docker Container Source: https://github.com/foxminchan/lawknowledge/blob/main/apps/clients/docs/docs/arch/cicd.mdx Pulls the latest ArgoCD image and runs it as a Docker container, exposing the UI on port 7050. ```bash docker run -d -p 7050:8080 argoproj/argocd:v2.1.2 ``` -------------------------------- ### Build and Run Data Processor Source: https://github.com/foxminchan/lawknowledge/blob/main/README.md Builds the data processing tool and runs its main Python script. This is used for dataset manipulation. ```bash npx nx build processor && cd apps/nlp/processor/processor && python main.py ``` -------------------------------- ### Test API Gateway End-to-End Source: https://github.com/foxminchan/lawknowledge/blob/main/apps/clients/docs/docs/start.mdx Runs end-to-end tests for the API Gateway. ```bash npx nx test api-gateway-e2e ``` -------------------------------- ### Train BERT Model Source: https://github.com/foxminchan/lawknowledge/blob/main/README.md Builds the BERT model and runs its main Python script for training. This command is used for model training purposes. ```bash npx nx build bert && cd apps/nlp/bert/bert && python main.py ``` -------------------------------- ### Test Chat Service Source: https://github.com/foxminchan/lawknowledge/blob/main/apps/clients/docs/docs/start.mdx Runs tests for the Chat Service. ```bash npx nx test chat-svc ``` -------------------------------- ### Access Control Use Case Diagram Source: https://github.com/foxminchan/lawknowledge/blob/main/apps/clients/docs/docs/bussiness/usecase.mdx This PlantUML diagram illustrates the 'Access Control' use case, showing actors, system boundaries, and the relationships between different use case components like login, authentication, authorization, and policy management. ```plantuml @startuml title Use Case: Access Control end title left to right direction skinparam packageStyle rectangle skinparam shadowing false skinparam handwritten false skinparam actor { BackgroundColor white ArrowColor black BorderColor black } skinparam usecase { BackgroundColor white ArrowColor black BorderColor black } actor User as User rectangle system { User -d- (Login to system) (Login to system) .> (Authenticate user): <> (Authorize and access control) <.u. (Authenticate user): <> (Policy management) <.. (Authorize and access control): <> (Identity information management) <. (Authorize and access control): <> (RBAC management) .> (Policy management): <> (Claim management) .u.> (Policy management): <> User -d- (Logout of system) } @enduml ``` -------------------------------- ### Test Law Service End-to-End Source: https://github.com/foxminchan/lawknowledge/blob/main/apps/clients/docs/docs/start.mdx Runs end-to-end tests for the Law Service. ```bash npx nx test law-svc-e2e ``` -------------------------------- ### Test API Services Source: https://github.com/foxminchan/lawknowledge/blob/main/README.md Runs end-to-end tests for various API services including Auth, Law, and Search. Also includes a test for the chat service. ```bash # For the Auth Service npx nx test auth-svc-e2e # For the Law Service npx nx test law-svc-e2e # For the Search Service npx nx test search-svc-e2e # For the Chat Service npx nx test chat-svc ``` -------------------------------- ### Add LawKnowledge Helm Repository Source: https://github.com/foxminchan/lawknowledge/blob/main/apps/clients/docs/docs/deploy/k8s.mdx Adds the official Helm repository for LawKnowledge to your Helm client configuration. ```bash helm repo add law-knowledge https://foxminchan.github.io/law-knowledge/charts ``` -------------------------------- ### Basic Commit Message Format Source: https://github.com/foxminchan/lawknowledge/wiki/Commit-Guideline The fundamental structure for a conventional commit message includes a type and a body. ```bash git commit -m : ``` -------------------------------- ### Test BERT Model Source: https://github.com/foxminchan/lawknowledge/blob/main/README.md Runs tests specifically for the BERT model component. ```bash npx nx test bert ``` -------------------------------- ### Uninstall LawKnowledge Chart Source: https://github.com/foxminchan/lawknowledge/blob/main/apps/clients/docs/docs/deploy/k8s.mdx Uninstalls and deletes the LawKnowledge deployment managed by Helm. ```bash helm uninstall law-knowledge ``` -------------------------------- ### Run Jenkins Docker Container Source: https://github.com/foxminchan/lawknowledge/blob/main/apps/clients/docs/docs/arch/cicd.mdx This command pulls the latest Jenkins LTS image and runs it as a detached Docker container, exposing Jenkins on port 7070. ```bash docker run -d -p 7070:8080 -p 50000:50000 jenkins/jenkins:lts ``` -------------------------------- ### Patch ArgoCD Secret to Change Admin Password Source: https://github.com/foxminchan/lawknowledge/blob/main/apps/clients/docs/docs/arch/cicd.mdx Updates the ArgoCD secret to change the default admin password. Ensure you are in the correct Kubernetes context. ```bash kubectl -n argocd patch secret argocd-secret \ -p '{"stringData": { "admin.password": "Hutech@123" }}' ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.