Skip to content

Seed Database

Populate your Stelo CMS database with sample data for development and testing.

Terminal window
npm run prisma:seed
Terminal window
npm run stelo:seed --type "pages"
npm run stelo:seed --type "collections"
npm run stelo:seed --type "users"
Terminal window
# Create admin user
npm run stelo:create-user \
--email "admin@example.com" \
--name "Admin User" \
--role "admin"
# Create editor
npm run stelo:create-user \
--email "editor@example.com" \
--name "Content Editor" \
--role "editor"
Terminal window
# Generate sample pages
npm run stelo:generate-pages --count 5 --multilingual
# Generate sample services
npm run stelo:generate-collections \
--type "service" \
--count 10 \
--with-images
Terminal window
npm run prisma:reset
Terminal window
npm run prisma:migrate:dev
Terminal window
npm run prisma:studio

Create custom seed scripts for specific project needs:

scripts/seed-custom.ts
import { prisma } from '../src/lib/prisma';
async function seedCustomData() {
// Custom seeding logic
}

This section will be expanded with detailed seeding documentation.