This is a minimal starter project to build an API using Express.js with TypeScript. It includes a basic project structure, essential TypeScript configuration, and basic scripts for development.
- Express.js: Fast, unopinionated web framework for Node.js
- TypeScript: Typed JavaScript at scale
- Nodemon: Automatically restarts the server on file changes
- ESLint: Linter for finding and fixing code issues
-
Clone the repository:
git clone https://github.com/murtazabaanihali/express-ts-starter.git cd express-ts-starter
-
Install dependencies:
npm install # or yarn install
.
├── src # Source code
│ └── app.ts # Entry point of the application
├── dist # Compiled JavaScript output
├── .eslintrc.json # ESLint configuration
├── tsconfig.json # TypeScript configuration
└── package.json # Project metadata and dependencies
-
Build the project:
npm run build
-
Start the server:
npm start
Alternatively, you can use the development mode which will automatically restart the server on file changes:
npm run dev
The server will be running on http://localhost:3000.
-
build
: Compiles the TypeScript files into JavaScript in thedist/
directory.npm run build
-
start
: Runs the compiled app from thedist/
folder using Node.js.npm start
-
dev
: Runs the app in development mode withnodemon
, watching for file changes.npm run dev
-
lint
: Lints the project using ESLint with TypeScript extensions.npm run lint
Do whatever you want to this repo.