A high-performance full-stack server application built with ElysiaJS and TanStack Start, designed to run on multiple JavaScript runtimes.
Warning
👉 Use the official project instead: https://github.com/rjoydip/tss-elysia
If you find something useful here, feel free to explore—but for any serious usage, always prefer the recommended repository above.
- Multi-Runtime Support - Deploy to Bun, Node.js, or Cloudflare Workers
- Type-Safe API - End-to-end type safety with ElysiaJS and OpenAPI
- Authentication - Secure auth with better-auth and session management
- Database - Type-safe database access with Drizzle ORM
- Real-time - WebSocket and Server-Sent Events (SSE) support
- Security - Helmet middleware, rate limiting, CORS
- Observability - OpenTelemetry integration for tracing
- Automated Releases - Changesets for semantic versioning and changelogs
| Category | Technology |
|---|---|
| Backend | ElysiaJS |
| Frontend | React Start (TanStack Router) |
| Runtimes | Bun, Node.js, Cloudflare Workers |
| Database | Drizzle ORM + SQLite (libSQL) |
| Auth | better-auth |
| Styling | TailwindCSS v4 |
| Docs | OpenAPI/Swagger |
| Releases | Changesets + GitHub Actions |
# Install Bun
curl -fsSL https://bun.sh/install | bash# Install dependencies
bun install
# Start full-stack development
bun run dev
# Open in browser
open http://localhost:3000/bun run dev # Quick start (server + client)
bun run server:dev # Bun server with hot reload
bun run server:dev:node # Node.js server with hot reload
bun run server:dev:workerd # Cloudflare Workers dev
bun run server:dev:edge # Edge runtime dev
bun run client:dev # Frontend only (Vite)bun run build # Build all targets
bun run build:bun # Standalone Bun binary
bun run build:node # Node.js executable
bun run client:build # Frontend buildbun run db:generate # Generate Drizzle schema
bun run db:migrate # Run migrations
bun run db:push # Push schema to database
bun run db:pull # Pull schema from database
bun run db:seed # Seed database with data
bun run db:studio # Open Drizzle Studiobun run lint # Lint with oxlint + format check
bun run lint:fix # Fix lint issues
bun run fmt # Format code
bun run typecheck # TypeScript type checking
bun run react:doctor # React health checkbun test # Run all tests
bun test:watch # Watch mode
bun test:coverage # With coverage reportbun changeset add # Add a changeset for your changes
bun changeset version # Bump versions (CI uses this)
bun release # Publish releasesrc/
├── _api.ts # API routes definition
├── _app.ts # Main application + middleware
├── _config.ts # Configuration and logger
├── _env.ts # Environment variables
├── auth.ts # better-auth configuration
├── router.tsx # TanStack Router setup
├── routes/ # Frontend routes
│ ├── __root.tsx # Root layout
│ └── index.tsx # Home page
├── middlewares/ # Middleware implementations
│ └── _auth.ts # Authentication middleware
├── features/ # Feature modules
│ └── user/ # User feature (routes, service)
├── db/ # Database layer
│ ├── _client.ts # Database client
│ └── schema/ # Drizzle schema
├── runtime/ # Multi-runtime entries
│ ├── bun.ts # Bun runtime
│ ├── node.ts # Node.js runtime
│ ├── workerd.ts # Cloudflare Workers
│ └── edge.ts # Edge functions
└── components/ # React components
.changeset/ # Changesets for versioning
.github/workflows/ # GitHub Actions CI/CD| Method | Endpoint | Description |
|---|---|---|
| POST | /api/auth/sign-in |
Sign in |
| POST | /api/auth/sign-up |
Sign up |
| POST | /api/auth/sign-out |
Sign out |
| GET | /api/auth/session |
Get current session |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/user |
Get all users (paginated) |
| GET | /api/user/:id |
Get user by ID |
| POST | /api/user |
Create user |
| PUT | /api/user/:id |
Update user |
| DELETE | /api/user/:id |
Delete user |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/ |
API welcome |
| GET | /api/health |
Health check |
| GET | /api/sse |
Server-Sent Events |
| WS | /api/chat |
WebSocket chat |
API documentation available at /openapi when server is running.
BETTER_AUTH_SECRET=your-secret-key
BETTER_AUTH_BASE_URL=http://localhost:3000/api
DATABASE_URL=file:sqlite.dbPORT=3000
DATABASE_AUTH_TOKEN=your-token
TLS_CERT_PATH=/path/to/cert.pem
TLS_KEY_PATH=/path/to/key.pemSee docs/environment-variables.md for full documentation.
bun run deploybun run build:bun
./serverbun run build:node
node dist/server.jsWe use Changesets for versioning and changelogs.
-
Make your changes in a feature branch
-
Add a changeset to describe what changed:
bun changeset add
- Select the
try-elysiapackage - Choose bump type:
patch,minor, ormajor - Write a description of your changes
- Select the
-
Commit your changes including the changeset file
-
Open a PR - CI will run tests and linting
Releases are automated via GitHub Actions when changes are merged to main:
- Changesets detects new changeset files
- Updates version in
package.json - Generates
CHANGELOG.mdwith PR links - Creates GitHub Release with binaries
- Publishes to GitHub Packages (if applicable)
Dev builds are automatically created nightly at midnight UTC. They include:
- Latest code from
main - Version:
0.0.0-dev.YYYYMMDD.commitCount - Download from the "Nightly Dev" GitHub Release
See CONTRIBUTING.md for detailed contribution guidelines.
For regenerating better-auth schema:
bun x @better-auth/cli@latest generate --output ./src/db/schema/auth.ts- Project Overview
- Development Guide
- API Reference
- Authentication
- Database Schema
- Architecture
- Middleware
- Multi-Runtime
- Environment Variables
- Contributing Guide
MIT