Skip to content

Repository files navigation

LLM Visibility Mono

A monorepo containing a React frontend (web) and NestJS backend (agent), built with Nx.

Project Structure

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

Shared Packages

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

Using Shared Packages

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';

Prerequisites

  • Node.js (v18 or higher)
  • pnpm (v10 or higher)

Getting Started

1. Install Dependencies

pnpm install

2. Run Applications

Run the React frontend (web)

pnpm nx serve web

The frontend will be available at http://localhost:3001

Run the NestJS backend (agent)

pnpm nx serve agent

The backend will be available at http://localhost:3000

Run both applications concurrently

pnpm nx run-many -t serve -p web agent

3. Build Applications

Build the frontend

pnpm nx build web

Build the backend

pnpm nx build agent

Build all applications

pnpm nx run-many -t build

4. Testing

Run tests for the backend

pnpm nx test agent

5. Linting

Lint the frontend

pnpm nx lint web

Lint the backend

pnpm nx lint agent

Lint all projects

pnpm nx run-many -t lint

Common Nx Commands

View project details

pnpm nx show project web
pnpm nx show project agent

Generate a new library

pnpm nx g @nx/js:lib my-lib

View the project graph

pnpm nx graph

Run any task with Nx

pnpm 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 »

Versioning and releasing

To version and release the library use

npx nx release

Pass --dry-run to see what would happen without actually releasing the library.

Learn more about Nx release »

Keep TypeScript project references up to date

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 sync

You 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:check

Learn more about nx sync

Set up CI!

Step 1

To connect to Nx Cloud, run the following command:

npx nx connect

Connecting to Nx Cloud ensures a fast and scalable CI pipeline. It includes features such as:

Step 2

Use the following command to configure a CI workflow for your workspace:

npx nx g ci-workflow

Learn more about Nx on CI

Install Nx Console

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.

Install Nx Console »

Useful links

Learn more:

And join the Nx community:

About

basic microservice - in progress

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages