ARCHE
FamiliesLive demoDocsExamplesBlogGitHub ↗
Generated patterns

Code the CLI actually writes

Illustrative snippets aligned with Arche presets—not a live sandbox. For live API calls, use /live. For full flows, start with getting started or a walkthrough.

TypeScript fullstack

tRPC procedure

Typed API with Zod input and protected context.

import { z } from "zod";
import { protectedProcedure, router } from "../trpc";

export const userRouter = router({
  getProfile: protectedProcedure
    .input(z.object({ id: z.string() }))
    .query(async ({ ctx, input }) => {
      return ctx.db.user.findUnique({
        where: { id: input.id },
      });
    }),
});

Convex product

Convex query

Server function consumed from Next.js.

import { query } from "./_generated/server";
import { v } from "convex/values";

export const listPosts = query({
  args: {},
  handler: async (ctx) => {
    return await ctx.db.query("posts").collect();
  },
});

Rust API

Axum handler

HTTP route in the generated API crate.

use axum::{Json, Router, routing::get};
use serde::Serialize;

#[derive(Serialize)]
struct Health { ok: bool }

async fn health() -> Json<Health> {
    Json(Health { ok: true })
}

pub fn router() -> Router {
    Router::new().route("/health", get(health))
}

Solana

Anchor program

On-chain program entry pattern.

use anchor_lang::prelude::*;

declare_id!("ReplaceWithProgramId");

#[program]
pub mod my_program {
    use super::*;
    pub fn initialize(ctx: Context<Initialize>) -> Result<()> {
        Ok(())
    }
}

CLI automation

create-json

Non-interactive scaffold payload.

{
  "projectName": "my-app",
  "destinationDir": "/tmp/my-app",
  "preset": "typescript-fullstack",
  "packageManager": "bun",
  "initializeGit": false,
  "installDependencies": false
}