Skip to content

vueschool/generating-fake-data-with-faker-js

Repository files navigation

Nuxt FakerJS Seeder Project

This repository contains a Nuxt.js project designed to teach users how to utilize FakerJS for data seeding in a SQLite database.

Features

  • FakerJS Integration: Learn how to generate fake data using FakerJS.
  • Nitro Tasks: Leverage Nitro Tasks UI within the Nuxt DevTools, to run the seeder in the server.
  • Nuxt Prisma Module: Setup prisma for database interactions, and use Nuxt DevTools to visualise your Prisma models.

Getting Started

To get started with this project, follow the steps below:

  1. Install dependencies
# pnpm
pnpm install

# npm
npm install
  1. Setup the environment file
cp .env.example .env
  1. Initialize your database
pnpx prisma migrate dev
  1. Run the development server
# pnpm
pnpm dev

# npm
npm run dev
  1. Access the Application:

Open your browser and go to http://localhost:3000 to access the application.

  1. Opening the Server Tasks and Prisma Dashboards:

First open the Nuxt DevTools by clicking on the Nuxt icon at the bottom of the page:

image

Then from within the DevTools, click on the 3 vertical dots:

image

The Server Tasks and Prisma Dashboards are available upon pressing these buttons:

image
  1. Running just the Seeder:
  • Within the Server Tasks dashboard click on "db:seed"
  • Press "Run Task"
  • By default the runner used is "pnpx", if you want to use a different runner (e.g. npx), you can do so by passing a runner payload to the task.
image

About

Source Code for the Course Generating Fake Data with Faker.js

Resources

Stars

Watchers

Forks

Packages

No packages published