Skip to content

Latest commit

 

History

History
420 lines (368 loc) · 15.2 KB

index.mdx

File metadata and controls

420 lines (368 loc) · 15.2 KB
mode custom
title Welcome
description Build on Stellar with guides, APIs, tools, and platform docs for apps, smart contracts, tokens, data, and network infrastructure.

export const HeroDotBackground = () => { const canvasRef = useRef(null)

useEffect(() => { if (typeof window === "undefined") return

const canvas = canvasRef.current
if (!canvas) return

const context = canvas.getContext("2d")
if (!context) return

const desktopPoints = [
  { x: 0.06, y: 0.84 },
  { x: 0.28, y: 0.5 },
  { x: 0.56, y: 0.16 },
]
const mobilePoints = [
  { x: 0.1, y: 0.82 },
  { x: 0.32, y: 0.56 },
]
const lightDotColor = "#7D73B2"
const darkDotColor = "#FFDA00"
const clamp = (value, min, max) => Math.min(Math.max(value, min), max)
const lerp = (start, end, progress) => start + (end - start) * progress
const getBasePoints = (width) =>
  width < 768 ? mobilePoints : desktopPoints
const getJitteredPoints = (points, width) => {
  const spread = width < 768 ? 0.05 : 0.09

  return points.map((point) => ({
    x: clamp(point.x + (Math.random() - 0.5) * spread * 2, 0, 1),
    y: clamp(point.y + (Math.random() - 0.5) * spread * 2, 0, 1),
  }))
}
const isDarkMode = () =>
  document.documentElement.classList.contains("dark") ||
  document.documentElement.getAttribute("data-theme") === "dark"

let frameId = 0
let timeoutId = 0
let animationStart = 0
let width = 0
let height = 0
let currentPoints = getBasePoints(window.innerWidth)
let startPoints = currentPoints
let endPoints = currentPoints
let reducedMotion = false

const motionQuery = window.matchMedia("(prefers-reduced-motion: reduce)")
const syncReducedMotion = () => {
  reducedMotion = motionQuery.matches
}

const draw = (points) => {
  if (!width || !height) return

  const limitedWidth = Math.min(width, 1440)
  const offsetX = (width - limitedWidth) / 2
  const dropOff = width < 768 ? 260 : 500
  const spacing = width < 768 ? 12 : 10
  const baseRadius = width < 768 ? 3.4 : 4

  context.clearRect(0, 0, width, height)
  context.fillStyle = isDarkMode() ? darkDotColor : lightDotColor
  context.globalAlpha = isDarkMode() ? 0.18 : 0.32

  const mappedPoints = points.map((point) => ({
    x: offsetX + point.x * limitedWidth,
    y: point.y * height,
  }))

  for (let x = -20; x <= width + 20; x += spacing) {
    for (let y = -20; y <= height + 20; y += spacing) {
      let scale = 0

      mappedPoints.forEach((point) => {
        const dx = x - point.x
        const dy = y - point.y
        const distance = Math.sqrt(dx * dx + dy * dy)
        const pointScale = Math.pow(
          1 - Math.min(distance / dropOff, 1),
          0.4
        )

        scale = Math.max(scale, pointScale)
      })

      if (scale <= 0.02) continue

      context.beginPath()
      context.arc(x, y, baseRadius * scale, 0, Math.PI * 2)
      context.fill()
    }
  }
}

const resizeCanvas = () => {
  const rect = canvas.getBoundingClientRect()
  width = rect.width
  height = rect.height

  const dpr = window.devicePixelRatio || 1
  canvas.width = Math.round(width * dpr)
  canvas.height = Math.round(height * dpr)
  context.setTransform(dpr, 0, 0, dpr, 0, 0)

  currentPoints = getBasePoints(width).map((point) => ({ ...point }))
  startPoints = currentPoints.map((point) => ({ ...point }))
  endPoints = getJitteredPoints(currentPoints, width)
  draw(currentPoints)
}

const animateToNextState = (timestamp) => {
  if (!animationStart) animationStart = timestamp

  const progress = Math.min((timestamp - animationStart) / 1200, 1)
  currentPoints = startPoints.map((point, index) => ({
    x: lerp(point.x, endPoints[index].x, progress),
    y: lerp(point.y, endPoints[index].y, progress),
  }))

  draw(currentPoints)

  if (progress < 1) {
    frameId = window.requestAnimationFrame(animateToNextState)
    return
  }

  animationStart = 0
  startPoints = currentPoints.map((point) => ({ ...point }))
  endPoints = getJitteredPoints(currentPoints, width)
  timeoutId = window.setTimeout(() => {
    frameId = window.requestAnimationFrame(animateToNextState)
  }, 140)
}

const startAnimation = () => {
  window.clearTimeout(timeoutId)
  window.cancelAnimationFrame(frameId)
  animationStart = 0

  if (reducedMotion) {
    currentPoints = getBasePoints(width).map((point) => ({ ...point }))
    draw(currentPoints)
    return
  }

  startPoints = currentPoints.map((point) => ({ ...point }))
  endPoints = getJitteredPoints(currentPoints, width)
  frameId = window.requestAnimationFrame(animateToNextState)
}

const handleMotionChange = () => {
  syncReducedMotion()
  startAnimation()
}

syncReducedMotion()

const resizeObserver = new ResizeObserver(() => {
  resizeCanvas()
  startAnimation()
})
resizeObserver.observe(canvas)

const themeObserver = new MutationObserver(() => {
  draw(currentPoints)
})
themeObserver.observe(document.documentElement, {
  attributes: true,
  attributeFilter: ["class", "data-theme"],
})

if (motionQuery.addEventListener) {
  motionQuery.addEventListener("change", handleMotionChange)
} else {
  motionQuery.addListener(handleMotionChange)
}

resizeCanvas()
startAnimation()

return () => {
  window.clearTimeout(timeoutId)
  window.cancelAnimationFrame(frameId)
  resizeObserver.disconnect()
  themeObserver.disconnect()

  if (motionQuery.removeEventListener) {
    motionQuery.removeEventListener("change", handleMotionChange)
  } else {
    motionQuery.removeListener(handleMotionChange)
  }
}

}, [])

return (

) }

