From b0f1f96c7a2813abfbe1b6d684731634c21bc0f9 Mon Sep 17 00:00:00 2001 From: dcodesdev <101001810+dcodesdev@users.noreply.github.com> Date: Wed, 15 Oct 2025 13:07:43 +0300 Subject: [PATCH 1/2] Shuttle rules added CLAUDE.md added --- axum/ai-assisted/.cursor/rules/shuttle.mdc | 1 + axum/ai-assisted/CLAUDE.md | 69 ++++++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 120000 axum/ai-assisted/.cursor/rules/shuttle.mdc create mode 100644 axum/ai-assisted/CLAUDE.md diff --git a/axum/ai-assisted/.cursor/rules/shuttle.mdc b/axum/ai-assisted/.cursor/rules/shuttle.mdc new file mode 120000 index 00000000..6100270f --- /dev/null +++ b/axum/ai-assisted/.cursor/rules/shuttle.mdc @@ -0,0 +1 @@ +../../CLAUDE.md \ No newline at end of file diff --git a/axum/ai-assisted/CLAUDE.md b/axum/ai-assisted/CLAUDE.md new file mode 100644 index 00000000..a44a5ddf --- /dev/null +++ b/axum/ai-assisted/CLAUDE.md @@ -0,0 +1,69 @@ +--- +alwaysApply: true +--- + +# Shuttle Development Rules + +## Core Setup + +Always use `#[shuttle_runtime::main]` as your entry point. Can be other frameworks too, you can use the Shuttle MCP - search docs tool to find the correct code for your framework. + +```rust +#[shuttle_runtime::main] +async fn main() -> ShuttleAxum { + let router = Router::new().route("/", get(hello)); + Ok(router.into()) +} +``` + +## Databases + +- **Shared DB** (free): `#[shuttle_shared_db::Postgres] pool: PgPool` +- **AWS RDS** (paid): `#[shuttle_aws_rds::Postgres] pool: PgPool` + +## Secrets + +Create `Secrets.toml` in project root, add to `.gitignore`: + +```toml +MY_API_KEY = 'your-api-key-here' +``` + +Use in code: + +```rust +#[shuttle_runtime::main] +async fn main(#[shuttle_runtime::Secrets] secrets: SecretStore) -> ShuttleAxum { + let api_key = secrets.get("MY_API_KEY").unwrap(); + Ok(router.into()) +} +``` + +## Static Assets + +Configure in `Shuttle.toml`: + +```toml +[build] +assets = [ + "assets/*", + "frontend/dist/*", + "static/*" +] + +[deploy] +include = ["ignored-files/*"] # Include files that are normally ignored by git +deny_dirty = true +``` + +## Development Workflow + +1. `shuttle run` - local development +2. Use MCP server for AI-assisted development +3. Use MCP server for Searching the Docs + +## Key Points + +- Always use `#[shuttle_runtime::main]` as your entry point +- Configure static assets in `Shuttle.toml` +- Use secrets for sensitive configuration From 176d95a04b859685fd3a6970812aa8f26ef8e2b4 Mon Sep 17 00:00:00 2001 From: dcodesdev <101001810+dcodesdev@users.noreply.github.com> Date: Wed, 15 Oct 2025 13:28:14 +0300 Subject: [PATCH 2/2] apt update --- .github/workflows/ci.yml | 82 ++++++++++++++++++++-------------------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 216f4986..4a527239 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,9 +2,9 @@ name: CI on: push: - branches: [ "main", "develop" ] + branches: ["main", "develop"] pull_request: - branches: [ "main", "develop" ] + branches: ["main", "develop"] workflow_dispatch: env: @@ -15,15 +15,15 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v4 - - uses: taiki-e/install-action@v2 - with: - tool: cargo-binstall + - uses: taiki-e/install-action@v2 + with: + tool: cargo-binstall - - run: cargo binstall -y rust-script@0.34.0 + - run: cargo binstall -y rust-script@0.34.0 - - run: rust-script _scripts/check-templates.rs + - run: rust-script _scripts/check-templates.rs fmt-clippy: strategy: @@ -34,36 +34,36 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - - name: Clone the Shuttle main repository - if: ${{ github.ref == 'refs/heads/develop' || github.base_ref == 'develop' }} - run: | - git clone --depth 1 --branch main https://github.com/shuttle-hq/shuttle.git /home/runner/shuttle - cd /home/runner/shuttle - git log -1 --format='%H' - - - name: Apply patches - if: ${{ github.ref == 'refs/heads/develop' || github.base_ref == 'develop' }} - run: /home/runner/shuttle/scripts/apply-patches.sh .cargo/config.toml /home/runner/shuttle - - - name: Install sccache - run: | - SCCACHE_VERSION='v0.7.7' - curl -L https://github.com/mozilla/sccache/releases/download/$SCCACHE_VERSION/sccache-$SCCACHE_VERSION-x86_64-unknown-linux-musl.tar.gz \ - | tar -xOz sccache-$SCCACHE_VERSION-x86_64-unknown-linux-musl/sccache \ - > /home/runner/.cargo/bin/sccache \ - && chmod +x /home/runner/.cargo/bin/sccache - - # bevy dependency - - run: sudo apt install -y libasound2-dev libudev-dev - - - name: Check formatting and Clippy - shell: bash - run: _scripts/ci.sh ${{ matrix.from-to }} - env: - RUSTC_WRAPPER: /home/runner/.cargo/bin/sccache - CARGO_TARGET_DIR: /tmp/target - - - name: Show sccache stats - run: /home/runner/.cargo/bin/sccache --show-stats + - uses: actions/checkout@v4 + + - name: Clone the Shuttle main repository + if: ${{ github.ref == 'refs/heads/develop' || github.base_ref == 'develop' }} + run: | + git clone --depth 1 --branch main https://github.com/shuttle-hq/shuttle.git /home/runner/shuttle + cd /home/runner/shuttle + git log -1 --format='%H' + + - name: Apply patches + if: ${{ github.ref == 'refs/heads/develop' || github.base_ref == 'develop' }} + run: /home/runner/shuttle/scripts/apply-patches.sh .cargo/config.toml /home/runner/shuttle + + - name: Install sccache + run: | + SCCACHE_VERSION='v0.7.7' + curl -L https://github.com/mozilla/sccache/releases/download/$SCCACHE_VERSION/sccache-$SCCACHE_VERSION-x86_64-unknown-linux-musl.tar.gz \ + | tar -xOz sccache-$SCCACHE_VERSION-x86_64-unknown-linux-musl/sccache \ + > /home/runner/.cargo/bin/sccache \ + && chmod +x /home/runner/.cargo/bin/sccache + + # bevy dependency + - run: sudo apt update && sudo apt install -y libasound2-dev libudev-dev + + - name: Check formatting and Clippy + shell: bash + run: _scripts/ci.sh ${{ matrix.from-to }} + env: + RUSTC_WRAPPER: /home/runner/.cargo/bin/sccache + CARGO_TARGET_DIR: /tmp/target + + - name: Show sccache stats + run: /home/runner/.cargo/bin/sccache --show-stats