A starter template for building Express applications with TypeScript and Mongoose. This template will help you get started quickly with new projects and ensure a consistent setup across your work.
- Express.js for building robust APIs
- TypeScript for static type checking
- Mongoose for MongoDB object modeling
- ESLint for code linting
- Prettier for code formatting
- dotenv for environment variable management
- ts-node-dev for seamless development experience
-
Clone the Repository
git clone https://github.com/Tanzeebul-Tamim/Express-Mongoose-TS-Starter_Pack
-
Install Dependencies
npm install
-
Set Up Environment Variables
Create a
.env
file in the root directory and copy the contents of.env.example
into it. Update the values as needed.cp .env.example .env
Start the development server:
npm run dev
Compile the TypeScript code:
npm run build
Start the production server:
npm run prod
Run ESLint to check for code issues:
npm run lint
Automatically fix linting issues:
npm run lint:fix
Format your code using Prettier:
npm run format
src
├── app
├── config
├── index.ts # Load environment variables using dotenv from the .env file and export them as configuration options
├── app.ts # Express app setup
├── server.ts # Entry point
.env.example # Example environment variables
.eslintignore # Specifies files and directories to ignore during ESLint linting
.eslintrc.json # ESLint configuration
.gitignore # Specifies files and directories to ignore in Git version control
.prettierrc.json # Prettier configuration
package-lock.json # Records the exact dependency tree generated by npm for a project
package.json # NPM scripts, dependencies and dev-dependencies
tsconfig.json # TypeScript configuration
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch
). - Make your changes.
- Commit your changes (
git commit -m 'Add some feature'
). - Push to the branch (
git push origin feature-branch
). - Open a pull request.