Skip to content

A template for setting up express server using typescript!

License

Notifications You must be signed in to change notification settings

shresthashim/express-ts

Repository files navigation

Express TypeScript Starter

Express TypeScript Node.js

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.


Features

  • 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.

Getting Started

Prerequisites

Make sure you have the following installed:

Installation

  1. Clone the repository:

    git clone https://github.com/shresthashim/express-ts.git
  2. Navigate to the project directory:

    cd express-ts
  3. Install the dependencies:

    npm install
    # or
    yarn install

Configuration

  1. Copy the example environment file:

    cp .env.example .env
  2. Update the .env file with your configuration settings.

Running the Application

To start the development server, run:

npm run dev
# or
yarn dev

The server will start on http://localhost:5000.

Running Tests

To run the tests, use:

npm test
# or
yarn test

Folder Structure

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


Contributing

Contributions are welcome! Please feel free to submit a pull request or create an issue for any improvements or suggestions.


License

This project is licensed under the MIT License.


Acknowledgements

  • Express.js - Fast, unopinionated, minimalist web framework for Node.js.
  • TypeScript - A typed superset of JavaScript that compiles to plain JavaScript.

Contact

For any inquiries, feel free to reach out via your email.

About

A template for setting up express server using typescript!

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published