// src/_mock/_blog.ts import { PrismaClient } from '@prisma/client'; const prisma = new PrismaClient(); import { uuidv4 } from './utils/uuidv4'; import { _mock } from './_mock'; import { CONFIG } from './global-config'; import { _tags } from './assets'; const codeBlock = `
for (var i=1; i <= 20; i++) {\n  if (i % 15 == 0)\n    return "FizzBuzz"\n  else if (i % 3 == 0)\n    return "Fizz"\n  else if (i % 5 == 0)\n    return "Buzz"\n  else\n    return i\n  }
`; // Made with Tiptap editor const CONTENT = `

Heading H1

Heading H2

Heading H3

Heading H4

Heading H5
Heading H6

Paragraph

What is MTAweb Directory?

So you have heard about this site or you have been to it, but you cannot figure out what it is or what it can do. MTA web directory is the simplest way in which one can bid on a link, or a few links if they wish to do so. The link directory on MTA displays all of the links it currently has, and does so in alphabetical order, which makes it much easier for someone to find what they are looking for if it is something specific and they do not want to go through all the other sites and links as well. It allows you to start your bid at the bottom and slowly work your way to the top of the list.

With a very low costing starting bid of just $1, you are guaranteed to have a spot in MTA’s successful directory list. When you would like to increase your bid to one of the top positions, you have to know that this would be a wise decision to make as it will not only get your link to be at a higher point in the directory but it will also give you a chance to have your site advertised with the rest of the top ten on the home page of the website. This means that when visitors come to MTAweb.com, your site will be one of the first things they see. In other words, you stand a great chance at getting a comeback to your site sooner than you thought.

This is strong text.

This is italic text

This is underline text

Unordered list

Ordered list

  1. Analysis

  2. Design

  3. Implementation

Blockquote

Life is short, Smile while you still have teeth! 


Block code

${codeBlock}

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.

Why do we use it?

It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).

It is important that you buy links because the links are what get you the results that you want. The popularity of the links that are listed in the MTA directory is in fact one of the most important factors in the performance of the search engine. Links are important and this is why you have to purchase a link in order to bid on something and the best part is that a link will only cost you $1, which is nothing compared to what you would pay if you decided to do it through any other company or website.

`; const generateComments = () => { const userList = Array.from({ length: 12 }, (_, index) => ({ id: _mock.id(index), name: _mock.fullName(index), avatarUrl: _mock.image.avatar(index) })); return [ { // id: uuidv4(), name: userList[0].name, avatarUrl: userList[0].avatarUrl, message: _mock.sentence(1), postedAt: _mock.time(1), users: [userList[0], userList[1], userList[2]], replyComment: [ { id: uuidv4(), userId: userList[1].id, message: _mock.sentence(2), postedAt: _mock.time(2) }, { id: uuidv4(), userId: userList[0].id, message: _mock.sentence(3), tagUser: userList[1].name, postedAt: _mock.time(3) }, { id: uuidv4(), userId: userList[2].id, message: _mock.sentence(4), postedAt: _mock.time(4) } ] }, { // id: uuidv4(), name: userList[4].name, avatarUrl: userList[4].avatarUrl, message: _mock.sentence(5), postedAt: _mock.time(5), users: [userList[5], userList[6], userList[7]], replyComment: [ { id: uuidv4(), userId: userList[5].id, message: _mock.sentence(6), postedAt: _mock.time(6) }, { id: uuidv4(), userId: userList[6].id, message: _mock.sentence(7), postedAt: _mock.time(7) }, { id: uuidv4(), userId: userList[7].id, message: _mock.sentence(8), postedAt: _mock.time(8) } ] }, { // id: uuidv4(), name: userList[8].name, avatarUrl: userList[8].avatarUrl, message: _mock.sentence(9), postedAt: _mock.time(9), users: [], replyComment: [] }, { // id: uuidv4(), name: userList[9].name, avatarUrl: userList[9].avatarUrl, message: _mock.sentence(10), postedAt: _mock.time(10), users: [], replyComment: [] } ]; }; const _posts = () => Array.from({ length: 19 }, (_, index) => { const comments = generateComments(); const publish = index % 3 ? 'published' : 'draft'; const metaKeywords = _tags.slice(8, 11); return { // id: _mock.id(index), publish, metaKeywords, content: CONTENT, tags: _tags.slice(0, 5), metaTitle: 'Minimal UI Kit', createdAt: _mock.time(index), title: _mock.postTitle(index), coverUrl: _mock.image.cover(index), totalViews: _mock.number.nativeL(index), totalShares: _mock.number.nativeL(index + 2), totalComments: _mock.number.nativeL(index + 1), totalFavorites: _mock.number.nativeL(index + 3), metaDescription: 'The starting point for your next project with Minimal UI Kit', description: `Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. `, author: { name: _mock.fullName(index), avatarUrl: _mock.image.avatar(index) }, favoritePerson: Array.from({ length: 20 }, (__, personIndex) => ({ name: _mock.fullName(personIndex), avatarUrl: _mock.image.avatar(personIndex) })), // comments: { create: comments } }; }); const temp_posts = _posts(); async function blog() { for (let i = 0; i < temp_posts.length; i++) { await prisma.postItem.upsert({ where: { id: i }, update: {}, create: temp_posts[i] }); } console.log('generate blog-postitem done'); } const Blog = blog() .then(async () => { await prisma.$disconnect(); }) .catch(async (e) => { console.error(e); await prisma.$disconnect(); process.exit(1); }); export { Blog };