# Project structure

What create-smoodly-app puts in your project, and which files you change as you build the site. Everything is ordinary code in your repository; Smoodly adds a folder of setup and mounts the admin.

## The files

**Astro**

A single-language Lorem Co. site:

```
my-site/
├── astro.config.ts           the integration: smoodly() mounts the admin, the preview and the pages
├── src/
│   ├── layouts/Layout.astro  the site's document: head, header, footer
│   ├── page-types/           one .astro file per page type, by its name
│   ├── sections/             one .astro file per section
│   ├── elements/             one .astro file per element richtext may embed
│   ├── entry-pages/          one .astro file per collection with a path
│   ├── components/           every schema (Name.schema.ts) and the starter's helpers
│   ├── smoodly/              the Smoodly setup
│   ├── live.config.ts        Smoodly's content as live collections
│   ├── strings.ts, messages/ the starter's fixed UI text
│   └── styles/global.css
├── scripts/seed.ts           the starter content, written from code
├── public/images/            the starter's photos
└── .env                      the space's values
```

A multilingual site adds `i18n` to `astro.config.ts`, with the same locales as `src/smoodly/config.ts`; the site checks that they agree when it starts. The root holds the usual `package.json` and `tsconfig.json`, plus a `README.md`, and an `AGENTS.md` for coding agents that `CLAUDE.md` points to.

**Next.js**

A single-language Lorem Co. site:

```
my-site/
├── app/
│   ├── (site)/              the website
│   │   ├── layout.tsx
│   │   └── [[...path]]/page.tsx
│   ├── (smoodly)/admin/     the admin
│   ├── api/preview/route.ts draft previews on and off
│   └── globals.css
├── components/
│   ├── pages/               page types
│   ├── sections/            sections
│   ├── elements/            elements for richtext
│   └── …                    the starter's helpers: PageFrame, ArticleCard, strings,
│                            and articles.ts and news.ts for their URLs
├── messages/en.json         the starter's fixed UI text
├── smoodly/                 the Smoodly setup
├── scripts/seed.ts          the starter content, written from code
├── public/images/           the starter's photos
└── .env.local               the space's values
```

A multilingual site puts the website under `app/[locale]/` instead of `app/(site)/`, adds `i18n/` and `proxy.ts` for [next-intl](https://next-intl.dev), which handles the translated URLs, and a file in `messages/` per language. The root holds the usual `package.json`, `next.config.ts` and `tsconfig.json`, plus a `README.md`, and an `AGENTS.md` for coding agents that `CLAUDE.md` points to.

## The website

**Astro**

There are no route files. `smoodly()` in `astro.config.ts` serves the pages at every address a page file of your own under `src/pages/` does not take. It also mounts the admin at `/admin`, and the preview address editors see the canvas through. `src/pages/404.astro` is yours: the site's "not found" page.

To serve the admin somewhere other than `/admin`, see [The admin](https://smoodly.io/docs/getting-started/admin).

**Next.js**

The site's route is one file, and it needs no editing:

| Name | Description |
| --- | --- |
| `app/(site)/[[...path]]/page.tsx` | Every CMS URL: the home, every page at any depth and every collection entry. Smoodly finds the page by its URL, renders it with its page type, and Next keeps it cached until a publish expires it. |
| `app/(site)/layout.tsx` | The site's root layout: fonts, globals.css and the footer. Yours to change. |

The admin sits in its own route group as one route file and takes no layout, so the site's layout never wraps it. To serve it somewhere other than `/admin`, see [The admin](https://smoodly.io/docs/getting-started/admin).

## Your components

This is where you spend your time, in every framework.

**Astro**

Each section, element and page type is two files. `src/components/…/Name.schema.ts` holds the schema (the fields editors fill). A view named after the schema holds the markup: `src/sections/hero.astro` renders the section named `hero`.

| Name | Description |
| --- | --- |
| `src/page-types/` | One view per page type: which zones it renders and where. Lorem Co. has home, page, articlesIndex and newsIndex. |
| `src/sections/` | One view per section editors place in zones: hero, points, quote and the rest. The header and footer are sections too. |
| `src/elements/` | One view per element editors insert inside richtext, like callout and cta. |
| `src/entry-pages/` | One view per collection with a path: articles and news. |

A new section is its schema under `src/components/sections/`, the schema in `src/smoodly/sections.ts` and in the zone of each page type that may hold it, and its view in `src/sections/`. The site names a schema with no view, and a view with no schema, at the first request. [Sections](https://smoodly.io/docs/content-modeling/sections.md) shows how.

**Next.js**

Each section, element and page type is two files: `Name.schema.ts` holds the schema (the fields editors fill) and `Name.tsx` the React component that renders them.

| Name | Description |
| --- | --- |
| `components/pages/` | Page types: which zones a page has and what may go in them. Lorem Co. has Home, Page, Articles, Article, News and News post. |
| `components/sections/` | Sections editors place in zones: Hero, Points, Quote and the rest. The header and footer are sections too. |
| `components/elements/` | Small components editors insert inside richtext, like Callout and Cta. |

A new section is two files here, its schema in `smoodly/sections.ts`, its component in `smoodly/views.ts`, and its schema in the zone of each page type that may hold it. [Sections](https://smoodly.io/docs/content-modeling/sections.md) shows how.

## The Smoodly setup

**Astro**

| Name | Description |
| --- | --- |
| `src/smoodly/config.ts` | The registry and settings: the schemas of page types, sections, collections and globals, plus locales, time zone and styles, in one defineConfig(). It imports no view. |
| `src/smoodly/sections.ts` | The list of section schemas the config registers. |
| `src/smoodly/collections.ts` | Collections such as articles and people. |
| `src/smoodly/globals.ts` | Global content such as the header and footer. |
| `src/smoodly/elements.ts` | The list of element schemas richtext may embed. |
| `src/smoodly/toolsets.ts` | What each richtext field offers. |
| `src/live.config.ts` | One loader per collection, global item, the pages and the page tree. Your views read through getLiveCollection and getLiveEntry. |

You edit all of them as the site grows. There is no file of wiring: the integration in `astro.config.ts` reads the config and finds the views by their file names.

**Next.js**

| Name | Description |
| --- | --- |
| `smoodly/config.ts` | The registry and settings: the schemas of page types, sections, collections and globals, plus locales, time zone and styles, in one defineConfig(). It imports no component. |
| `smoodly/sections.ts` | The list of section schemas the config registers. |
| `smoodly/views.ts` | The components that render the registered schemas, and the entry pages. |
| `smoodly/collections.ts` | Collections such as articles and people. |
| `smoodly/globals.ts` | Global content such as the header and footer. |
| `smoodly/elements.ts` | The list of element schemas richtext may embed. |
| `smoodly/toolsets.ts` | What each richtext field offers. |
| `smoodly/richtext.tsx` | The site's richtext renderer, bound to its elements. |
| `smoodly/server.ts` | Reads content for the site, and exports content() for writing it from code. Server-only. |

You edit the first seven as the site grows. The last two are wiring you rarely touch. The admin itself is one route file, `app/(smoodly)/admin/[[...segments]]/route.ts`.

`scripts/seed.ts` is how the starter's content got there: a script that writes pages and entries under the same rules as the admin. [Content from code](https://smoodly.io/docs/getting-started/content-from-code.md) shows how to write your own.

Next, [make your first page](https://smoodly.io/docs/getting-started/first-page.md).
