Initial commit

This commit is contained in:
Alexander Bocken 2023-06-19 00:32:51 +02:00
parent c226daf9a0
commit be19e63970
Signed by: Alexander
GPG Key ID: 1D237BE83F9B05E8
281 changed files with 2199 additions and 0 deletions

65
+page.server.ts Normal file
View File

@ -0,0 +1,65 @@
import type { Actions, Load } from '@sveltejs/kit';
import { Recipe } from '../../../models/Recipe';
import { dbConnect, dbDisconnect } from '../../../utils/db';
import { redirect } from '@sveltejs/kit';
export const load: Load = async () => {
await dbConnect();
let todos = await Recipe.find().lean();
await dbDisconnect();
todos = JSON.parse(JSON.stringify(todos));
todos = todos.reverse();
return {
todos,
};
};
export const actions: Actions = {
create: async ({ request }) => {
const formData = await request.formData();
const todoName = formData.get('todoName');
const newTodo = {
title: todoName,
isDone: false,
};
await dbConnect();
await Recipe.create(newTodo);
await dbDisconnect();
console.log('New todo added: ', newTodo);
return {
success: true,
};
},
update: async ({ request }) => {
const formData = await request.formData();
const todoId = formData.get('todoId');
const todoName = formData.get('todoName');
await dbConnect();
await Recipe.findByIdAndUpdate(todoId, {
title: todoName,
}).lean();
await dbDisconnect();
console.log('Todo updated: ', todoId);
return {
success: true,
};
},
delete: async ({ request }) => {
const formData = await request.formData();
const todoId = formData.get('todoId');
await dbConnect();
await Recipe.findByIdAndDelete(todoId);
await dbDisconnect();
console.log('Todo deleted: ', todoId);
return {
success: true,
};
},
};

10
.gitignore vendored Normal file
View File

@ -0,0 +1,10 @@
.DS_Store
node_modules
/build
/.svelte-kit
/package
.env
.env.*
!.env.example
vite.config.js.timestamp-*
vite.config.ts.timestamp-*

2
.npmrc Normal file
View File

@ -0,0 +1,2 @@
engine-strict=true
resolution-mode=highest

38
README.md Normal file
View File

@ -0,0 +1,38 @@
# create-svelte
Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/master/packages/create-svelte).
## Creating a project
If you're seeing this, you've probably already done this step. Congrats!
```bash
# create a new project in the current directory
npm create svelte@latest
# create a new project in my-app
npm create svelte@latest my-app
```
## Developing
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
```bash
npm run dev
# or start the server and open the app in a new browser tab
npm run dev -- --open
```
## Building
To create a production version of your app:
```bash
npm run build
```
You can preview the production build with `npm run preview`.
> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment.

Binary file not shown.

After

Width:  |  Height:  |  Size: 209 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 229 KiB

BIN
lib/images/ajitama.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 190 KiB

BIN
lib/images/al_ragu.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 502 KiB

BIN
lib/images/anisbrot.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 388 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 264 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 127 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 236 KiB

BIN
lib/images/apfelwaehe.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 458 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 439 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 228 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 489 KiB

BIN
lib/images/brezel.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 300 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 284 KiB

BIN
lib/images/brotgewuerz.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 263 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 354 KiB

BIN
lib/images/burger_buns.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 200 KiB

BIN
lib/images/carbonara.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 224 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 270 KiB

BIN
lib/images/checca.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 312 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 495 KiB

BIN
lib/images/dinette.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 270 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 315 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 360 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 408 KiB

BIN
lib/images/fastenwaehe.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 289 KiB

BIN
lib/images/firecracker.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 236 KiB

BIN
lib/images/flammkuchen.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 383 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 286 KiB

BIN
lib/images/germknoedel.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 300 KiB

BIN
lib/images/gnocchi.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 582 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 KiB

BIN
lib/images/gurkensalat.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 192 KiB

BIN
lib/images/hashbrown.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 329 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 260 KiB

BIN
lib/images/hollondaise.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 207 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 339 KiB

BIN
lib/images/hummus.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 127 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 188 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 246 KiB

BIN
lib/images/kasnudeln.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 KiB

BIN
lib/images/kirschwaehe.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 511 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 283 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 395 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 135 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 231 KiB

BIN
lib/images/kottbullar.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 288 KiB

BIN
lib/images/kraftbruehe.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 93 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 224 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 625 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 KiB

BIN
lib/images/lauchquiche.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 287 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 300 KiB

12
lib/images/load_html.js Normal file
View File

@ -0,0 +1,12 @@
document.querySelectorAll('.url_insert').forEach(url_insert);
function url_insert(el) {
var url = el.dataset.url;
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
el.innerHTML = this.response;
}
};
xhttp.open("GET", url, true);
xhttp.send();
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 230 KiB

BIN
lib/images/maronisuppe.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 315 KiB

BIN
lib/images/masalachai.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 KiB

BIN
lib/images/mayonnaise.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 275 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 461 KiB

BIN
lib/images/orecchiette.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 180 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 295 KiB

BIN
lib/images/osterkuchen.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 452 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 45 KiB

BIN
lib/images/osterlamm.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 266 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 KiB

BIN
lib/images/pilze.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 270 KiB

BIN
lib/images/pizokel.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 419 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 331 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 258 KiB

BIN
lib/images/plunderteig.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 236 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 521 KiB

BIN
lib/images/pressgurken.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 360 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 354 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 197 KiB

BIN
lib/images/randensalat.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 KiB

BIN
lib/images/ratatouille.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 497 KiB

BIN
lib/images/reindling.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 225 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 330 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 409 KiB

BIN
lib/images/roesti.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 372 KiB

BIN
lib/images/rotkraut.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 251 KiB

BIN
lib/images/ruchbrot.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 KiB

BIN
lib/images/rustikal.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 645 KiB

BIN
lib/images/sachertorte.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 217 KiB

Some files were not shown because too many files have changed in this diff Show More