Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tanzeebul-tamim/express-mongoose-ts-starter_pack
This repository contains a starter template for Express.js applications with TypeScript and Mongoose integration.
https://github.com/tanzeebul-tamim/express-mongoose-ts-starter_pack
boilerplate-template dotenv eslint expressjs mongodb mongoosejs prettierrc starter-template ts-node-dev typescript
Last synced: 3 months ago
JSON representation
This repository contains a starter template for Express.js applications with TypeScript and Mongoose integration.
- Host: GitHub
- URL: https://github.com/tanzeebul-tamim/express-mongoose-ts-starter_pack
- Owner: Tanzeebul-Tamim
- Created: 2024-05-21T07:09:09.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-07-10T17:31:53.000Z (6 months ago)
- Last Synced: 2024-09-27T20:23:27.763Z (4 months ago)
- Topics: boilerplate-template, dotenv, eslint, expressjs, mongodb, mongoosejs, prettierrc, starter-template, ts-node-dev, typescript
- Language: TypeScript
- Homepage:
- Size: 34.2 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Express TypeScript Mongoose Starter Pack
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.
## Features
- **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## Installation
1. **Clone the Repository**
```bash
git clone https://github.com/Tanzeebul-Tamim/Express-Mongoose-TS-Starter_Pack
```2. **Install Dependencies**
```bash
npm install
```3. **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.
```bash
cp .env.example .env
```## Development
Start the development server:
```bash
npm run dev
```## Build
Compile the TypeScript code:
```bash
npm run build
```Start the production server:
```bash
npm run prod
```## Lint
Run ESLint to check for code issues:
```bash
npm run lint
```Automatically fix linting issues:
```bash
npm run lint:fix
```## Format
Format your code using Prettier:
```bash
npm run format
```## Project Structure
```
./project_root
├── 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
```## Contributing
1. Fork the repository.
2. Create a new branch (`git checkout -b feature-branch`).
3. Make your changes.
4. Commit your changes (`git commit -m 'Add some feature'`).
5. Push to the branch (`git push origin feature-branch`).
6. Open a pull request.