Where Next.js meets Express
Together when you want, separate when you need
What's Inside
The ENT Stack is a robust, full-stack monorepo that integrates Express, Next.js, and TRPC, offering a streamlined solution for web app development.
It allows you to build and share code between frontend and backend in a single project while maintaining the flexibility to host them independently.
Features
🌀 PNPM Workspace - Monorepo
The stack uses PNPM Workspace because it's simple and painless to use. With its efficient dependency management and shared package architecture, PNPM ensures faster installs and a clean, modular workflow.
- The apps folder contains both the backend (apps/backend) and frontend (apps/frontend) codebases.
- The packages folder includes a shared directory (packages/shared) for common configurations, utilities, services, type definitions, and translations.
To maintain uniform code quality, each directory includes an eslint.config.js file with consistent rules. A root-level tsconfig.json provides a base set of TypeScript configurations, extended by each subproject as needed.
🤝 Type-Safe API Layer
The stack leverages TRPC to create a type-safe bridge between the frontend and backend, ensuring type hints and autocompletion for API endpoints directly in your IDE.
🌐 Translations and Routing (i18n)
A custom, lightweight solution handles localization using standalone functions based on ICU message syntax.
- Translation functions can be used anywhere in the stack (backend and frontend).
- Scripts for message import and export included.
- Frontend routes are translatable and evaluated dynamically using Next.js middleware.
🔒 Authentication & Authorization
The stack provides passwordless registration and login via short verification PINs, secure JWT tokens, and UUID-based refresh tokens. Frontend routes can be marked as protected in routes.ts, evaluated in middleware.ts.
⚙️ Environment & Configuration
Uses T3 Env for type-safe environment variables. Shared configuration is extended by backend and frontend-specific settings.
🪵 Logging
Employs Pino for lightweight and efficient logging across the stack.
🪲 Error Handling and Validation
Uses Zod for input validation and type-safe error management, integrated with TRPC.
🔄 State Management
Uses Zustand for lightweight state management and Tanstack Query for asynchronous data fetching and caching.
🛢️ Database
Uses Drizzle ORM for type-safe database interactions with MySQL, along with Docker for local database setup.
✉️ Email Sending
Integrates Resend for email sending with templates written in Handlebars.
🤖 Testing
Uses Playwright for frontend and backend testing, and Mailslurp for email testing.