This repo is meant to be cloned and used as a starting point for a your next project.
Remember to delete the .git folder, and init a new repo after cloning :)
git clone https://github.com/antoni-ostrowski/BETC-stack.git
cd BETC-stack
bun install
bun dev:web
bun dev:convex- Tanstack (Start & Router & Query & ...) (React framework & tools)
- Convex (Backend)
- Better-auth (Auth, with better-convex)
- Effect v4 (best way to write TypeScript)
- CSS - Tailwindcss
- Base components - Shadcn
I'm still experimenting with the best way to make the effect code interact correctly with convex functions. For now, I created a utility to run an effect and wrap any failures in ConvexError and throw it. Then client can use parseConvexError util to read exact error message. This approach preserves the nature of js exceptions and doesn't break convex assumptions. This is how that looks like. Im using fluent convex - simple lib that enables TRPC style procedures and middlewares.
export const list = authedQuery
.handler(async (ctx) => {
const program = Effect.gen(function* () {
return yield* effectifyPromise(() => ctx.db.query("todos").collect());
});
return runEffOrThrow(appRuntime, program);
})
.public();