Build blockchain apps, payments, and smart contracts on Stellar

Explore end-to-end guides, API references, developer tools, network docs, and production platforms for building on Stellar with confidence.

Quick Start

Get a working Stellar development flow in place, fund a test account, and choose the track that fits your product.

Start with [Quickstart](/docs/tools/quickstart) if you want a local Stellar environment, or jump into the [Build overview](/docs/build) if you want tutorials and implementation guides first.
    ```bash
    docker run --rm -it stellar/quickstart --standalone
    ```
  </Step>
  <Step title="Set up a test account">
    Use [Stellar Lab](/docs/tools/lab/account) or Friendbot on [Testnet](/docs/networks) to create and fund an account before you test transactions, smart contracts, or wallet flows.

    <Accordion title="Example Friendbot response">
      ```json
      {
        "successful": true,
        "network": "testnet",
        "account": "G..."
      }
      ```
    </Accordion>
  </Step>
  <Step title="Make your first call">
    Choose an integration surface based on your use case: [RPC](/docs/data/apis/rpc) for real-time app and contract workflows, [Horizon](/docs/data/apis/horizon) for legacy integrations, or [SDKs](/docs/tools/sdks) if you want a language-specific developer experience.
  </Step>
  <Step title="Pick a build path">
    Use [Smart Contract Getting Started](/docs/build/smart-contracts/getting-started), [Applications](/docs/build/apps), or [Tokens](/docs/tokens) depending on whether you are shipping onchain logic, a wallet or app, or asset issuance flows.
  </Step>
</Steps>

Explore Docs

Jump straight into the major areas of the site, from hands-on implementation to infrastructure and ecosystem services.

Use RPC, Horizon, analytics, and indexer documentation to retrieve network data, submit transactions, and power applications. Go from first prototype to production with smart contract tutorials, application guides, and task-focused implementation docs. Find platform docs, developer tools, network references, and validator guidance for running Stellar in real-world environments.

Popular Paths

Start with curated entry points for common Stellar product and infrastructure workflows.

Install the toolchain, compile Wasm, deploy to Testnet, and learn the contract model from the ground up. Explore frontend, wallet, passkey, and example-app documentation to assemble a complete user experience. Use Stellar RPC for transaction submission, simulation, event retrieval, and contract-related app workflows. Walk through asset issuance, trustlines, distribution, and publishing asset metadata for discoverability.

Resources

Get help, stay current, and connect with the broader Stellar developer ecosystem.

Ask implementation questions, follow ecosystem conversations, and connect with other Stellar builders. Keep up with release notes, ecosystem announcements, and platform updates from the Stellar team. Discover IDEs, explorers, analytics services, wallets, and other tools used across the ecosystem.

Ready to build on Stellar?

Start with a local network, walk through a first integration, and use the docs as your reference all the way to production deployment.