expresss-ts
v1.0.7
Published
CLI to create an Express TypeScript starter project
Maintainers
Readme
Express TypeScript Starter
This is a starter project for building a backend application with Express and TypeScript.
Features
- Express server setup
- TypeScript configuration
- Nodemon for development
- Health check route
- ESLint for linting
- Proper project structure
Installation
To install the package globally, run:
pnpm install -g expresss-ts@latestTo run the package without installing, use:
pnpm dlx expresss-ts@latest <project-name>To install the package globally, run:
npm install -g expresss-ts@latestTo run the package without installing, use:
npx expresss-ts@latest <project-name>Getting Started
Note: This project uses pnpm as the default package manager. If you prefer using other package managers, you can replace pnpm with your preferred package manager in the scripts.
- Clone this repository
- Run
pnpm installto install dependencies - Create a
.envfile in the root directory and add your environment variables (see.env.example) - Run
pnpm devto start the development server - Visit
http://localhost:5555/api/healthto check if the server is running
Scripts
pnpm dev: Start the development server with Nodemonpnpm build: Build the TypeScript codepnpm start: Start the production serverpnpm lint: Run ESLint
Project Structure
src/
├── controllers/
│ ├── health.controllers.ts
│ └── example.controllers.ts
├── db/
│ └── connection.ts
├── models/
│ └── example.model.ts
├── routes/
│ ├── health.routes.ts
│ └── example.routes.ts
├── types/
│ └── example.types.ts
├── utils/
│ ├── ApiError.ts
│ ├── ApiResponse.ts
│ ├── AsyncHandler.ts
│ └── example.utils.ts
└── index.tsLicense
This project is licensed under the MIT License. See the LICENSE file for more details. Feel free to use this project or fork it on GitHub.
