restructure repo

This commit is contained in:
2025-03-17 21:48:21 +01:00
parent 833c396b9b
commit bbf66ddc74
160 changed files with 49 additions and 1163 deletions

View File

@@ -16,7 +16,8 @@
"test": "npm run test:unit -- --run",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build",
"deploy": "npm run build && wrangler pages deploy",
"deploy-stage": "npm run build && wrangler pages deploy --env staging",
"deploy-prod": "npm run build && wrangler pages deploy --env production",
"cf-typegen": "wrangler types && move worker-configuration.d.ts src/"
},
"devDependencies": {

View File

@@ -0,0 +1,10 @@
<div role="alert" class="alert alert-vertical sm:alert-horizontal">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" class="stroke-info h-6 w-6 shrink-0">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path>
</svg>
<span></span>
<div>
<button class="btn btn-sm">Deny</button>
<button class="btn btn-sm btn-primary">Accept</button>
</div>
</div>

View File

@@ -1,4 +1,4 @@
MATCH (a:Person), (b:Person)
WHERE id(a) = $id1 AND id(b) = $id2
CREATE (a)-[r:Relationship $Relationship]->(b)
RETURN r as relationship
RETURN r AS relationship

View File

@@ -2,6 +2,7 @@ import { google } from "$lib/server/oauth";
import { ObjectParser } from "@pilcrowjs/object-parser";
import { createUser, getUserFromGoogleId } from "$lib/server/user";
import { DB } from "$lib/server/db";
import { browser } from '$app/environment';
import { Date as neoDate } from 'neo4j-driver';
import { createSession, generateSessionToken, setSessionTokenCookie } from "$lib/server/session";
import { decodeIdToken } from "arctic";
@@ -15,6 +16,11 @@ import { error, redirect, fail } from "@sveltejs/kit";
const StorageLimit = 200 * 1024 * 1024;
export const load: PageServerLoad = async (event: RequestEvent) => {
//prevent loading in developer mode, due to some issues with universal load, even if this is a server only ts,it will still run on client in dev mode idk
if (browser) {
return {}
}
const storedState = event.cookies.get("google_oauth_state") ?? null;
const codeVerifier = event.cookies.get("google_code_verifier") ?? null;
const code = event.url.searchParams.get("code");
@@ -34,9 +40,9 @@ export const load: PageServerLoad = async (event: RequestEvent) => {
return error(400, { message: "Failed to validate authorization code with " + e });
}
// if (!event.platform || !event.platform.env || !event.platform.env.GH_SESSIONS) {
// return error(500, { message: "Server configuration error. GH_SESSIONS KeyValue store missing" });
// }
// if (!event.platform || !event.platform.env || !event.platform.env.GH_SESSIONS) {
// return error(500, { message: "Server configuration error. GH_SESSIONS KeyValue store missing" });
// }
const claims = decodeIdToken(tokens.idToken());
const claimsParser = new ObjectParser(claims);
@@ -53,8 +59,8 @@ export const load: PageServerLoad = async (event: RequestEvent) => {
let eUser = existingUser.records.pop();
if (eUser !== null && eUser?.get('elementId') !== undefined) {
const sessionToken = generateSessionToken();
// const session = await createSession(sessionToken, eUser.get('elementId'), event.platform.env.GH_SESSIONS);
// setSessionTokenCookie(event, sessionToken, session.expiresAt);
// const session = await createSession(sessionToken, eUser.get('elementId'), event.platform.env.GH_SESSIONS);
// setSessionTokenCookie(event, sessionToken, session.expiresAt);
return redirect(302, "/");
}
@@ -80,9 +86,9 @@ export const actions: Actions = {
async function register(event: RequestEvent) {
const data = await event.request.formData();
// if (!event.platform || !event.platform.env || !event.platform.env.GH_SESSIONS) {
// return fail(500, { message: "Server configuration error. GH_SESSIONS KeyValue store missing" });
// }
// if (!event.platform || !event.platform.env || !event.platform.env.GH_SESSIONS) {
// return fail(500, { message: "Server configuration error. GH_SESSIONS KeyValue store missing" });
// }
const google_id = data.get('google_id')
if (google_id === null) {
return fail(400, {
@@ -170,8 +176,8 @@ async function register(event: RequestEvent) {
dbSession.close();
const sessionToken = generateSessionToken();
// const session = await createSession(sessionToken, user.get('elementId'), event.platform.env.GH_SESSIONS);
// setSessionTokenCookie(event, sessionToken, session.expiresAt);
// const session = await createSession(sessionToken, user.get('elementId'), event.platform.env.GH_SESSIONS);
// setSessionTokenCookie(event, sessionToken, session.expiresAt);
return redirect(302, "/");
}

View File

Before

Width:  |  Height:  |  Size: 690 KiB

After

Width:  |  Height:  |  Size: 690 KiB

View File

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 41 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 456 KiB

After

Width:  |  Height:  |  Size: 456 KiB

View File

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

View File

Before

Width:  |  Height:  |  Size: 829 B

After

Width:  |  Height:  |  Size: 829 B

View File

Before

Width:  |  Height:  |  Size: 6.0 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

View File

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

View File

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 43 KiB

View File

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 40 KiB

View File

Before

Width:  |  Height:  |  Size: 7.1 KiB

After

Width:  |  Height:  |  Size: 7.1 KiB

View File

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 48 KiB

View File

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 43 KiB

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 716 B

After

Width:  |  Height:  |  Size: 716 B

View File

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 29 KiB

View File

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

View File

@@ -26,6 +26,16 @@
* databases, object storage, AI inference, real-time communication and more.
* https://developers.cloudflare.com/workers/runtime-apis/bindings/
*/
"kv_namespaces": [
{
"binding": "GH_SESSIONS"
}
],
"r2_buckets": [
{
"binding": "GH_MEDIA"
}
],
/**
* Environment Variables
* https://developers.cloudflare.com/workers/wrangler/configuration/#environment-variables

View File

@@ -37,20 +37,6 @@ linters-settings:
rewrite-rules:
- pattern: 'interface{}'
replacement: 'any'
gomnd:
# don't include the "operation" and "assign"
checks:
- argument
- case
- condition
- return
ignored-numbers:
- '0'
- '1'
- '2'
- '3'
ignored-functions:
- strings.SplitN
govet:
settings:
printf:

View File

@@ -1,4 +1,4 @@
module github.com/vcscsvcscs/GenerationsHeritage
module github.com/vcscsvcscs/GenerationsHeritage/apps/db-handler
go 1.23
@@ -7,7 +7,6 @@ require (
github.com/gin-gonic/gin v1.10.0
github.com/google/uuid v1.6.0
github.com/neo4j/neo4j-go-driver/v5 v5.27.0
github.com/zitadel/zitadel-go/v3 v3.3.2
golang.org/x/net v0.33.0
)

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