A monorepo containing a React frontend (web) and NestJS backend (agent), built with Nx.
llm-visibility-mono/
├── web/ # React frontend application (port 3001)
├── agent/ # NestJS backend application (port 3000)
└── packages/ # Shared libraries
├── @llm/circuit-breaker
├── @llm/config
├── @llm/decorators
├── @llm/filters
├── @llm/interceptors
├── @llm/rate-limiter
├── @llm/redis
├── @llm/repository
├── @llm/shared
├── @llm/types
└── @llm/utils
The monorepo includes the following shared packages that can be imported using @llm/* aliases:
- @llm/circuit-breaker - Circuit breaker pattern implementation
- @llm/config - NestJS configuration module
- @llm/decorators - Custom decorators (API response, timing, cache)
- @llm/filters - Exception filters
- @llm/interceptors - Request/response interceptors
- @llm/rate-limiter - Rate limiting functionality
- @llm/redis - Redis integration module
- @llm/repository - Repository pattern implementation
- @llm/shared - Shared utilities and constants
- @llm/types - TypeScript type definitions
- @llm/utils - Utility functions
Import from packages using the path aliases:
// In agent or web applications
import { SomeDecorator } from '@llm/decorators';
import { RedisModule } from '@llm/redis';
import { CircuitBreaker } from '@llm/circuit-breaker';- Node.js (v18 or higher)
- pnpm (v10 or higher)
pnpm installpnpm nx serve webThe frontend will be available at http://localhost:3001
pnpm nx serve agentThe backend will be available at http://localhost:3000
pnpm nx run-many -t serve -p web agentpnpm nx build webpnpm nx build agentpnpm nx run-many -t buildpnpm nx test agentpnpm nx lint webpnpm nx lint agentpnpm nx run-many -t lintpnpm nx show project web
pnpm nx show project agentpnpm nx g @nx/js:lib my-libpnpm nx graphpnpm nx <target> <project-name>These targets are either inferred automatically or defined in the project.json or package.json files.
More about running tasks in the docs »
To version and release the library use
npx nx release
Pass --dry-run to see what would happen without actually releasing the library.
Nx automatically updates TypeScript project references in tsconfig.json files to ensure they remain accurate based on your project dependencies (import or require statements). This sync is automatically done when running tasks such as build or typecheck, which require updated references to function correctly.
To manually trigger the process to sync the project graph dependencies information to the TypeScript project references, run the following command:
npx nx syncYou can enforce that the TypeScript project references are always in the correct state when running in CI by adding a step to your CI job configuration that runs the following command:
npx nx sync:checkTo connect to Nx Cloud, run the following command:
npx nx connectConnecting to Nx Cloud ensures a fast and scalable CI pipeline. It includes features such as:
- Remote caching
- Task distribution across multiple machines
- Automated e2e test splitting
- Task flakiness detection and rerunning
Use the following command to configure a CI workflow for your workspace:
npx nx g ci-workflowNx 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: