This is a starter Astro + Payload CMS project using Turborepo.
Astro allow you to use your favorite UI components and libraries. Mix and match React, Preact, Svelte, Vue, SolidJS, AlpineJS, and Lit to build your own website.
I need a headless CMS that is easy to use with TypeScript support. PayloadCMS work really well in this use case.
This Turborepo includes the following packages/apps:
api
: a Payload appweb
: an Astro appeslint-config-custom
:eslint
configurations (includeseslint-config-prettier
andeslint-configg-turbo
)
Each package/app is 100% TypeScript.
This Turborepo has some additional tools already setup for you:
- TypeScript for static type checking
- TailwindCSS for CSS utility
- ESLint for code linting
- Prettier for code formatting
Install nodejs
, pnpm
and turborepo
on your local machine
Create a .env
file in the root folder, you can use the .env.example
file as an example
I use pnpm
for this project.
Run the following command:
pnpm installl
pnpm dev
By default, the payloadCMS will run on port 3000, and Astro will be served on port 3001.
pnpm build
pnpm serve
To fully utilize the type safe features, manually generate the types for PayloadCMS by runng pnpm generate:types
Then, you can import the types easily as simple as
import type { User } from "@turbopress/api/types";