This repository is intended to test and validate the up-to-date configuration for a React integrated monorepo built with Nrwl Nx, Tailwind CSS, and shadcn components. The primary focus is to implement and validate the best approach to routing with React Router that works both locally (running on localhost) and when deployed to a GitHub Pages subdirectory for the project pages-routing
.
This project follows the Nx monorepo structure, organizing applications and libraries for better maintainability and scalability.
- React: A JavaScript library for building user interfaces.
- Nrwl Nx: A set of extensible dev tools for monorepos, which helps in managing and scaling the project.
- Tailwind CSS: A utility-first CSS framework for styling the components.
- shadcn/ui: A set of reusable UI components for consistent design.
- React Router: A library for routing in React applications.
- TypeScript: A typed superset of JavaScript that compiles to plain JavaScript.
- Vitest: A Vite-native unit testing framework.
- Playwright: An end-to-end testing framework.
To run the development server for the demo
app, use:
npx nx serve demo
To create a production bundle:
npx nx build demo
To see all available targets to run for a project, run:
npx nx show project demo
These targets are either inferred automatically or defined in the project.json
or package.json
files.
More about running tasks in the docs »
While you could add new projects to your workspace manually, you might want to leverage Nx plugins and their code generation feature.
Use the plugin's generator to create new projects.
To generate a new application, use:
npx nx g @nx/react:app demo
To generate a new library, use:
npx nx g @nx/react:lib mylib
You can use npx nx list
to get a list of installed plugins. Then, run npx nx list <plugin-name>
to learn about more specific capabilities of a particular plugin. Alternatively, install Nx Console to browse plugins and generators in your IDE.
Learn more about Nx plugins » | Browse the plugin registry »
Nx Console is an editor extension that enriches your developer experience. It lets you run tasks, generate code, and improves code autocompletion in your IDE. It is available for VSCode and IntelliJ.
Learn more:
- Learn more about this workspace setup
- Learn about Nx on CI
- Releasing Packages with Nx release
- What are Nx plugins?
And join the Nx community:
For more detailed information about the project, please visit our Wiki.
If you encounter any issues or have any suggestions, please report them on our Issue Tracker.
In the project directory, you can run:
Builds all projects in the workspace.
Builds the demo
project.
Builds the shared
project.
Builds all affected projects.
Lints all projects in the workspace.
Lints the demo
project.
Lints the shared
project.
Lints all affected projects.
Serves the demo
project.
Runs tests for all projects in the workspace.
Runs tests for the demo
project.
Runs tests for the shared
project.
Runs tests for all affected projects.
Runs type checking for all projects in the workspace.
Runs type checking for the demo
project.
Runs type checking for the shared
project.
Runs type checking for all affected projects.