elysia-kickstart icon indicating copy to clipboard operation
elysia-kickstart copied to clipboard

ElysiaJS boilerplate with HTMX, Tailwind, Auth.js, Drizzle, CI. Deploy in one click to Railway or Vercel Edge Functions

elysia-kickstart

Feature packed ElysiaJS boilerplate. Edge ready. Deploy with one click.

Taken inspiration from https://github.com/ethanniser/the-beth-stack.

📚 Features

Core

  • 🏗️ TypeScript - Configured to maximize type safety
  • 🐉 ElysiaJS - Fast and Bun friendly server framework
  • 📐 HTMX - High power tools for HTML
  • 💽 Drizzle - ORM with maximal type safety
  • 🔒 Auth.js - Flexible and secure authentication
    • 🔗 integrates with Drizzle to store auth data

Development

Deployment

  • 🐳 Docker - (local and production) Docker-compose and Dockerfiles for running anywhere
  • 🔄 GitHub Actions - Robust CI/CD

🌱 Getting started

🚀 Option 1: Clone and deploy

  • To Railway (deployed with Docker)

    Deploy on Railway

  • To Vercel Edge Functions (see the Railway template for required environment variables, as well as RUNTIME=edge)

    Vercel

📋 Option 2: Clone and run locally

  1. Fork this repository (uncheck 'Copy the main branch only` if you are interested in other branches / feature sets)
  2. Clone your new repository
  3. Install dependencies and run the development server
  • with bun

    bun install
    bun run dev
    
  • or with Docker

    docker-compose --file docker/dev/docker-compose.yml up
    

⚙️ Configuration

Docker

  • .dockerignore
  • docker/ - Dockerfile and docker-compose.yml for development and production

Drizzle

  • src/db/
  • src/lib/db.ts
  • drizzle.config.ts

ESLint

  • .eslintrc.json

GitHub Actions

  • .github/workflows/ci.yml - type-checking and linting (hence these errors are ignored in next.config.mjs)

HTMX

  • public/[email protected]
  • types/htmx.d.ts - typed HTMX attributes for intellisense and autocompletion

NextAuth

  • src/app/api/auth/index.ts
  • src/app/components/auth.tsx
  • src/db/schemas/auth.ts — store auth data (users, accounts, sessions, verification tokens) in database
  • src/hooks/isAuthenticated.ts
  • src/lib/auth.ts

Prettier

  • .eslintrc.json
  • .prettierignore
  • .prettierrc.json

Tailwind CSS

  • src/styles/globals.css
  • tailwind.config.js

TypeScript

  • tsconfig.json - configured for maximum type-safety
  • types/reset.d.ts - using ts-reset to increase type-safety

Vercel Edge Functions

  • api/index.tsx
  • scripts/transform-paths.ts - transforms all relative imports to absolute imports inside the src/ directory
  • vercel.json

VS Code

  • .vscode/extensions.json - recommended workspace extensions