-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Currently pushing a lot of changes to the “middleware” branch that will involve breaking changes, and cap the scope for this project
Goal is to provide the web server as a somewhat opinionated framework, batteries included, without going overboard
By “opinionated” the assumption is that you are building a multi-player SaaS using Datastar, probably as a paid service, and want the system to be optimised around that. The system should manage all the nasty multi-player and multi-instance edge cases for you, so you can focus on building the app logic and UX.
Included in scope for HTTPServer :
- simplified server.init() options that use the new process.init
- middleware functions, pre/post handler and on error handler
- session management using http-only cookie token encoded as paseto v4
- protected routes using rbac or abac roles by user
- static file server as middleware plugin
- rewrite the logger to make it easy to customise. Support json, Zon, or text with themes
- 404 handler as middleware plugin
- forms helper functions for both multipart or signals based forms
- form validation middleware
- file upload support
- automatic signal parsing and validation, injected into http handler context
- .env support that works with new juicy main
- per-route Io option to select concurrency mechanism for each route (thread pool vs fibers)
- pub sub integration
- hotreload support as middleware plugin
- partitioned concurrency pools, so you can reserve pools for free tier vs paid tier users to prevent free tier overuse from killing the system for paid customers, etc
The above is the limit of the scope creep that the framework will provide.
After that, I will consider moving working functionality out of the other non-public apps I’m working on, and consolidate it into this framework where it may make sense to do that. Really depends, as a lot of this is highly opinionated… but may be useful as re-usable code for SaaS
Optional plugins that can be enabled at the server level, which pull in other dependencies :
- smtp client with helper functions for generating emails, using smtp.zig
- qr code generator
- Postgres integration using pg.zig
- postgres migrations
- valkey / redis integration using okredis
- if Postgres enabled, will use this for session management and user accounts
- enable pubsub across multiple instances using valkey/redis or Postgres notify
- open telemetry metrics output using metrics.zig
- login & signup page starter module, using Postgres, smtp, pin entry, and daisy ui
- basic admin login role, with dashboard to view server status and activity, and user account management
- integration with stripe / cream / clerk etc payment gateways, connected to account management
- user account subscriptions - monthly/annual payment to access pro tiers