Skip to content

omnidotdev/template-elysia

Repository files navigation

🦊 Elysia Template

This is a template repository for a GraphQL-API-enhanced server powered by Elysia.

Features

  • 🚀 Modern Stack: Built with Bun, Elysia, and TypeScript for fast development and runtime performance
  • 🧩 Powerful GraphQL API:
    • Integration with PostGraphile for auto-generated GraphQL APIs from PostgreSQL schema
    • GraphQL Yoga for flexible GraphQL server setup and easy access to Envelop plugin ecosystem
    • Grafast for efficient GraphQL execution (query planning)
    • Relay specification compliance
    • No N+1 problem
  • 🔒 Security:
    • GraphQL Armor for securing GraphQL endpoints with operation complexity limits, depth limits, and more
    • Schema-wide perimiter authentication support via useGenericAuth
    • CORS with configurable allowed origins
    • TLS/HTTPS support out of the box
    • GraphQL schema introspection disabled in production environments
  • Optimal Performance:
    • GraphQL parser and validation caching
    • PostgreSQL connection pooling
    • Optimized GraphQL execution
  • 🗄️ Database Management:
    • Drizzle ORM for type-safe database operations
    • Automated migrations with drizzle-kit
    • Database seeding for development environments
  • 🛠️ Developer Experience:
    • Hot reloading during development
    • Code quality with Biome
    • Git hooks with Husky
    • Automated updates with Renovate
    • Easy spin up with Tilt
  • 🚢 Production Ready:
    • Environment-specific configurations
    • Optimized build process
    • OpenTelemetry integration for observability

Local Development

First, cp .env.local.template .env.local and fill in the values. Then, generate TLS certificates by running bun src/scripts/generateTlsCert.ts.

Building and Running

Install dependencies:

bun install

Set up the database (only required once, to create the database):

bun db:setup

Run database migrations:

bun db:migrate

Run the dev server:

bun run dev

License

The code in this repository is licensed under MIT, © Omni LLC. See LICENSE.md for more information.

About

🦊 Elysia template

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •