This is a template repository for a GraphQL-API-enhanced server powered by Elysia.
- 🚀 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:
- 🚢 Production Ready:
- Environment-specific configurations
- Optimized build process
- OpenTelemetry integration for observability
First, cp .env.local.template .env.local
and fill in the values. Then, generate TLS certificates by running bun src/scripts/generateTlsCert.ts
.
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
The code in this repository is licensed under MIT, © Omni LLC. See LICENSE.md for more information.