Docs

Setup

Quickly get started with the project using create-light-cms

Create a fresh Nextjs project using create-light-cms

<package-manager> create light-cms@latest <project-name>

pnpm create light-cms@latest my-cms

Choose your ORM

As of now we only support drizzle, more integration are coming soon

Choose your database provider

Currently you get a choice between Truso and Supabase

? Choose database provider » - Use arrow-keys. Return to submit.
>   Turso
    Supabase (Postgres)

Choose your package manager

The script will use this package manager to install the dependencies and everything else

? Choose package manager » - Use arrow-keys. Return to submit.
>   pnpm
    npm
    bun

Enter the admin username and password

This is used to create one default user of the CMS panel

 Choose ORM » Drizzle
 Choose database provider » Turso
 Choose package manager » pnpm
 Admin username ... admin
? Admin password » ****

Enter the .env variables

// .env

TURSO_DATABASE_URL=
TURSO_AUTH_TOKEN=
ADMIN_USERNAME=admin
ADMIN_PASSWORD=1234
LIGHTCMS_SESSION_SECRET=change-me

Sync the DB with the schema

pnpm drizzle-kit push

Create the routes and their pageSchema.ts

/about demo route will be present. It is recommended that you plan the structure before starting development to avoid changing the schema again and again after generation as you may accidentally override files you didn't mean to

# you can use light-cms to create the pageSchema.ts for you so that you don't messup
pnpm dlx light-cms@latest create docs/setup

Generate the admin pages

When you are done with the pageSchema design, you can move on and generate the admin pages as well as dummy page.tsx

# if you wish to generate all
pnpm dlx light-cms generate --all

# if you wish to generate a particular slug
pnpm dlx light-cms generate --slug about

# if you wish to avoid the y/N choices to override and yolo the generate pass --yes flag
# use --dry-run flag to check what will be overriden

Run the dev server

Start the dev server and explore the new admin panel. Use the admin password and username you set during scaffolding

pnpm run dev

Checkout light-cms on npm