
Build an api from inside-out with Node, TypeScript, and test-driven development using a testing library, store data in MongoDB, and run integration tests; a crash course for developers with experience.
Design a rest API in Node and TypeScript to store and retrieve one-time secrets via a URL. Enforce secrets must be longer than three characters and retrievable only once.
Initialize the project by creating a TypeScript source folder, adding a Typekit and desk configuration file, and running a test to verify installation turns green.
Learn how to run test coverage using flags, view coverage reports, and prune unnecessary files like a copyright folder, while noting that production code is not tested in this course.
Define the domain model by implementing a secret with length validation and a custom error for too-short secrets, guided by tests and the constructor.
Develop domain use cases for secret management in a node and typescript project. Define interfaces and a secret repository, and test storing, retrieving, and deleting secrets with mocks.
Implement a token generator service in a Node and TypeScript API using TDD with Jest, validating tokens longer than ten characters and using Unique ID library with tests and mocks.
Implement the secret repository using mongoose, connect to a local MongoDB instance, define secret model and schema, and add tests for get, create, delete operations, including not found errors.
Build REST controllers in Node and TypeScript, guided by Jest test-driven development, focusing on validation errors, secret retrieval, and proper responses using Express.
Implement a robust error handler in a Node and TypeScript API using test-driven development, covering 500 internal server errors, 400 validation errors, and not-found scenarios with user-friendly messages.
Build an Express application with endpoints and controllers, then write integration and unit tests to verify secrets, roads, and the API version one. Embrace a Node and TypeScript TDD workflow.
learn how to run end-to-end tests with docker, spinning up a container, seeding the database with secrets, and validating errors and 400 responses in a node typescript workflow.
recap of building apis with tdd in node and typescript, detailing unit, integration, and end-to-end tests, domain models, use cases, repositories, and a token generator.
In this course we are going to implement from scratch a REST API in Node using Typescript and testing with Jest, but using Test Driven Development (TDD). During this exercise, we will follow the Inside-out TDD approach also known as classicist or referred also sometimes as Chicago school TDD. We will start from deep inside our application and build our way out until we have meet all the business requirements, being at any time covered by our own tests.
The API we are going to build is a clone of the One Time Secret site. We will create an application that stores our secrets and provides us a URL to access them later, but with the condition that we can access that URL one time only. Whenever we attempt to retrieve the same secret again, hitting the same URL for a second time, we will receive an error. We will use a mongodb as a persistence layer.
At the beginning of this course, we will analyze the business requirements just mentioned before and we will see how we translate that into working and well crafted code. We will see how we design the application and how we implement it, using a TDD approach having all the time our production code under control. We will get some inspiration from DDD, Hexagonal arch and CQRS to design our solution.
Kudos to @Panos for the constructive feedback that helped to make this course better.