This starter kit provides a robust foundation for building scalable and feature-rich REST APIs using ExpressJS and TypeScript.
- Logging: Advanced logging with
Pino
and log rotation usingfile-stream-rotator
- Database: Efficient data management with
Prisma ORM
- Events: Powerful event handling with
EventEmitter2
- Authentication: Secure bearer sessions and OAuth support (Google, Facebook, Twitter, GitHub) via
passportjs
- Authorization: Fine-grained access control with
Casl
- Validation: Request validation (Body, Parameters, Query) using
Zod
- Error Handling: Comprehensive error management system
- Dependency Injection: Service container with type-safe dependency management
- File Upload: S3 integration with
multer
- Video Upload: S3 integration with
multer
- Video Processing: Conversion to browser-compatible formats with
ffmpeg
- Redis: In-memory data structure store with
ioredis
- Caching: Improved performance through strategic caching
- Rate Limiting: Protect your API from abuse with
express-rate-limit
- Queues & Workers: Efficient task processing with
BullMQ
- Cron Jobs: Scheduled tasks using
cron
- i18n: Multi-language support
- Swagger: API documentation made easy
- PDF Generation: Create PDFs with
playwright
- Command-line Interface: Easy-to-use CLI commands with
commander
- Docker Support: Containerization for easy deployment
- CORS protection
- Rate limiting
- Request validation (Query, Parameters, Body)
- Secure authentication (Bearer sessions, OAuth)
- Hot-reload
- Performance-optimized architecture
- Code formatting with
Prettier
- Linting with
ESLint
- Path aliases for clean imports (e.g.,
#/common
,#/modules
)
- Clone the repository
- Install dependencies:
yarn install
- Set up your environment variables
π You can use the .env.template
file to create your own .env
file
π Importantly, you need to have a running instance of redis
and mysql
on your machine to run this project.
If you need a more complete solution with docker-compose to setup everything, please check this repository: https://github.com/ghostlexly/ultimate-typescript-starter-kit
- Run the development server:
yarn start:dev
This starter kit includes a set of CLI commands to help you manage your application. Here are some examples:
yarn cli test:split-text this-is-a-test -s -
: Split a text into an arrayyarn cli seed:countries
: Seed the database with countries datayarn cli create:admin-account [email protected] password
: Create an admin account
For a full list of available commands, run:
yarn cli
For detailed documentation on each feature and how to use this starter kit, please refer to our Wiki.
We welcome contributions!
This project is licensed under the MIT License.