30546/backend/src/db/seeders/20231127130745-sample-data.js
2025-04-07 16:58:49 +00:00

366 lines
7.0 KiB
JavaScript

const db = require('../models');
const Users = db.users;
const Blogs = db.blogs;
const Contacts = db.contacts;
const Events = db.events;
const Images = db.images;
const NewsUpdates = db.news_updates;
const Projects = db.projects;
const Testimonials = db.testimonials;
const BlogsData = [
{
title: 'Introduction to Data Science',
content: 'Data science is a field that uses scientific methods...',
published_date: new Date('2023-10-01T10:00:00Z'),
},
{
title: 'Building RESTful APIs with Node.js',
content: 'Node.js is a powerful tool for building APIs...',
published_date: new Date('2023-09-15T12:00:00Z'),
},
{
title: 'Understanding Machine Learning',
content: 'Machine learning is a subset of artificial intelligence...',
published_date: new Date('2023-08-20T14:00:00Z'),
},
{
title: 'Frontend Development with React',
content:
'React is a popular JavaScript library for building user interfaces...',
published_date: new Date('2023-07-10T09:00:00Z'),
},
{
title: 'Database Design Best Practices',
content: 'Designing a database requires careful planning...',
published_date: new Date('2023-06-05T11:00:00Z'),
},
];
const ContactsData = [
{
name: 'John Doe',
email: 'john.doe@example.com',
subject: 'Project Inquiry',
message: 'I am interested in collaborating on a project.',
},
{
name: 'Jane Smith',
email: 'jane.smith@example.com',
subject: 'Feedback',
message: 'Great work on your portfolio!',
},
{
name: 'Alice Johnson',
email: 'alice.johnson@example.com',
subject: 'Job Opportunity',
message: 'We have a job opening that might interest you.',
},
{
name: 'Bob Brown',
email: 'bob.brown@example.com',
subject: 'Networking',
message: "Let's connect and discuss potential collaborations.",
},
{
name: 'Charlie Davis',
email: 'charlie.davis@example.com',
subject: 'Event Invitation',
message: 'You are invited to speak at our upcoming event.',
},
];
const EventsData = [
{
name: 'Tech Conference 2023',
start_date: new Date('2023-11-10T09:00:00Z'),
end_date: new Date('2023-11-12T17:00:00Z'),
},
{
name: 'Data Science Workshop',
start_date: new Date('2023-12-05T10:00:00Z'),
end_date: new Date('2023-12-05T16:00:00Z'),
},
{
name: 'Web Development Bootcamp',
start_date: new Date('2024-01-15T09:00:00Z'),
end_date: new Date('2024-01-20T17:00:00Z'),
},
{
name: 'AI Symposium',
start_date: new Date('2024-02-10T09:00:00Z'),
end_date: new Date('2024-02-11T17:00:00Z'),
},
{
name: 'Startup Pitch Night',
start_date: new Date('2024-03-05T18:00:00Z'),
end_date: new Date('2024-03-05T21:00:00Z'),
},
];
const ImagesData = [
{
url: 'https://example.com/image1.jpg',
description: 'Project screenshot 1',
},
{
url: 'https://example.com/image2.jpg',
description: 'Project screenshot 2',
},
{
url: 'https://example.com/image3.jpg',
description: 'Project screenshot 3',
},
{
url: 'https://example.com/image4.jpg',
description: 'Project screenshot 4',
},
{
url: 'https://example.com/image5.jpg',
description: 'Project screenshot 5',
},
];
const NewsUpdatesData = [
{
title: 'Portfolio Website Launched',
content: 'Excited to announce the launch of my new portfolio website.',
date: new Date('2023-10-01T10:00:00Z'),
},
{
title: 'New Blog Post: Data Science',
content: 'Check out my latest blog post on data science.',
date: new Date('2023-09-15T12:00:00Z'),
},
{
title: 'Speaking at Tech Conference',
content: 'I will be speaking at the upcoming Tech Conference 2023.',
date: new Date('2023-08-20T14:00:00Z'),
},
{
title: 'Workshop on Web Development',
content: 'Join me for a workshop on modern web development techniques.',
date: new Date('2023-07-10T09:00:00Z'),
},
{
title: 'Collaboration with Tech Company',
content:
'Excited to collaborate with a leading tech company on a new project.',
date: new Date('2023-06-05T11:00:00Z'),
},
];
const ProjectsData = [
{
title: 'Personal Portfolio Website',
description: 'A website to showcase my projects and skills.',
github_link: 'https://github.com/matiullah/portfolio',
demo_video: 'https://youtu.be/demo1',
// type code here for "relation_many" field
},
{
title: 'Data Analysis with Python',
description: 'Analyzing datasets using Python and Pandas.',
github_link: 'https://github.com/matiullah/data-analysis',
demo_video: 'https://youtu.be/demo2',
// type code here for "relation_many" field
},
{
title: 'E-commerce Platform',
description: 'A full-stack e-commerce application.',
github_link: 'https://github.com/matiullah/ecommerce',
demo_video: 'https://youtu.be/demo3',
// type code here for "relation_many" field
},
{
title: 'Machine Learning Model',
description: 'Building a predictive model using scikit-learn.',
github_link: 'https://github.com/matiullah/ml-model',
demo_video: 'https://youtu.be/demo4',
// type code here for "relation_many" field
},
{
title: 'Chat Application',
description: 'A real-time chat application using WebSockets.',
github_link: 'https://github.com/matiullah/chat-app',
demo_video: 'https://youtu.be/demo5',
// type code here for "relation_many" field
},
];
const TestimonialsData = [
{
author: 'Emily White',
content: 'Matiullah is a dedicated and skilled professional.',
},
{
author: 'Michael Green',
content: 'Working with Matiullah was a great experience.',
},
{
author: 'Sophia Black',
content: 'Highly recommend Matiullah for any data science projects.',
},
{
author: 'David Blue',
content: "Matiullah's portfolio is impressive and well-organized.",
},
{
author: 'Olivia Grey',
content: 'A pleasure to collaborate with Matiullah on various projects.',
},
];
// Similar logic for "relation_many"
// Similar logic for "relation_many"
module.exports = {
up: async (queryInterface, Sequelize) => {
await Blogs.bulkCreate(BlogsData);
await Contacts.bulkCreate(ContactsData);
await Events.bulkCreate(EventsData);
await Images.bulkCreate(ImagesData);
await NewsUpdates.bulkCreate(NewsUpdatesData);
await Projects.bulkCreate(ProjectsData);
await Testimonials.bulkCreate(TestimonialsData);
await Promise.all([
// Similar logic for "relation_many"
// Similar logic for "relation_many"
]);
},
down: async (queryInterface, Sequelize) => {
await queryInterface.bulkDelete('blogs', null, {});
await queryInterface.bulkDelete('contacts', null, {});
await queryInterface.bulkDelete('events', null, {});
await queryInterface.bulkDelete('images', null, {});
await queryInterface.bulkDelete('news_updates', null, {});
await queryInterface.bulkDelete('projects', null, {});
await queryInterface.bulkDelete('testimonials', null, {});
},
};