Template for super simple serverless web apps.
Features:
- Typescript everywhere.
- All HTML rendered server-side with JSX on Lambda.
- HTMX for an app-like experience with zero client-side Javascript
- Infrastructure and Auth courtesy of SST.
- Neon for serverless Postgres, with Drizzle for database access and migrations.
- hono for ultra lightweight routing, middleware and page rendering via JSX.
sip
implementation of the TodoMVC app
Here's the main bit of the app code.
This assumes that you have pnpm
installed and have some basic familiarity with sst, neon etc.
- Clone the repo:
git clone https://github.com/martinpllu/sip
- Run
pnpm install
- Edit
sst.config.ts
to replaceeu-west-1
with your preferred region - Create a database on https://neon.tech and take a note of the connection string.
- Run
npx sst secrets set DATABASE_CONNECTION_STRING "MY_CONNECTION_STRING"
replacingMY_CONNECTION_STRING
with your database connection string. Make sure to include the quotes aroundMY_CONNECTION_STRING
. - Run
pnpm db:run-migrations
- Create an OAuth client ID for "Log in with Google" via https://console.developers.google.com/
- Run
npx sst secrets set CLIENT_ID "MY_CLIENT_ID"
- Run
pnpm dev
and test the app.
- Cloudflare workers
- Extend run-query to allow the stage to be specified in CLI
- Cloudfront distro, custom domain name in demo
- Deploy static assets to S3 bucket
- Can the faster/cheaper APIG HTTP API be used instead of REST APIs?