use new sveltekit project

This commit is contained in:
2025-01-07 13:30:55 +01:00
parent 872b3768a2
commit 2131df26b2
58 changed files with 4908 additions and 8063 deletions

3
packages/web/src/app.css Normal file
View File

@@ -0,0 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

13
packages/web/src/app.d.ts vendored Normal file
View File

@@ -0,0 +1,13 @@
// See https://kit.svelte.dev/docs/types#app
// for information about these interfaces
declare global {
namespace App {
// interface Error {}
// interface Locals {}
// interface PageData {}
// interface PageState {}
// interface Platform {}
}
}
export {};

15
packages/web/src/app.html Normal file
View File

@@ -0,0 +1,15 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
%sveltekit.head%
</head>
<body data-sveltekit-preload-data="hover">
<div style="display: contents">%sveltekit.body%</div>
</body>
</html>

View File

@@ -0,0 +1,7 @@
import { describe, it, expect } from 'vitest';
describe('sum test', () => {
it('adds 1 + 2 to equal 3', () => {
expect(1 + 2).toBe(3);
});
});

View File

@@ -0,0 +1,6 @@
import { drizzle } from 'drizzle-orm/postgres-js';
import postgres from 'postgres';
import { DATABASE_URL } from '$env/static/private';
const client = postgres(DATABASE_URL);
export const db = drizzle(client, {});

View File

@@ -0,0 +1,48 @@
import { integer, pgTable, serial, timestamp, varchar } from 'drizzle-orm/pg-core';
export const topics = pgTable('topics', {
id: serial('id').primaryKey(),
name: varchar('name', { length: 256 }),
emoji: varchar('emoji', { length: 256 }),
createdAt: timestamp('created_at').defaultNow(),
updatedAt: timestamp('updated_at').defaultNow()
});
export const universities = pgTable('universities', {
id: serial('id').primaryKey(),
name: varchar('name', { length: 256 }),
progress: integer('progress').default(0),
createdAt: timestamp('created_at').defaultNow(),
updatedAt: timestamp('updated_at').defaultNow()
});
export const courses = pgTable('courses', {
id: serial('id').primaryKey(),
name: varchar('name', { length: 256 }),
universityId: integer('university_id').references(() => universities.id),
createdAt: timestamp('created_at').defaultNow(),
updatedAt: timestamp('updated_at').defaultNow()
});
export const certificates = pgTable('certificates', {
id: serial('id').primaryKey(),
name: varchar('name', { length: 256 }),
progress: integer('progress').default(0),
createdAt: timestamp('created_at').defaultNow(),
updatedAt: timestamp('updated_at').defaultNow()
});
export const books = pgTable('books', {
id: serial('id').primaryKey(),
name: varchar('name', { length: 256 }),
progress: integer('progress').default(0),
createdAt: timestamp('created_at').defaultNow(),
updatedAt: timestamp('updated_at').defaultNow()
});
export const publications = pgTable('publications', {
id: serial('id').primaryKey(),
name: varchar('name', { length: 256 }),
createdAt: timestamp('created_at').defaultNow(),
updatedAt: timestamp('updated_at').defaultNow()
});

View File

@@ -0,0 +1,12 @@
<script lang="ts">
import '../app.css';
</script>
<nav class="flex justify-around">
<div><a href="/">Stan Runge</a></div>
<div>
<a href="/progress">Progress</a>
</div>
</nav>
<slot />

View File

@@ -0,0 +1,10 @@
// import { db } from '$lib/db/db.server';
// import { myTable } from '$lib/db/schema';
import type { PageServerLoad } from './$types';
export const load = (async () => {
// const result = await db.select().from(myTable);
return {
message: 'Hi :4888829383991292222244343434'
};
}) satisfies PageServerLoad;

View File

@@ -0,0 +1,8 @@
<script lang="ts">
export let data;
</script>
<h1>Welcome to SvelteKit</h1>
<p>Visit <a href="https://kit.svelte.dev">kit.svelte.dev</a> to read the documentation</p>
<p>Message: {data.message}</p>