← Corpus / fullstack-vc / other
fullstack-vc/issue-resolutions/troubleshooting-ssg-authentication-and-port-to-ssr-w-database
- Path
- issue-resolutions/Troubleshooting-SSG-Authentication-and-Port-to-SSR-w-Database.md
The Issue needing Resolution
I come to you at the tail end of a project Claude did not develop in conceptualization, documentation, or code. That, my friend, was Warp and its agent. Which, is now struggling and keeps insisting I buy more credits to continue at steps that don’t feel big enough to justify.
Goal:
Get OAuth based GitHub authentication working on production, abandoning our SSG markdown approach in favor of an SSR mode (Svelte) with a database
[!ASIDE] Background on libSQL and Turso and AstroDB (Turso, libSQL (libSQL is a fork of SQLite so has 90%+ the same API, SQL support. Turso is just a cloud libSQL serverless db company who actually forked, designs, and maintains the open source libSQL project)).
Background
Yesterday, April 27th, we got OAuth based GitHub authentication working in SSG mode. This required a bit of creativity: authenticating added a markdown file with the filename as {handle}.md to the participants directory. This is a great start, but we need to figure out how to get this to work in SSR mode with a database.
We knew this was not ideal, but we wanted to get someothing working for the “Stacks” feature and allow a small number of potential alpha users (less than 30) to add different apps/tools “tools” they use to their “stack”.
We were also delaying decisions on a remote database and figuring out how the Svelte SSR code would play nice with the overall site preference to make all data content and all content use SSG for SEO and load speed benefits.
Today, April 28th, we woke up believing the most important thing we could do is introduce an interactive polling system in preparation for our first live session with the community tomorrow. Don’t question our judgement, as it’s not particularly defensible. It’s just what we decided and with enthusiasm.
This has forced us to recognize in order to make this work in SSR mode we need a data store that doesn’t require repository commits to render.
In another session with an AI Coding Agent (Warp, Claude was down for some time today), we actually worked through a lot of a v0.0.1 baby step, and everything seems to be building fine and dev server is firing up.
However, even before we pushed this, one eager potential member of our community tried to “sign up” on the deployed production site and got an error and let me know.
Yesterday, I was able to create an account locally on port 4324, using OAuth (GitHub) with a specific callback url as a Vercel environment variable. It worked fine.
We have both a local app and production app, independently for different credentials, registered on GitHub for OAuth (and other permissions). We also have created various environment variables, including a Turso remote libSQL database that mirrors our local database, built in supported AstroDB.
Task at Hand:
-
Troubleshoot why the production environment is not working with OAuth at all, even with the SSG mode. (We have not yet even tried to migrate/refactor to SSR mode with the database.)
-
Read and understand our documentation on the “Polls” feature that led us to adopt SSR and a database, and how we are intending to have the “best of both worlds” where the database and SSR serves as the realtime interactivty UX/UI in places where it matters, but then as soon as some kind of
triggeris met, we sync the database data to json and/or markdown files for SSG rendering. (Of course, not all data needs to be synced, only the data that is needed for SSG rendering.) -
Anticipate the needed refactor in order to migrate Authentication to SSR mode with the database.
Relevant files to review:
The spec we were working from:
/Users/mpstaton/code/lossless-monorepo/astro-knots/context-v/blueprints/Maintain-an-Interactive-Polling-System--v2.md
The previous SSG style implementation data store:
/Users/mpstaton/code/lossless-monorepo/astro-knots/sites/fullstack-vc/src/content/participants/*.md/Users/mpstaton/code/lossless-monorepo/astro-knots/sites/fullstack-vc/src/lib/oauth-roster.ts/Users/mpstaton/code/lossless-monorepo/astro-knots/sites/fullstack-vc/src/lib/github-commit.ts/Users/mpstaton/code/lossless-monorepo/astro-knots/sites/fullstack-vc/src/pages/login/*
Resolution
Just needed to change the callback URL
https://fullstack-vc.com/api/auth/github/callback