edwinhern / express-typescript-2024

Express + TypeScript + Boilerplate for Web / API App

Home Page:https://express.hernandezserver.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

πŸš€ Express TypeScript Boilerplate 2024

Build Test Code Quality Docker Image CI

Hey There! πŸ™Œ 
🀾 that ⭐️ button if you like this boilerplate. 

🌟 Introduction

Welcome to the Express TypeScript Boilerplate 2024 – a streamlined, efficient, and scalable foundation for building powerful backend services with modern tools and practices in Express.js and TypeScript.

πŸ’‘ Motivation

This boilerplate aims to:

  • ✨ Reduce setup time for new projects
  • πŸ“Š Ensure code consistency and quality
  • ⚑ Facilitate rapid development
  • πŸ›‘οΈ Encourage best practices in security, testing, and performance

πŸš€ Features

  • πŸ“ Modular Structure: Organized by feature for easy navigation and scalability
  • πŸ’¨ Faster Execution with tsx: Rapid TypeScript execution with tsx and type checking with tsc
  • 🌐 Stable Node Environment: Latest LTS Node version in .nvmrc
  • πŸ”§ Simplified Environment Variables: Managed with Envalid
  • πŸ”— Path Aliases: Cleaner code with shortcut imports
  • πŸ”„ Renovate Integration: Automatic updates for dependencies
  • πŸ”’ Security: Helmet for HTTP header security and CORS setup
  • πŸ“Š Logging: Efficient logging with pino-http
  • πŸ§ͺ Comprehensive Testing: Setup with Vitest and Supertest
  • πŸ”‘ Code Quality Assurance: Husky and lint-staged for consistent quality
  • βœ… Unified Code Style: Biomejs for consistent coding standards
  • πŸ“ƒ API Response Standardization: ServiceResponse class for consistent API responses
  • 🐳 Docker Support: Ready for containerization and deployment
  • πŸ“ Input Validation with Zod: Strongly typed request validation using Zod
  • 🧩 Swagger UI: Interactive API documentation generated from Zod schemas

πŸ› οΈ Getting Started

Video Demo

For a visual guide, watch the video demo to see the setup and running of the project.

Step-by-Step Guide

Step 1: πŸš€ Initial Setup

  • Clone the repository: git clone https://github.com/edwinhern/express-typescript-2024.git
  • Navigate: cd express-typescript-2024
  • Install dependencies: npm ci

Step 2: βš™οΈ Environment Configuration

  • Create .env: Copy .env.template to .env
  • Update .env: Fill in necessary environment variables

Step 3: πŸƒβ€β™‚οΈ Running the Project

  • Development Mode: npm run dev
  • Building: npm run build
  • Production Mode: Set .env to NODE_ENV="production" then npm run build && npm run start

🀝 Feedback and Contributions

We'd love to hear your feedback and suggestions for further improvements. Feel free to contribute and join us in making backend development cleaner and faster!

πŸŽ‰ Happy coding!

About

Express + TypeScript + Boilerplate for Web / API App

https://express.hernandezserver.com/

License:MIT License


Languages

Language:TypeScript 98.4%Language:Dockerfile 1.1%Language:Shell 0.5%