-
Notifications
You must be signed in to change notification settings - Fork 0
/
initdb.js
199 lines (171 loc) · 5.81 KB
/
initdb.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
const sql = require('better-sqlite3');
const db = sql('meals.db');
const dummyMeals = [
{
title: 'Juicy Cheese Burger',
slug: 'juicy-cheese-burger',
image: '/images/burger.jpg',
summary:
'A mouth-watering burger with a juicy beef patty and melted cheese, served in a soft bun.',
instructions: `
1. Prepare the patty:
Mix 200g of ground beef with salt and pepper. Form into a patty.
2. Cook the patty:
Heat a pan with a bit of oil. Cook the patty for 2-3 minutes each side, until browned.
3. Assemble the burger:
Toast the burger bun halves. Place lettuce and tomato on the bottom half. Add the cooked patty and top with a slice of cheese.
4. Serve:
Complete the assembly with the top bun and serve hot.
`,
creator: 'John Doe',
creator_email: '[email protected]',
},
{
title: 'Spicy Curry',
slug: 'spicy-curry',
image: '/images/curry.jpg',
summary:
'A rich and spicy curry, infused with exotic spices and creamy coconut milk.',
instructions: `
1. Chop vegetables:
Cut your choice of vegetables into bite-sized pieces.
2. Sauté vegetables:
In a pan with oil, sauté the vegetables until they start to soften.
3. Add curry paste:
Stir in 2 tablespoons of curry paste and cook for another minute.
4. Simmer with coconut milk:
Pour in 500ml of coconut milk and bring to a simmer. Let it cook for about 15 minutes.
5. Serve:
Enjoy this creamy curry with rice or bread.
`,
creator: 'Max Schwarz',
creator_email: '[email protected]',
},
{
title: 'Homemade Dumplings',
slug: 'homemade-dumplings',
image: '/images/dumplings.jpg',
summary:
'Tender dumplings filled with savory meat and vegetables, steamed to perfection.',
instructions: `
1. Prepare the filling:
Mix minced meat, shredded vegetables, and spices.
2. Fill the dumplings:
Place a spoonful of filling in the center of each dumpling wrapper. Wet the edges and fold to seal.
3. Steam the dumplings:
Arrange dumplings in a steamer. Steam for about 10 minutes.
4. Serve:
Enjoy these dumplings hot, with a dipping sauce of your choice.
`,
creator: 'Emily Chen',
creator_email: '[email protected]',
},
{
title: 'Classic Mac n Cheese',
slug: 'classic-mac-n-cheese',
image: '/images/macncheese.jpg',
summary:
"Creamy and cheesy macaroni, a comforting classic that's always a crowd-pleaser.",
instructions: `
1. Cook the macaroni:
Boil macaroni according to package instructions until al dente.
2. Prepare cheese sauce:
In a saucepan, melt butter, add flour, and gradually whisk in milk until thickened. Stir in grated cheese until melted.
3. Combine:
Mix the cheese sauce with the drained macaroni.
4. Bake:
Transfer to a baking dish, top with breadcrumbs, and bake until golden.
5. Serve:
Serve hot, garnished with parsley if desired.
`,
creator: 'Laura Smith',
creator_email: '[email protected]',
},
{
title: 'Authentic Pizza',
slug: 'authentic-pizza',
image: '/images/pizza.jpg',
summary:
'Hand-tossed pizza with a tangy tomato sauce, fresh toppings, and melted cheese.',
instructions: `
1. Prepare the dough:
Knead pizza dough and let it rise until doubled in size.
2. Shape and add toppings:
Roll out the dough, spread tomato sauce, and add your favorite toppings and cheese.
3. Bake the pizza:
Bake in a preheated oven at 220°C for about 15-20 minutes.
4. Serve:
Slice hot and enjoy with a sprinkle of basil leaves.
`,
creator: 'Mario Rossi',
creator_email: '[email protected]',
},
{
title: 'Wiener Schnitzel',
slug: 'wiener-schnitzel',
image: '/images/schnitzel.jpg',
summary:
'Crispy, golden-brown breaded veal cutlet, a classic Austrian dish.',
instructions: `
1. Prepare the veal:
Pound veal cutlets to an even thickness.
2. Bread the veal:
Coat each cutlet in flour, dip in beaten eggs, and then in breadcrumbs.
3. Fry the schnitzel:
Heat oil in a pan and fry each schnitzel until golden brown on both sides.
4. Serve:
Serve hot with a slice of lemon and a side of potato salad or greens.
`,
creator: 'Franz Huber',
creator_email: '[email protected]',
},
{
title: 'Fresh Tomato Salad',
slug: 'fresh-tomato-salad',
image: '/images/tomato-salad.jpg',
summary:
'A light and refreshing salad with ripe tomatoes, fresh basil, and a tangy vinaigrette.',
instructions: `
1. Prepare the tomatoes:
Slice fresh tomatoes and arrange them on a plate.
2. Add herbs and seasoning:
Sprinkle chopped basil, salt, and pepper over the tomatoes.
3. Dress the salad:
Drizzle with olive oil and balsamic vinegar.
4. Serve:
Enjoy this simple, flavorful salad as a side dish or light meal.
`,
creator: 'Sophia Green',
creator_email: '[email protected]',
},
];
db.prepare(`
CREATE TABLE IF NOT EXISTS meals (
id INTEGER PRIMARY KEY AUTOINCREMENT,
slug TEXT NOT NULL UNIQUE,
title TEXT NOT NULL,
image TEXT NOT NULL,
summary TEXT NOT NULL,
instructions TEXT NOT NULL,
creator TEXT NOT NULL,
creator_email TEXT NOT NULL
)
`).run();
async function initData() {
const stmt = db.prepare(`
INSERT INTO meals VALUES (
null,
@slug,
@title,
@image,
@summary,
@instructions,
@creator,
@creator_email
)
`);
for (const meal of dummyMeals) {
stmt.run(meal);
}
}
initData();