Skip to content

vihuvac/expressure

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Expressure Logo

Expressure

A modern, production-ready boilerplate for building scalable Node.js APIs.

Node.js Version TypeScript Version License Docker Ready
Tests Status Coverage
Security Policy Code of Conduct


πŸ“– Overview

Expressure is a robust and opinionated boilerplate designed to streamline the development of scalable Node.js APIs. Built with Express.js 5, TypeScript, and OpenAPI 3, it provides a solid foundation for both monolithic applications and microservices.

We've handled the heavy liftingβ€”configuration, structure, and toolingβ€”so you can focus on building features with zero friction.

✨ Key Features

  • πŸš€ Modern Stack: Built on Express.js 5 and Node.js 20+.
  • πŸ’ͺ Type-Safe: Full TypeScript support for robust and maintainable code.
  • πŸ“„ OpenAPI 3 First: API-first design with auto-generated Swagger documentation.
  • 🐳 Docker Ready: Pre-configured Dockerfile and docker-compose for seamless containerization.
  • πŸ›‘οΈ Secure: Integrated Helmet for security headers and Cors configuration.
  • πŸ“ Logging: High-performance logging with Pino.
  • πŸ§ͺ Testing: Comprehensive testing setup with Jest.
  • 🧹 Code Quality: Linting and formatting with ESLint, Prettier, and Husky hooks.
  • βš™οΈ Configurable: Environment-based configuration management.

πŸ› οΈ System Requirements

Before you begin, ensure you have the following installed:

  • Node.js: v20.x or higher
  • PNPM: v10.23.0 or higher (Recommended package manager)
  • Docker: v27.x or higher (Optional, but recommended for containerization)

πŸš€ Getting Started

1. Clone the Repository

git clone git@github.com:vihuvac/expressure.git
cd expressure

2. Configure Environment

Set up your environment variables by copying the template:

cp .env.template .env

IMPORTANT

Ensure NODE_ENV is set to development for local work. Adjust other settings in .env or config/development.json as needed.

3. Install Dependencies

pnpm install --frozen-lockfile

4. Run the Application

Development Mode

Starts the application with hot-reloading.

pnpm dev

Debug Mode

Runs the app with inspection enabled on port 9888.

pnpm debug

Production Build

Builds and starts the compiled JavaScript application.

pnpm build
pnpm start

🐳 Docker Support

Expressure comes with first-class Docker support.

Start with Docker Compose

pnpm docker:up
# OR
docker compose up -d

This will start the API and detach it to the background.

View Logs

docker logs -f expressure

Stop Containers

pnpm docker:down

πŸ“š API Documentation

When the application is running (in non-production environments), you can access the interactive API documentation via Swagger UI.

URL: http://localhost:9889/api/docs

Swagger UI

Generate comprehensive technical documentation from your code comments using JSDoc. Documentation is automatically versioned and saved to the docs directory.

pnpm docs:generate

JSDocs

πŸ“‚ Project Structure

src/
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ constants/    # Global constants and enums
β”‚   β”œβ”€β”€ controllers/  # Route controllers (request handlers)
β”‚   β”œβ”€β”€ helpers/      # Utility functions and helpers
β”‚   β”œβ”€β”€ libs/         # Third-party library wrappers/configurations
β”‚   β”œβ”€β”€ middlewares/  # Express middlewares
β”‚   β”œβ”€β”€ specs/        # OpenAPI specifications
β”‚   └── app.ts        # App entry point and configuration
β”œβ”€β”€ tests/            # Unit and integration tests
└── app.ts            # Main entry file

πŸ§ͺ Running Tests

Ensure your code is reliable by running the test suite.

# Run all tests
pnpm test

# Run tests in watch mode
pnpm test:debug

# Generate coverage report
pnpm test:coverage

🀝 Contributing

Contributions are welcome! Check out the Contribution Guide.

πŸ“„ License

This project is licensed under the MIT License. See the LICENSE file for more details.

Additional Resources

Project

Tools

About

Expressure is a modern, opinionated boilerplate for building scalable NodeJS APIs with Express.js, TypeScript, OpenAPI, and Docker. Whether you're crafting a monolith or spinning up microservices, Expressure gives you a clean, consistent foundation with smart defaults and zero friction.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors