Skip to content
AtMyApp Docs
Go to AtMyApp
Open with AI

Examples

Use these examples as starting points for real projects.

Start with the complete JavaScript integration or Astro setup. These schemas illustrate alternative content models; migrate them and create real content before reading it.

import { defineDocument, defineSchema, s } from "@atmyapp/structure";
export default defineSchema({
definitions: {
settings: defineDocument({
fields: {
siteTitle: s.string({ default: "My Website" }),
supportEmail: s.string({ format: "email" }),
},
}),
},
});
import {
defineCollection,
defineDocument,
defineSchema,
s,
} from "@atmyapp/structure";
export default defineSchema({
definitions: {
authors: defineCollection({
fields: {
name: s.string(),
avatar: s.image({ optional: true }),
},
}),
posts: defineCollection({
fields: {
title: s.string({ min: 3 }),
slug: s.slug({ source: "title" }),
excerpt: s.string({ format: "long", default: "" }),
cover: s.image({ optional: true }),
publishedAt: s.date({ optional: true }),
},
}),
home: defineDocument({
fields: {
headline: s.string(),
intro: s.string({ format: "long" }),
},
}),
},
});
Terminal window
atmyapp use --token cli_... --url https://edge.atmyapp.com/projects/your-project-id
atmyapp init --template blog
atmyapp migrate --dry-run --verbose
atmyapp migrate