This projet is a server-side Todo application.
The project use a hexagonal architecture.
The domain
folder contain the business logic of the app.
In usecases
folder, there are some actions which can be execute, such as add todo, remove todo or list all todos.
In ports
folder, there is the contract the secondaries adapters have to implement.
entities
folder contains the entities use by the application, returned to the primaries adapters
The adapters
folder contains two sub-directories : primaries
and secondaries
This folder contains the components which use the business logic. It could be a UI, a console. In this project, it is the routes exposed by the api, as known as controller
in NestJS framework.
This folder contains the components the business part need to use. In this projet, it contains adapters which implement ports
contracts for managing Todo. In first time I built all my app with a InMemory adapter, only storing datas into an array. Then I added a Database adapter.
The back-end is developp with NestJs framework. The database secondary adapter is a Postgres database, manage with TypeORM (version 0.3.X). I use PGAdmin for browse database records.
I also use Docker for building and deploying the NestJs app Docker-compose for communication between NestJs app and Database, for deploying a PGAdmin instance for viewing datas.
- Create a
.env
file based on.env.template
- Run
npm ci
for installing all dependencies - Run
docker-compose up
for downloading and starting all docker container - Run
docker exec poc-nestjs-app npm run typeorm:run
for creating database tables
You can run unit test executing npm run test