Git Product home page Git Product logo

agustinallamanocosta / gtdfront Goto Github PK

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

Task List App to show all my knowledge about CI/CD and best practices :D

Home Page: https://gtd.agustinallamanocosta.com

HTML 79.42% TypeScript 18.23% Shell 0.05% Dockerfile 0.05% CSS 0.85% JavaScript 1.40%
cicd cypress nodejs react styled-components tdd typescript firebase trunk-based-development jest react-testing-library docker docker-compose

gtdfront's Introduction

Get Things Done Front End

What's in this repo?

This repository showcases my abilities as a System Engineer. It contains a simple app for task management, encompassing a full CI/CD pipeline. The implementation includes continuous integration, trunk-based development, component testing, end-to-end testing, unit testing, build processes, release processes, and versioning processes. It adheres to good practices such as Clean Code and TDD (Test-Driven Development).

Technologies involved

The technologies used include React.js 18, TypeScript, Vite, Storybook, Styled Components, CSS, Firebase, GitHub Actions, Docker, Docker-Compose, Bash scripting, Cypress, DotEnv Vault, React Testing Library, Babel, Jest, Prettier, and Axios.

Why React.js 18, TypeScript, Vite, Storybook, Styled Components, CSS?

The idea behind using React.js 18, TypeScript, Vite, Storybook, and Styled Components is to create a small project that is easy to manage and update. To achieve this, it's crucial to maintain all the logic in the same language. With this combination of technologies, I am capable of coding primarily in TypeScript, ensuring consistency and efficiency throughout the project.

Practicies

How Does CI/CD Work?

To answer this question, we first need to define what we seek in a pipeline. We can say that a pipeline is a unique way to release software to users, where the approach is clear, understandable, reliable, and repeatable. Additionally, a pipeline helps us verify and trace our changes.

To achieve that, I follow a structure with the following steps:

Preparation:

Here, we install all the dependencies and configure the app for later use in the pipeline. The idea is to use the same set of dependencies and configurations to ensure we have installed everything we need!

In the pipeline of this repo, this step is achieved in the job install-dep.

Validation:

In this step, we want to ensure that our code can run and be understood by the rest of the team members. Generally, here we run lint validation, execute unit tests, and generate evidence of the results, e.g., test coverage.

In the pipeline of this repo, this step is achieved in the jobs lint, test, and component_testing.

Building:

In this step, our aim is to create our binary or package to be released in all the environments we have. The idea is to generate ONE binary file/package/release to be promoted throughout the deployment process. Simultaneously, this process makes this result available to others, e.g., pushing a package into a repository or a Docker image into DockerHub.

In the pipeline of this repo, this step is achieved in the jobs build, version, and creating_release.

Verification:

Similar to the Validation step, but with a difference, here we want to run Acceptance Tests. Acceptance tests are those tests which exercise the whole app, including integration with the database, authentication, etc. We run the minimum tests needed to ensure the app is running with the new changes and does not disrupt the app's flow.

In the pipeline of this repo, this step is achieved in the job end_to_end_testing.

Deployment:

Finally, we can deploy our app into the environment we selected! In this step, we aim to run all the necessary processes to deploy our binaries into a new environment (usually production). The output of the result is stored to be read in the future if necessary.

In the pipeline of this repo, this step is achieved in the job deploy_on_firebase.

Deployment Is Not the Same as Release:

After all these steps, your changes and code are in a new environment, but that does not mean the users can see it! Deploying a change ensures your code is running in a new PC, different from yours. Release means all users of your app can use your new code and changes. This difference is important because in other types of apps, it involves further actions and processes to achieve. In this case, we use Continuous Integration and Trunk-Based Development, meaning all changes in main/master are deployed and released in production.

Secret Managment

The repository's secret and environment variables are managed using the dotenv vault. Utilizing this tool has significantly simplified the lifecycle management of environment values. It's important to note that environment changes occur not only across different environments (such as local, CI, and e2e), but also in specific contexts like Cypress or within the CI pipeline. Therefore, each variable requires consistent security measures for updating and versioning to ensure integrity and security across all instances.

Patterns

Repository

One of the main problems of any system is technical leakage. What this means is that the code used to manage certain frameworks or to integrate them with your code seeps into the code used to define business rules. The issue with this leakage is the difficulty it poses for future refactors, performance improvements, or changing current implementations. To mitigate this problem, we can implement patterns to encapsulate this logic and provide interfaces to interact with this code. In this application, I utilize a repository pattern to manage user data. This repository contains all the necessary code to save data and update states without exposing the implementations. For example:

