- 🚀 High-Performance Backend - Built with Elysia.js, featuring OpenAPI docs and type-safe APIs
- 🎨 Modern Frontend - Next.js 15 with React 19, Tailwind CSS, and shadcn/ui components
- 🔒 Type-Safe Development - Full TypeScript support with end-to-end type safety
- 🔐 Authentication Ready - Better Auth integration for secure user management
- 🗄️ Database Integration - Drizzle ORM with PostgreSQL support
- ⚡ Developer Experience - Hot reload, linting, and automated code formatting with Ultracite
Prerequisites:
Install dependencies:
bun installEnvironment Setup:
Copy the environment variables template and configure your values:
cp .env.example .envRequired environment variables:
DATABASE_URL: PostgreSQL database connection stringBETTER_AUTH_SECRET: Secret key for Better AuthBETTER_AUTH_URL: Base URL for your applicationGITHUB_CLIENT_ID: GitHub OAuth client IDGITHUB_CLIENT_SECRET: GitHub OAuth client secret
Start development server:
bun run devBuild for production:
bun run buildRun linting and checks:
bun run checkDocker deployment:
bun run docker- Framework: Elysia.js - High-performance Bun web framework
- Language: TypeScript with strict type checking
- API Documentation: OpenAPI/Swagger integration
- Authentication: Better Auth - Modern auth solution
- Database: Drizzle ORM - Type-safe SQL queries
- Validation: Built-in Elysia validation with type inference
- Framework: Next.js 15 with App Router
- React: React 19 with latest features
- Styling: Tailwind CSS for utility-first styling
- Components: shadcn/ui - Beautiful, accessible components
- State Management: TanStack Query for server state
- Type Safety: End-to-end TypeScript with generated client
- Runtime: Bun - Fast JavaScript runtime
- Linting: Biome - Fast linter and formatter
- AI-Ready Code: Ultracite - AI-friendly code formatting
- Git Hooks: Lefthook - Fast git hooks
- Monorepo: Native Bun workspaces
nahida-template/
├── backend/ # Elysia.js API server
│ ├── src/
│ │ ├── api/v1/ # API routes (ping, todo)
│ │ ├── db/ # Database schemas and connections
│ │ ├── libs/ # Third-party integrations
│ │ └── utils/ # Utility functions
│ └── drizzle/ # Database migrations
├── frontend/ # Next.js web application
│ ├── src/
│ │ ├── app/ # Next.js app router pages
│ │ ├── components/ # Reusable UI components
│ │ └── lib/ # Client-side utilities
│ └── public/ # Static assets
├── packages/ # Shared packages
│ └── client/ # Generated API client
└── scripts/ # Build and deployment scripts
$ bun run dev
# Starts backend server on http://localhost:3001
# API docs available at http://localhost:3001/openapi- Auto-generated OpenAPI docs with Swagger UI
- Type-safe endpoints with Elysia.js
- Built-in validation and error handling
- Database integration with Drizzle ORM
- Authentication with Better Auth (OAuth, email/password)
$ bun run dev
# Starts frontend on http://localhost:3000
# Hot reload and fast refresh enabled- React 19 with latest concurrent features
- App Router for nested layouts and loading states
- Server Components for optimal performance
- Tailwind CSS for responsive design
- shadcn/ui components with dark mode support
The template includes a complete todo application demonstrating:
- CRUD operations with type-safe API calls
- Real-time updates with TanStack Query
- User authentication and authorization
- Database relationships and migrations
// Example API usage
const { data: todos } = await client.api.v1.todo.get()- Use
bun run devto start both frontend and backend simultaneously - Check API docs at
/openapiendpoint for available routes - Run
bun run checkbefore committing to ensure code quality - Use
bun run dockerfor production-ready container builds - Database migrations are handled automatically with Drizzle
# Build and run with Docker
bun run docker# Build both frontend and backend
bun run build
# Start production servers
# Backend: cd backend && bun run start
# Frontend: cd frontend && bun run start- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Run checks:
bun run check - Commit changes:
git commit -m 'Add amazing feature' - Push to branch:
git push origin feature/amazing-feature - Open a Pull Request
- Issues: GitHub Issues
MIT License - feel free to use this template for your projects.
