Giter Club home page Giter Club logo

samuels00 / todo-list-ddd Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 2.62 MB

This project is a Todo-List application that follows Domain-Driven Design (DDD) and Clean Architecture. The goal of the project is to implement a solution that follows best practices in software development and is scalable, maintainable and easy to understand.

TypeScript 73.41% JavaScript 0.27% Shell 26.26% Dockerfile 0.05%
clean-architecture ddd javascript mysql2 nestjs nodejs sequelize typescript tdd

todo-list-ddd's Introduction

Todo-List with DDD and Clean Architecture

About

This project is a Todo-List application that follows Domain-Driven Design (DDD) and Clean Architecture. The application allows users to create, read, update and delete tasks. The goal of the project is to implement a solution that follows best practices in software development and is scalable, maintainable and easy to understand.

Decisions

In this project, we used several patterns and techniques to implement the solution. Some of these include:

  • Module Shared: this is a way to group common code and make it reusable in different parts of the application.
  • Repository: a pattern that abstracts the data access layer and provides a way to interact with the database.
  • Use-Case: this pattern defines the business logic of the application and helps to keep the code organized and easy to understand.
  • Mapper: this pattern helps to transform data from one representation to another, for example, from a database model to a domain model.
  • DTOs (Data Transfer Objects): objects that are used to transfer data between different layers of the application, for example, between the application layer and the domain layer.
  • Builder: a pattern that helps to create complex objects step by step, making it easier to understand the code and reducing the number of constructors.
  • Fixture: data that is used to set up the environment for testing.
  • Presenter: a pattern that helps to transform data from the domain layer to a representation that can be easily consumed by the user interface.
  • Providers: components that provide a specific service to the application, for example, a database provider or a network provider.
  • Wrapper Data: a pattern that helps to wrap data with additional information, for example, metadata that is used to control the behavior of the application.

Technologies Used

  • Node.js
  • JavaScript
  • Nest.js
  • TypeScript
  • Jest
  • MySQL2
  • Sequelize

Tests

In this project, the coverage target was 80% for all tests. To achieve this, use a combination of different testing techniques such as unit testing, integration testing, and e2e testing.

Jest was used as a testing framework and we follow the Test Pyramid, which means that I intend to have more unit tests than integration tests and less e2e tests.

the Builder pattern was used to create test data.

1675888237239

Usage

  • Run the project on Docker with two MySQL containers (test e dev)
docker-compose --profile dev up --build
  • To run just the tests, use the command
docker-compose up --build
  • Enter application container
docker-compose exec app bash
  • Run the tests with coverage
npm run test:cov -- --runInBand --detectOpenHandles
  • Upload the nestjs application
npm run start:dev
  • available endpoints
# Todos #

http://localhost:3000/todos
  • Examples of using the API can be found in the api.http file in the root of the project

Documentation

Documentation for this project is currently in progress and will be added soon.

todo-list-ddd's People

Contributors

samuels00 avatar

Stargazers

Samuel Akhaze avatar

Watchers

Kostas Georgiou avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.