A lightweight and flexible Express.js starter template powered by TypeScript. This repository provides a solid foundation for building RESTful APIs and web applications with TypeScript.
- TypeScript Support: Fully configured TypeScript for type safety and modern JavaScript features.
- Modular Architecture: Organized folder structure for easy navigation and maintenance.
- Environment Configuration: Use of
.env
files for configuration management. - Error Handling: Centralized error handling middleware.
Make sure you have the following installed:
-
Clone the repository:
git clone https://github.com/shresthashim/express-ts.git
-
Navigate to the project directory:
cd express-ts
-
Install the dependencies:
npm install # or yarn install
-
Copy the example environment file:
cp .env.example .env
-
Update the
.env
file with your configuration settings.
To start the development server, run:
npm run dev
# or
yarn dev
The server will start on http://localhost:5000.
To run the tests, use:
npm test
# or
yarn test
express-ts/
├── src/
│ ├── controllers/ # Controllers for handling requests
│ ├── middlewares/ # Custom middleware functions
│ ├── models/ # Database models
│ ├── routes/ # API routes
│ ├── services/ # Business logic
│ └── utils/ # Utility functions
├── .env # Environment variables
├── .eslintignore # Files and directories to ignore for ESLint
├── .eslintrc.json # ESLint configuration file
├── .gitignore # Git ignore file
├── package.json # NPM package configuration
└── tsconfig.json # TypeScript configuration
Contributions are welcome! Please feel free to submit a pull request or create an issue for any improvements or suggestions.
This project is licensed under the MIT License.
- Express.js - Fast, unopinionated, minimalist web framework for Node.js.
- TypeScript - A typed superset of JavaScript that compiles to plain JavaScript.
For any inquiries, feel free to reach out via your email.