In this app we use a repository, which is a stateless function, meaning it does not manage any state and solely comprises functions to access the user data information through Firebase or local storage, as well as managing all the required configurations. This repository is then used within a hook, responsible for managing state used to store the results of repository queries and updating them when necessary. Additionally, it provides an interface to access this information without exposing the states at all. This pattern encapsulates the data structure used to store user data (in this case, a JavaScript Map) within the repository and the hook. When we want to access an item (the DTO used to represent the user task), we call a function with the item's ID, or we can retrieve an array containing all the items. This might seem unnecessary, but if we decide to change the implementation from a Map to a Set, for instance, we only need to refactor the repository and the hook while keeping the interface the same, thereby avoiding changes to the business logic. Another scenario could involve using a different type of database for local testing or testing in CI, where we do not want to distribute Firebase credentials for security reasons. In such cases, we can implement an Injection Dependency pattern, allowing us to inject a new repository with a new implementation to connect with a MongoDB database.

Utilizing patterns to isolate technical code and maintain clear separation from business logic is one of the main principles derived from a series of patterns and practices aimed at achieving what developers call 'good code'.

gtdfront's People

Contributors

agustinallamanocosta avatar

Stargazers

 avatar  avatar

Watchers

 avatar

gtdfront's Issues

tareas activas

Como usuario quiero poder seleccionar una tarea como activa, siempre y cuando tenga espacio en los slot configurados como activos.

Crear prototipo en el figma

Idea:

Contenedor flotanta con botones redondeados, que nos permite hacer un crud de las tareas, ademas si tiene arriba un label con informacion de que parte del proyecto nos encontramos. Ademas se tiene una seccion del avatar en la esquina superior derecha que nos permite hacer configuracion sobre nuestro perfil. Abajo del contenedor principal si tiene un slider donde se puede ver que tareas tenemos activar y un indicar del limite del mismo, este slider nos permite marcar las tareas como terminadas y ademas nos da acceso al archivo de tareas.

Cada tarea va a tener un label que nos indicara en que categoria esta y la posibilidad de sumar una listado de acciones con fechas. Tambien pueden tener una fecha de vencimiento y configurar que se envieen recordatorios.

GTD: https://www.pdcahome.com/60620/el-metodo-gtd-getting-things-done-una-forma-de-mejorar-tu-productividad/

Estados: RECOPILAR, PROCESAR, ORGANIZAR, REVISAR, HACER

El ciclo de Get the Things Done se compone de un inbox donde se ponen todas las ideas o tareas que uno tiene que hacer a lo largo de un tiempo, cuando llega la hora de revision, uno ve lo que tienen en el inbox y se pregunta:

Esta tarea requiere de una accion? y esta accion la puedo o debo hacer yo?
Si no requiere una accion la podemos archivo para hacer un seguimiento o descartarla.

Despues se pasa a la etapa de Organizacion:

Consiste en clasificar las acciones del paso anterior en 4 grupos/categorias:
Acciones por hacer proximamente son las tareas que tienen una accion por hacer de forma inmediata.
Proyecto tareas que requieren un seguimiento o multiples acciones.
En espera acciones que requieren de un evento o accion externa.
Posibles cosas a futuro cosas de poca prioridad que no tenemos pensado hacer.

Despues solo queda revisar las tareas y ejecutar las tareas.

Tareas

  • Crear version oscura
  • Crear version clara
  • Mobile FIrts

split task

Como usuario al momento de estar viendo una tarea, quiero tener la posibilidad de partir esa tarea en otras.

configuracion de horas de revision

como usuario quiero poder configurar una hora de revision de mis tareas, al llegar esa hora se muestran las tareas en el inbox y se habilita la toma de decisiones sobre las mismas

Criterios de aceptacion:

tomar acciones sobre las tareas

Como usuario, cuando llega la hora de revision quiero poder poder decidir si:
Puedo tomar la tarea en ese momento.
Poder marcar la tarea para mas adelante.

metricas

como usuario quiero poder ver la cantidad de tareas que vengo cumpliendo cada determinado tiempo

cargar tareas

como usuario quiero poder cargar tareas en el inbox y no verlas hasta la hora de rebision

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.