### Set up and Run CatColab Frontend Locally
Source: https://github.com/toposinstitute/catcolab/blob/main/README.md
Instructions for developers to set up and run the CatColab frontend locally. This involves installing dependencies, building the project, and starting the development server, connecting to the staging backend deployment.
```sh
pnpm install
pnpm run build
pnpm run dev --mode staging
```
--------------------------------
### Build CatColab Frontend from Source
Source: https://github.com/toposinstitute/catcolab/blob/main/packages/frontend/README.md
This snippet provides the commands to set up the development environment and build the CatColab frontend. It assumes Rust and pnpm are installed, and compiles Rust dependencies to WebAssembly before bundling the frontend.
```sh
cd packages/frontend
pnpm install
pnpm run build
```
--------------------------------
### Launch AlgebraicJulia Jupyter Server
Source: https://github.com/toposinstitute/catcolab/blob/main/packages/algjulia-interop/README.md
Starts the Jupyter server, making the AlgebraicJulia service available for local use by CatColab. This script should be executed from the project directory.
```sh
./jupyter_server.sh
```
--------------------------------
### Launch CatColab Frontend with Local Backend
Source: https://github.com/toposinstitute/catcolab/blob/main/packages/backend/README.md
This command starts the CatColab frontend application, configured to connect to the locally running backend services. It allows developers to interact with the full application stack in a local development environment.
```sh
cd packages/frontend
pnpm run dev
```
--------------------------------
### Install Julia Project Dependencies
Source: https://github.com/toposinstitute/catcolab/blob/main/packages/algjulia-interop/README.md
Installs all necessary Julia package dependencies for the project. This command should be run from the project directory after setting up Julia and Jupyter.
```sh
julia --project -e 'import Pkg; Pkg.instantiate()'
```
--------------------------------
### Run CatColab Backend Web Server Locally
Source: https://github.com/toposinstitute/catcolab/blob/main/packages/backend/README.md
This command starts the main web server component of the CatColab backend locally. It launches the Rust-based application, making the API endpoints available for the frontend or other services to interact with.
```sh
cd packages/backend
cargo run
```
--------------------------------
### Install pnpm Dependencies and Sync Lockfile
Source: https://github.com/toposinstitute/catcolab/blob/main/packages/automerge-doc-server/README.md
Resolves 'Could not resolve "package"' and 'ERR_PNPM_OUTDATED_LOCKFILE' errors by installing missing packages and ensuring `pnpm-lock.yaml` is synchronized with `package.json`.
```Shell
pnpm install
```
--------------------------------
### Publish Rust WebAssembly Package to NPM
Source: https://github.com/toposinstitute/catcolab/blob/main/packages/catlog-wasm/README.md
Publishes the compiled WebAssembly package to the NPM registry using `wasm-pack publish`. This makes the package available for others to install and use in JavaScript projects.
```Shell
wasm-pack publish
```
--------------------------------
### Temporarily Replace Nix Dependency Hash for Recomputation
Source: https://github.com/toposinstitute/catcolab/blob/main/packages/automerge-doc-server/README.md
To force Nix to recompute the correct dependency hash, replace the existing 'hash' value in your Nix configuration file with 'pkgs.lib.fakeHash'. This is a necessary step before rebuilding to get the new hash.
```Nix
hash = pkgs.lib.fakeHash;
```
--------------------------------
### Build and Serve CatColab Design Documents
Source: https://github.com/toposinstitute/catcolab/blob/main/dev-docs/README.md
Instructions to compile the design documents using forester, serve them locally, and watch for changes. Requires a full TeXLive LaTeX distribution and Python.
```Shell
./forester build
./serve.sh
./watch.sh
```
--------------------------------
### Build CatColab Backend Rust Binary
Source: https://github.com/toposinstitute/catcolab/blob/main/packages/backend/README.md
This command compiles the Rust source code of the CatColab backend into an executable binary. Running `cargo build` prepares the application for deployment or local execution by resolving dependencies and optimizing the code.
```sh
cargo build
```
--------------------------------
### Importing SolidJS Components for Application Use
Source: https://github.com/toposinstitute/catcolab/blob/main/packages/frontend/src/help/index.mdx
Demonstrates how core SolidJS components like A from @solidjs/router and custom components like Warning from local paths are imported into a SolidJS application for use in JSX templates.
```JavaScript
import { A } from "@solidjs/router";
import { Warning } from "../components/alert";
```
--------------------------------
### Importing A Component for SolidJS Routing
Source: https://github.com/toposinstitute/catcolab/blob/main/packages/frontend/src/help/theory/olog.mdx
This snippet demonstrates how to import the `A` component from the `@solidjs/router` library. The `A` component is used in SolidJS applications for declarative client-side navigation, similar to an anchor tag but optimized for single-page applications.
```JavaScript
import { A } from "@solidjs/router";
```
--------------------------------
### Build CatColab System Locally with Nix
Source: https://github.com/toposinstitute/catcolab/blob/main/packages/automerge-doc-server/README.md
Execute this command to locally build the CatColab system configuration using Nix. This action will trigger the hash recomputation process when 'pkgs.lib.fakeHash' is in place, leading to an error message containing the correct hash.
```Nix
nix build .#nixosConfigurations.catcolab-next.config.system.build.toplevel
```
--------------------------------
### Initialize Rust WebAssembly Project with cargo generate
Source: https://github.com/toposinstitute/catcolab/blob/main/packages/catlog-wasm/README.md
Clones the `wasm-pack-template` repository using `cargo generate` to create a new project directory, then navigates into it. This command is used to quickly set up a new Rust and WebAssembly project from the template.
```Shell
cargo generate --git https://github.com/rustwasm/wasm-pack-template.git --name my-project
cd my-project
```
--------------------------------
### Run CatColab Frontend in Development Mode
Source: https://github.com/toposinstitute/catcolab/blob/main/packages/frontend/README.md
Use this command to run the CatColab frontend locally for development. The `$MODE` variable determines the backend connection: `development` (local backend), `staging` (next.catcolab.org), or `production` (catcolab.org - not recommended for dev).
```sh
pnpm run dev --mode $MODE
```
--------------------------------
### Run CatColab Automerge Document Server Locally
Source: https://github.com/toposinstitute/catcolab/blob/main/packages/backend/README.md
This command launches the companion Automerge document server, which works alongside the main CatColab backend. It is essential for handling collaborative document synchronization and is run using `pnpm`.
```sh
cd packages/automerge-doc-server
pnpm run main
```
--------------------------------
### Import A Component for SolidJS Router
Source: https://github.com/toposinstitute/catcolab/blob/main/packages/frontend/src/help/theory/causal-loop-delays.mdx
This snippet demonstrates importing the 'A' component from the '@solidjs/router' library. The 'A' component is typically used in SolidJS applications to create declarative navigation links, similar to an anchor tag but optimized for client-side routing.
```JavaScript
import { A } from "@solidjs/router";
```
--------------------------------
### Creating Internal Navigation Links with SolidJS Router's A Component
Source: https://github.com/toposinstitute/catcolab/blob/main/packages/frontend/src/help/index.mdx
Shows how to use the A component from @solidjs/router to create internal links within a SolidJS application. This component functions similarly to an HTML tag but integrates with the application's routing system for single-page application navigation.
```JavaScript
read the credits
here
```
--------------------------------
### Regenerate Cargo.nix for Rust Dependency Caching
Source: https://github.com/toposinstitute/catcolab/blob/main/packages/backend/README.md
These commands regenerate the `Cargo.nix` file, which is used by `crate2nix` to describe the project's Rust dependency graph. This process ensures reproducible builds and enables efficient caching of dependencies, significantly speeding up deployment times after `Cargo.toml` or `Cargo.lock` changes.
```bash
nix develop
crate2nix generate
```
--------------------------------
### Importing 'A' Component from SolidJS Router
Source: https://github.com/toposinstitute/catcolab/blob/main/packages/frontend/src/help/theory/schema.mdx
This snippet demonstrates how to import the 'A' component from the `@solidjs/router` library. The 'A' component is typically used in SolidJS applications for declarative client-side navigation, functioning similarly to an HTML anchor tag but integrated with SolidJS's routing capabilities.
```JavaScript
import { A } from "@solidjs/router";
```
--------------------------------
### Build CatColab for NixOS Deployment
Source: https://github.com/toposinstitute/catcolab/blob/main/README.md
Command to perform a test build of the CatColab system specifically for NixOS deployment configurations. This is useful for verifying the build process in a NixOS environment.
```sh
nix build .#nixosConfigurations.catcolab-next.config.system.build.toplevel
```
--------------------------------
### Build Julia Sysimage for Faster Loading
Source: https://github.com/toposinstitute/catcolab/blob/main/packages/algjulia-interop/README.md
Compiles a sysimage to precompile dependencies like CairoMakie.jl and OrdinaryDiffEq.jl, significantly reducing future loading times for AlgebraicJuliaService. This process can take several minutes depending on your machine.
```sh
julia ./make_sysimage.jl
```
--------------------------------
### View Available Commands for CatColab Migrator
Source: https://github.com/toposinstitute/catcolab/blob/main/packages/migrator/README.md
This command displays all available CLI commands for the CatColab database migrator tool, which is based on `sqlx_migrator`. It provides a list of actions that can be performed, similar to the `sqlx` CLI.
```sh
cargo run -p migrator help
```
--------------------------------
### Run PostgreSQL Database Migrations for CatColab Backend
Source: https://github.com/toposinstitute/catcolab/blob/main/packages/backend/README.md
This command applies pending database migrations for the CatColab backend using `cargo run` with the `migrator` package. It ensures that the PostgreSQL database schema is up-to-date with the application's requirements, preparing it for data storage and retrieval.
```sh
cargo run -p migrator apply
```
--------------------------------
### Build Rust WebAssembly Project with wasm-pack
Source: https://github.com/toposinstitute/catcolab/blob/main/packages/catlog-wasm/README.md
Compiles the Rust project into WebAssembly using `wasm-pack build`. This command generates the necessary WebAssembly artifacts and JavaScript bindings for publishing to NPM.
```Shell
wasm-pack build
```
--------------------------------
### Importing A Component in SolidJS
Source: https://github.com/toposinstitute/catcolab/blob/main/packages/frontend/src/help/theory/indeterminate-causal-loop.mdx
This snippet demonstrates how to import the 'A' component from '@solidjs/router'. This component is typically used for creating navigation links in SolidJS applications, similar to an anchor tag but with SolidJS's routing capabilities.
```JavaScript
import { A } from "@solidjs/router";
```
--------------------------------
### Execute CatColab Backend Unit Tests
Source: https://github.com/toposinstitute/catcolab/blob/main/packages/backend/README.md
This command executes the unit tests defined for the CatColab backend's Rust codebase. Running `cargo test` helps verify the correctness and stability of individual components and functions within the server.
```sh
cargo test
```
--------------------------------
### Displaying Important Notices with a Custom SolidJS Warning Component
Source: https://github.com/toposinstitute/catcolab/blob/main/packages/frontend/src/help/index.mdx
Illustrates the usage of a custom Warning SolidJS component to present critical information or disclaimers to users. This component wraps content, highlighting important messages about the application's development status and data handling.
```JavaScript
CatColab is under active development with new features added regularly. We aim
to preserve the integrity of your data but you should not store anything
critical or sensitive.
```
--------------------------------
### Test Rust WebAssembly Project in Headless Browsers
Source: https://github.com/toposinstitute/catcolab/blob/main/packages/catlog-wasm/README.md
Runs tests for the WebAssembly project in headless browsers using `wasm-pack test`. The `--headless` flag ensures tests run without a visible browser UI, and `--firefox` specifies Firefox as the browser for testing.
```Shell
wasm-pack test --headless --firefox
```
--------------------------------
### Execute CatColab Frontend RPC API Integration Tests
Source: https://github.com/toposinstitute/catcolab/blob/main/packages/backend/README.md
This command executes the integration tests for the RPC API from the CatColab frontend package. These tests verify the proper communication and data exchange between the frontend and the backend services.
```sh
cd packages/frontend
pnpm run test
```
--------------------------------
### Import A Component from SolidJS Router
Source: https://github.com/toposinstitute/catcolab/blob/main/packages/frontend/src/help/credits.mdx
Imports the 'A' component from the SolidJS router library. This component is typically used for creating declarative navigation links within SolidJS applications, similar to an anchor tag but optimized for client-side routing.
```JavaScript
import { A } from "@solidjs/router";
```
--------------------------------
### Apply All Pending Migrations for CatColab Database
Source: https://github.com/toposinstitute/catcolab/blob/main/packages/migrator/README.md
This command executes all pending database migrations for the CatColab project, ensuring the database schema is up-to-date. The `DATABASE_URL` environment variable must be set for the target database to connect successfully.
```sh
cargo run -p migrator apply
```
--------------------------------
### Format and Lint CatColab Frontend Code
Source: https://github.com/toposinstitute/catcolab/blob/main/README.md
Commands to ensure consistent code formatting and style for the CatColab frontend (TypeScript) using pnpm scripts. These should be run before submitting a pull request.
```sh
cd packages/frontend
pnpm run format
pnpm run lint
```
--------------------------------
### SolidJS Router Component Import
Source: https://github.com/toposinstitute/catcolab/blob/main/packages/frontend/src/help/theory/empty.mdx
Imports the 'A' component from the SolidJS router library. This component is typically used to create declarative navigation links within a SolidJS application, similar to an anchor tag but optimized for client-side routing.
```JavaScript
import { A } from "@solidjs/router";
```
--------------------------------
### Format and Lint CatColab Rust Code
Source: https://github.com/toposinstitute/catcolab/blob/main/README.md
Commands to ensure consistent code formatting and style for the CatColab backend (Rust) using `cargo fmt` and `cargo clippy`. These tools help maintain code quality and adherence to conventions.
```sh
cargo fmt
cargo clippy
```
--------------------------------
### Update Nix Dependency Hash with Computed Value
Source: https://github.com/toposinstitute/catcolab/blob/main/packages/automerge-doc-server/README.md
After Nix reports the correct hash during a failed build, update the 'hash' value in your Nix file with the new 'sha256' string. This finalizes the dependency tracking and allows subsequent builds to proceed normally.
```Nix
hash = "sha256-tIgtzlslvm2A1UpwfVsYk3E9HkKJntu36gEtsFjswgo=";
```
--------------------------------
### Generate Timestamp for New Migration Filename
Source: https://github.com/toposinstitute/catcolab/blob/main/packages/migrator/README.md
This command generates a UTC timestamp in `YYYYMMDDHHMMSS` format, which is used to name new migration files (e.g., `m20241004010448_document_refs.rs`) for the `sqlx_migrator` framework. This ensures unique and chronologically ordered migration files.
```sh
date -u +"%Y%m%d%H%M%S"
```
=== COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.