A simple Typescript-Express starter kit, designed to provide a solid foundation for building your next great project.
This starter kit provides a comprehensive template for developing Express applications using Typescript. It comes with all the essential dependencies and configurations needed to kickstart your development process without wasting time on manual setup.
- Set up the basic app, with all it's features listed below
- Set up Github Workflow
- Implement Error Handling
- Improve the Github Workflow
- Add Docker Workflow to the project
- Improve the Docker Workflow
- Implement CI/CD PipeLine
- Optimize the performance
- Investigate and fix any known issues or bugs
- Consider adding additional features or integrations to enhance the functionality
Feel free to contribute to any of the above items or suggest your own improvements. We appreciate any contributions to make this starter kit even better!
- Express: A fast, unopinionated web framework for Node.js.
- Typescript: A statically-typed superset of JavaScript that enables robust type checking and improved developer productivity.
- Cors: A middleware for handling Cross-Origin Resource Sharing (CORS) in Express applications.
- Dotenv: A zero-dependency module that loads environment variables from a
.env
file intoprocess.env
. - Helmet: A collection of middleware to help secure Express applications by setting various HTTP headers.
- Winston: A versatile logging library for Node.js.
Make sure you have the following dependencies installed:
- Node.js
- npm
- Docker
-
Clone the repository:
git clone https://github.com/vAndrewKarma/Typescript-Express-StarterKit.git
-
Change to the project directory:
cd Typescript-Express-StarterKit
-
Install the dependencies:
npm install
-
Change
.env.example
file into.env
in the project root. -
Customize the configuration files according to your project requirements.
-
Development: Run the application in development mode with automatic restart using the following command:
npm run dev
-
Production: Run the application inside a docker container using the docker-compose:
docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d
test
: Run the Jest test suite.prepare
: Set up Husky pre-commit hooks and initialize the project.dev
: Run the application in development mode with automatic restart (using Nodemon).prettier
: Check if code formatting adheres to Prettier rules.lint
: Run ESLint for linting code.start-build
: Run and build the app.start
: Run the app.build
: Build the Typescript code using the TypeScript compiler.lint:fix
: Run ESLint and fix linting errors automatically.format
: Format code using Prettier.ready
: Prepare the codebase for production by formatting, linting, and building the code.precommit
: Execute lint-staged for staged files during pre-commit.
To containerize your Typescript-Express-StarterKit application using Docker, follow these steps:
- Run the Docker container in development mode:
docker-compose -f docker-compose.yml -f docker-compose.dev.yml up -d
- Good job, now your server is listening to the port you have configured in the
docker-composer
.
Contributions are welcome! Please follow the guidelines in CONTRIBUTING.md to contribute to this project.
This project is licensed under the MIT License.
For any inquiries or feedback, please contact: Discord.
Author: Karma Andrew