First steps
Begin your journey with ExpressoTS! These guides will help you learn and get familiarized with the essential building blocks of ExpressoTS.
Philosophy
ExpressoTS streamlines server-side development by emphasizing clear and structured code. Ideal for both simple APIs and complex systems, ExpressoTS accelerates development and ensures timely, high-quality delivery.
ExpressoTS is a TypeScript framework fully integrated with the Node.js and Expressjs ecosystem. While TypeScript is the primary language, ExpressoTS is fully compatible with JavaScript, and we plan to support other runtimes soon.
In this tutorial, we’ll use TypeScript for most examples, but feel free to switch to vanilla JavaScript if that suits you better.
Architecture
ExpressoTS architecture centers on the Inversify IoC container, which manages dependency injection in class constructors or in properties. This setup ensures that all necessary modules, including routes (controllers), are loaded. Routers then handle incoming requests using use-cases and providers as required.
Here’s an overview of an ExpressoTS application:

- DTO IN/OUT: Defines the structure for incoming and outgoing data.
- Controller: Manages request processing.
- Use Case: Executes specific logic for handling requests.
- Provider: Supplies external functionalities like database access.
- Repository: Handles direct communication with the database.
Pre-requisites
Please make sure that Node.js version >=18.0.0 is installed on your operating system.
Setup
Install the ExpressoTS CLI globally using NPM to get started with your project setup:
Setting up a new ExpressoTS project is quite simple with ExpressoTS CLI. First install the CLI globally with NPM:
npm i -g @expressots/cli
Create a new project by running:
expressots new project-name
Project templates
ExpressoTS provides two project templates to cater to different development needs:
- Non-opinionated: Provides flexibility in project structure and resource scaffolding, with minimal setup.
- Opinionated: Pre-configured for complex projects, enforcing a specific structure and scaffolding pattern.
- Non Opinionated
- Opinionated
Non-opinionated project structure
project-name/
├── src/
│ ├── app.container.ts
│ ├── app.controller.ts
│ ├── app.module.ts
│ ├── app.provider.ts
│ ├── main.ts
├── test/
│ ├── app.controller.spec.ts
| File Name | Description |
|---|---|
| app.container.ts | Dependency injection container. Organizes the application modules. |
| app.controller.ts | A basic controller with a single route. |
| app.module.ts | Application root module. |
| app.provider.ts | Application global configuration file. |
| main.ts | The main entry point of an ExpressoTS application. |
| app.controller.spec.ts | Unit test for the app.controller. |
Opinionated project structure
project-name/
├── src/
│ ├── providers/
│ │ └── app/
│ │ └── app.provider.ts
│ ├── useCases/
│ │ └── app/