#OakBun: Native Bun Backend Framework with interactive CLI, Auto-Migrations & Modular DX
1 messages · Page 1 of 1 (latest)
niet zo geweldig
Thanks for stopping by! The framework is still in early alpha. Any specific feedback on the architecture or features you looked at?
I dont like the idea where schemas and routes are connected to another. I prefer having it loose
Ah, I see what you mean! But they are actually completely decoupled. The database schemas are fully isolated. You might be looking at the defineResource helper (which is just optional sugar for rapid CRUD) or the route-level input validation. With defineModule(), you can structure it as loosely as you want.
The thing is, I already have like a structured idea of how I use db and api
folder structure
-
api
- customers.ts
- products.ts
-
schemas
- customers.ts:
export const customerSchema = z.object({ id: z.uuidv4().meta({pK: true}), name: z.string(), email: z.email(), }).register(z.globalRegistry, {table: true})- products.ts
-
middleware
- auth: (a hono context that adds auth upon all routes, not just specific scopes)
Ah, I see! That’s a very solid setup. You are leaning into a classic Layered Architecture (grouping by type), whereas OakBun is strictly designed around Feature-Sliced Design (grouping by domain/module) to keep large codebases maintainable. >
Also, deriving DB tables directly from Zod (with .meta) is super fast for iteration! OakBun deliberately separates DB schemas (ORM) from I/O schemas (Zod) because in enterprise apps, API DTOs and Database models often need to evolve independently. But I totally respect your approach, both are valid depending on the scale of the project!