Giter Site home page Giter Site logo

erkobridee / nx-todos Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 0.0 3.29 MB

ToDos app using the Nx (Extensible Dev Tools for Monorepos)

License: ISC License

JavaScript 1.71% TypeScript 85.85% HTML 0.47% SCSS 11.97%
nx-workspaces nrwl monorepos react nx typescript todosapp frontend backend

nx-todos's Introduction

NxTodos

ToDos project example

This project was generated using Nx (v14.5.10)

ℹ️  use the node.js v16 LTS

Goal

  • test a monorepository structure in a more entreprise scenario

Documentation

Project dependencies graph

nx dep-graph

Findings

  • Developing a project which contains an api and a frontend application, you need to have two terminals to run each project, for example, in one terminal you run nx serve api and in another one, you run nx serve frontend

  • It's really interesting breakdown the application into smaller libs, so we have better code isolation, the possibility to run tests on that code and also using the nx dep-graph have a better understanding of the project code and how the parts of the project relate to each other

  • The libraries created by the Nx CLI has a pre-defined code structure (more information about it here)

    • The main concept of a library adopted is to be a "Black Box", which what's exposed from the library is defined on the src/index.ts

    • It's possible to have more flexibility and expose the whole content from the library (that's really useful to define a UI components library). To do that, you need to reorganize the src/ folder in the what that you want to access and change the {project_root_folder}/tsconfig.json the paths configuration alias to be something like

{
  ...
  "paths": {
    ...
    "@namespace/ui-components/*": ["libs/ui-components/src/*"]
    ...
  }
  ...
}
  • When you run the build Nx CLI command, for example, nx build app-name that will generate the output of the build on the directory dist/app/app-name

  • Running the frontend and backend together, based on the following tweet

    • nx run-many --target=serve --projects=todos,api --parallel=true

nx-todos's People

Contributors

dependabot[bot] avatar erkobridee avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

nx-todos's Issues

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.