Docs
Import Data

Import Demo Data

This guide will help you import demo data into your Neon PostgreSQL database using Prisma. The demo data helps you get started with CozyCommerce.

Prerequisites

Before importing the demo data, make sure you have:

  1. Set up your Neon PostgreSQL database
  2. Configured your .env file with the DATABASE_URL
  3. Installed all project dependencies

Installation

First, install the required dependencies:

npm install @prisma/client
npm install prisma --save-dev

Database Setup

  1. Initialize Prisma in your project (if not already done):
npx prisma init
  1. Generate the Prisma client:
npx prisma generate
  1. Create and apply the database migrations:
npx prisma migrate dev

Importing Demo Data

We've provided a script to import demo data into your database.

To run the import script:

npm run import-demo-data
⚠️

Warning: This script will delete all existing data in your database before importing the demo data. Make sure to backup your data if needed.