TypeScript Express Base is an open-source starter kit for building web applications with TypeScript and Express.js. It provides a solid foundation for creating RESTful APIs or web services with robust and maintainable code.
- TypeScript: Write your code in TypeScript for strong typing and improved development experience. Learn more about TypeScript here.
- Express.js: A fast, minimal, and flexible Node.js web application framework to build robust APIs.
- Prettier & ESLint: Code formatting and linting tools to maintain a consistent coding style. Explore Prettier here and ESLint here.
- Environment Variables: Load environment variables from a
.env
file for configuration. Check out thedotenv
library here. - Nodemon: Automatically restart the server during development for a seamless development experience. Learn more about Nodemon here.
- Dependency Management: Manage your project's dependencies and scripts with Yarn or npm. Explore Yarn here and npm here.
Follow these steps to use this starter kit for your project:
- Clone the Repository:
git clone https://github.com/yourusername/typescript-express-base.git your-app-name
cd your-app-name
- Install Dependecy:
Use your preferred package manager to install project dependencies.
Using npm:
npm install
Using Yarn:
yarn
- Configuration:
Create a .env file in the root directory to set your environment-specific variables. Customize ESLint and Prettier configurations in .eslintrc.js and .prettierrc.js, respectively, as needed.
- Start the Application:
- For development:
Using npm:
npm run start:dev
Using Yarn:
yarn start:dev
- For production:
Using npm:
npm run start:prod
Using Yarn:
yarn start:prod
- Access Your Application:
Visit http://localhost:3000/health in your browser, and you'll see "Hello, Express app is healthy!" if everything is set up correctly.
- Express.js
- TypeScript
- Prettier
- ESLint
- dotenv