A fully tested, production‑ready Node.js API built with TypeScript, Jest, Supertest, and Express — designed to demonstrate solid engineering practices, automated testing, clean architecture, and CI/CD pipelines.
This project is part of my journey into backend engineering and automated testing. It showcases how I structure applications, write maintainable code, and ensure reliability through unit and integration tests.
- Node.js
- TypeScript
- Express
- Jest
- Supertest
- ts-jest
- tsx
- GitHub Actions (CI)
- Docker & Docker Compose
- Unit testing for isolated business logic
- Integration testing for real HTTP flows
- Mocking dependencies
- Test coverage reporting
- Clean architecture (
controller→service→repository) - Continuous Integration with GitHub Actions
- Containerization with Docker
├── src
│ ├── app.ts
│ ├── server.ts
│ ├── sum.ts
│ └── products
│ ├── products.controller.ts
│ ├── products.service.ts
│ ├── products.repository.ts
│ └── products.types.ts
│
├── tests
│ ├── unit
│ │ ├── sum.test.ts
│ │ └── products.service.test.ts
│ └── integration
│ └── products.routes.test.ts
│
├── jest.config.ts
├── tsconfig.json
├── Dockerfile
├── docker-compose.yml
└── package.json
Unit tests validate isolated logic such as services and pure functions.
- Example:
products.service.test.ts - Validates business rules
- Ensures error handling
- Uses mocks when needed
- Guarantees predictable behavior
Integration tests validate real HTTP flows using Supertest.
- Example:
products.routes.test.ts - Tests endpoints end‑to‑end
- Ensures controllers, services, and repositories work together
- Validates status codes, JSON responses, and error cases
Generate coverage:
npm test -- --coverage
"scripts": { "dev": "tsx watch src/server.ts", "test:dev": "jest --watchAll", "test": "jest" }
- This project includes a GitHub Actions workflow that automatically:
- Installs dependencies
- Runs all tests
- Validates code quality
- Blocks PRs if tests fail
- Workflow file: .github/workflows/ci.yml
Build and run the API using Docker:
docker-compose up --build
This ensures consistent execution across any environment.