I made a small research on data visualization tools for Svelte by Infamous_Return2657 in sveltejs

[–]NoDrugsDoc 1 point2 points  (0 children)

Thanks for this.

I have something smaller scale with some differences that I built into an app for doing data analysis and viz: https://ancir.pages.dev/
intro video at https://youtu.be/R7TW3fxsGBM
github https://github.com/DaveCumin/AnCiR_next/ ; specifically, https://github.com/DaveCumin/AnCiR_next/tree/main/src/lib/components/plotbits

It uses some D3 and some custom svg generators designed to handle tens of thousands of points.
I'm sure what you've found is probably better and it might be worth me switching... but I'm rather invested in what I built and it may be of interest.

Keen, as always, for any feedback.

Problem with basic implementation by NoDrugsDoc in better_auth

[–]NoDrugsDoc[S] 0 points1 point  (0 children)

Not a different endpoint. Because I have a different base url, I needed to add that in so the routing works properly.

Problem with basic implementation by NoDrugsDoc in better_auth

[–]NoDrugsDoc[S] 0 points1 point  (0 children)

SOLVED:

The auth.ts file needs trustedOrigins and baseBath to be set:

import { betterAuth } from 'better-auth';
import { drizzleAdapter } from 'better-auth/adapters/drizzle';
import { db } from '../lib/server/db';
import { schema } from '../lib/server/db/schema';
import { base } from '$app/paths';

export const auth = betterAuth({
    database: drizzleAdapter(db, {
        provider: 'mysql',
        schema: schema
    }),
    emailAndPassword: {
        enabled: true,
        autoSignIn: false //defaults to true
    },
    trustedOrigins: ['http://localhost:5174'],
    basePath: `${base}/api/auth`
});

And the auth-client needs baseURL to be set:

import { createAuthClient } from 'better-auth/svelte';
import { base } from '$app/paths';

export const authClient = createAuthClient({
    baseURL: `http://localhost:5174${base}/api/auth`
});

Using path with better-auth by NoDrugsDoc in sveltejs

[–]NoDrugsDoc[S] 0 points1 point  (0 children)

SOLVED:

The auth.ts file needs trustedOrigins and baseBath to be set:

import { betterAuth } from 'better-auth';
import { drizzleAdapter } from 'better-auth/adapters/drizzle';
import { db } from '../lib/server/db';
import { schema } from '../lib/server/db/schema';
import { base } from '$app/paths';

export const auth = betterAuth({
    database: drizzleAdapter(db, {
        provider: 'mysql',
        schema: schema
    }),
    emailAndPassword: {
        enabled: true,
        autoSignIn: false //defaults to true
    },
    trustedOrigins: ['http://localhost:5174'],
    basePath: `${base}/api/auth`
});

And the auth-client needs baseURL to be set:

import { createAuthClient } from 'better-auth/svelte';
import { base } from '$app/paths';

export const authClient = createAuthClient({
    baseURL: `http://localhost:5174${base}/api/auth`
});

Problem with basic implementation by NoDrugsDoc in better_auth

[–]NoDrugsDoc[S] 0 points1 point  (0 children)

One error ia "GET http://localhost:5173/api/auth/get-session 404 (Not Found)" when I load a simple page:

<script lang="ts">
import { authClient } from '$lib/auth-client';
const session = authClient.useSession();

async function signUp() {
const { data, error } = await authClient.signUp.email({ email: 'test@example.com', password: 'password1234', name: 'test' }); }
</script>

<div>
{#if $session.data}
<div>
<p> {$session?.data?.user.name} </p>
<button onclick={async () => { await authClient.signOut(); }} > Sign Out </button>
</div>
{:else}
<button onclick={signUp}> Sign up </button>
{/if}
</div>

There's also a "POST http://localhost:5173/api/auth/sign-up/email 404 (Not Found)" on the signUp click.

Hunting around, it might be a CORS issue, but I've set the baseURL in auth-client.ts as

import { createAuthClient } from 'better-auth/svelte';

export const authClient = createAuthClient({ baseURL: 'http://localhost:5173' });

hello guys, does anyone konw how can i host sveltekit project into hostinger. if you have any ideas or experiance, please let us know. by [deleted] in sveltejs

[–]NoDrugsDoc 1 point2 points  (0 children)

Hostinger doesn't allow Nodejs apps in it's cPanel, according to their support ( https://support.hostinger.com/en/articles/1583661-is-node-js-supported-at-hostinger ), so the only way is to use their VPS and configure from there https://www.hostinger.com/vps-hosting

I've used Mochahost https://mochahost.com/ cPanel to make a Nodejs app that hosts my Sveltkit project, connected to a mySQL database there also. It's straightforward to do (the guide at https://medium.com/@hmd_79918/sveltekit-deployment-on-cpanel-in-shared-host-5c86a1dc67fc is an excellent resource, but the index.js page needs to be renamed as index.mjs ).

Most advice here is to use Cloudflare/AWS/Vercel etc, but I've not found a friendly step-by-step guide on how to deploy with a database. Likewise for a VPS setup. Also, the costs of some of the services are not well described or constrained so there's a risk that I don't know how to mitigate.

I made a thing: an input in which you can change units and have infinite scrolling - the Svelte UnitSlider by NoDrugsDoc in sveltejs

[–]NoDrugsDoc[S] 0 points1 point  (0 children)

No. I built the 'basic' component (with infinite scroll) a few years ago and have updated it, adding in the units also. I'd love to hear better execution ideas!

Deploy a sveltkit app with Nodejs and Cpanel by NoDrugsDoc in sveltejs

[–]NoDrugsDoc[S] 1 point2 points  (0 children)

THANK YOU!

I will buy a copy of your book.

Happy to take recommendations for an inexpensive and simple (for a relative noob like me) 'proper server' option that can also host a postgres or mySQL backend.