This is a minimal Express.js + TypeScript template designed for speed and ease of use. It requires no extra configurationβjust install dependencies and start coding!
- Pre-configured TypeScript setup
- Minimal dependencies for fast setup
- Nodemon support for automatic reloads during development
- Git-ready with a
.gitignore
to avoid unnecessary files - No need for an extra package to load environment variablesβjust create a .env file in the root.
-
Clone the repository
git clone https://github.com/Jonvry/expressjs-ts-template.git cd expressjs-ts-template
-
Install dependencies
npm install
-
Create a
.env
file in your root directory and define your environment variables:PORT=4000
-
Run the development server
npm run dev
-
Build and start for production
npm run build npm start
express-js-typescript-template/
βββ src/
β βββ index.ts # Main entry point
βββ dist/ # Compiled output (required in development and production)
βββ .gitignore # Ignores unnecessary files
βββ package.json # Project dependencies and scripts
βββ tsconfig.json # TypeScript configuration
Script | Description |
---|---|
npm run dev |
Starts the app in development mode with Nodemon |
npm run build |
Compiles TypeScript to JavaScript |
npm start |
Runs the compiled app |
- express - Web framework for Node.js
- typescript - Type definitions for better coding experience
- nodemon (dev) - Auto-restarts the server on changes
- ts-node (dev) - Run TypeScript directly without compiling
- No need for extra configuration.
- Faster development with automatic reloading.
- Pre-configured TypeScript for type safety.
Feel free to submit issues and pull requests to improve this template!