A production-ready starter template using ElysiaJS, Drizzle ORM, and Bun.
- 🧩 Clean Architecture: Domain-driven design with clear separation of concerns
- 🔐 Authentication: JWT-based authentication system
- 👤 User Management: Complete user entity with profile management
- 🔄 Database: Drizzle ORM with PostgreSQL
- 📝 Validation: End-to-end type safety with Elysia's built-in validation
- 📚 API Documentation: Auto-generated OpenAPI/Swagger documentation
- 🧪 Testing: Unit and integration tests setup
- 🧠 Type Safety: Full TypeScript support with end-to-end type safety
- 🔍 Error Handling: Comprehensive error handling system
- 🔄 Migrations: Database migration system
- ⛔ rate limiting: rating limiting using redis
- 📫 otp mail verification: mail verification using resend and react email
made using dirscanner
src/
├── domain/ # Domain entities and business rules
│ └── entities/ # Core business objects
│
├── application/ # Application-specific business rules
│ ├── use-cases/ # Business logic operations
│ └── services/ # Reusable services
│
├── infrastructure/ # External concerns (database, external APIs)
│ ├── database/ # Database setup and implementations
│ │ ├── schema/ # Drizzle schema definitions
│ │ └── migrations/ # Database migrations
│ └── utils/ # Utility functions
│
├── interface/ # Interface adapters
│ ├── controllers/ # Elysia route handlers (controllers)
│ ├── validators/ # Input validation schemas
│ └── middleware/ # Request/response middleware
│
├── main/ # Application entry point
│ ├── config/ # Configuration files
│ ├── routes/ # Route definitions
│ └── server.ts # Server initialization
│
├── scripts/ # Utility scripts (migrations, seed data)
│
├── .env # Environment variables
├── .env.example # Example environment variables
├── package.json # Project dependencies
├── tsconfig.json # TypeScript configuration
└── README.md # Project documentation
- Clone the repository
- Run
bun install
- Create a
.env
file based on.env.example
- Run
bun run db:migrate
to apply database migrations - Run
bun run dev
to start the development server
bun run dev
: Start the development serverbun run build
: Build the projectbun run start
: Start the production serverbun run test
: Run testsbun run db:generate
: Generate a new migrationbun run db:migrate
: Apply migrationsbun run db:studio
: Open Drizzle Studio