### Install Dependencies and Start Development Server Source: https://github.com/rh-aiservices-bu/litemaas/blob/main/CLAUDE.md Install project dependencies and start the backend and frontend development servers with auto-reloading and logging. ```bash npm install npm run dev ``` -------------------------------- ### Install Dependencies and Start Development Servers Source: https://github.com/rh-aiservices-bu/litemaas/blob/main/docs/development/quota-limits-test-guide.md Installs project dependencies and starts the backend and frontend development servers. Use `dev:logged` for structured log files. ```bash npm install # first time only npm run dev # starts backend (:8081) + frontend (:3000) with auto-reload ``` ```bash npm run dev:logged # logs are written to logs/backend.log and logs/frontend.log ``` -------------------------------- ### Copy Example Configuration Source: https://github.com/rh-aiservices-bu/litemaas/blob/main/deployment/kustomize/README.md Copy the example user-values.env file to start customizing your deployment configuration. ```bash cp user-values.env.example user-values.env ``` -------------------------------- ### Start Development Servers Source: https://github.com/rh-aiservices-bu/litemaas/blob/main/docs/development/pattern-reference.md Use this command to start the development servers for the project. Ensure all dependencies are installed before running. ```bash # Start development servers npm run dev ``` -------------------------------- ### Setup Test Database and Run Tests Source: https://github.com/rh-aiservices-bu/litemaas/blob/main/CLAUDE.md Create a test database and run backend tests. This is a first-time setup procedure. ```bash # Create test database (required before running backend tests) psql -U pgadmin -h localhost -p 5432 -d postgres -c "CREATE DATABASE litemaas_test;" cd backend && npm run test:db:setup # Run tests npm test ``` -------------------------------- ### Copy Example Environment Files Source: https://github.com/rh-aiservices-bu/litemaas/blob/main/README.md Copies example environment configuration files for backend and frontend. ```bash cp backend/.env.example backend/.env cp frontend/.env.example frontend/.env ``` -------------------------------- ### Start Development Servers Source: https://github.com/rh-aiservices-bu/litemaas/blob/main/README.md Starts both the backend and frontend development servers simultaneously. ```bash npm run dev ``` -------------------------------- ### Copy Example Values File Source: https://github.com/rh-aiservices-bu/litemaas/blob/main/docs/deployment/helm-deployment.md Copy the closest matching example values file for your deployment scenario and customize it. ```bash cp deployment/helm/litemaas/values.oidc.example.yaml my-values.yaml # Edit my-values.yaml with your configuration ``` -------------------------------- ### Initialize Backend Database and Start Server Source: https://github.com/rh-aiservices-bu/litemaas/blob/main/docs/development/setup.md Automatically create database tables on the first start and optionally seed the database with test data. This command starts the backend development server. ```bash # Database tables are created automatically on first start npm run dev:backend # Optional: Seed with test data cd backend && npm run db:seed ``` -------------------------------- ### Database Configuration Example Source: https://github.com/rh-aiservices-bu/litemaas/blob/main/docs/deployment/configuration.md Example environment variables for configuring database connections, including the connection URL, maximum connections, and idle/connection timeouts. ```bash DATABASE_URL=postgresql://admin:secure-password@db.example.com:5432/litemaas_prod DB_MAX_CONNECTIONS=50 DB_IDLE_TIMEOUT=60000 DB_CONNECTION_TIMEOUT=10000 ``` -------------------------------- ### Copy Backend Environment Example Source: https://github.com/rh-aiservices-bu/litemaas/blob/main/docs/development/setup.md Copy the example environment file to create a new environment file for the backend. This file will store your local configuration. ```bash # Copy the example environment file cp backend/.env.example backend/.env # Edit backend/.env with your configuration # See docs/deployment/configuration.md for all available options ``` -------------------------------- ### Start Frontend Development Server Source: https://github.com/rh-aiservices-bu/litemaas/blob/main/README.md Starts only the frontend development server, accessible at http://localhost:3000. ```bash npm run dev:frontend ``` -------------------------------- ### HTTP: Deprecation Warnings Source: https://github.com/rh-aiservices-bu/litemaas/blob/main/docs/api/api-migration-guide.md Shows example HTTP headers indicating deprecated parameters and migration guides. ```http X-API-Deprecation-Warning: subscriptionId parameter is deprecated. Use modelIds array instead. X-API-Migration-Guide: See /docs/api/migration-guide for details on upgrading to multi-model API keys. ``` -------------------------------- ### Start Backend Development Server Source: https://github.com/rh-aiservices-bu/litemaas/blob/main/README.md Starts only the backend development server, accessible at http://localhost:8081. ```bash npm run dev:backend ``` -------------------------------- ### Install React Data View Source: https://github.com/rh-aiservices-bu/litemaas/blob/main/docs/development/pf6-guide/components/data-display/README.md Install the @patternfly/react-data-view package using npm. ```bash npm install @patternfly/react-data-view ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/rh-aiservices-bu/litemaas/blob/main/docs/development/setup.md Install all project dependencies for both backend and frontend packages using npm. This command runs the install script in both workspaces. ```bash # Install all dependencies for both packages npm install # This runs install in both backend and frontend workspaces ``` -------------------------------- ### Install Frontend Dependencies Source: https://github.com/rh-aiservices-bu/litemaas/blob/main/docs/development/pf6-guide/setup/quick-start.md Installs all project dependencies or only frontend dependencies. Ensure you are in the project root or the frontend directory respectively. ```bash # From project root, install all dependencies npm install # Or install only frontend dependencies cd frontend && npm install ``` -------------------------------- ### Chart Component Setup Source: https://github.com/rh-aiservices-bu/litemaas/blob/main/docs/development/chart-components-guide.md Sets up the basic structure for a React chart component, including necessary imports and props. This is the starting point for creating custom charts. ```typescript import React from 'react'; import { useTranslation } from 'react-i18next'; import { Chart, ChartAxis, createContainer } from '@patternfly/react-charts/victory'; import { VictoryTooltip } from 'victory'; import { Skeleton } from '@patternfly/react-core'; import AccessibleChart, { AccessibleChartData } from './AccessibleChart'; import { generateChartAriaDescription } from '../../utils/chartAccessibility'; import { formatYTickByMetric, formatXTickWithSkipping, calculateLeftPaddingByMetric, } from '../../utils/chartFormatters'; import { CHART_PADDING, GRID_STYLES, AXIS_STYLES } from '../../utils/chartConstants'; export interface MyChartProps { data: MyDataType[]; loading?: boolean; height?: number; metricType: 'requests' | 'tokens' | 'cost'; title?: string; description?: string; } const MyChart: React.FC = ({ data = [], loading = false, height = 400, metricType, title, description, }) => { const { t } = useTranslation(); const [containerWidth, setContainerWidth] = React.useState(600); const resizeObserverRef = React.useRef(null); // ... implementation }; export default MyChart; ``` -------------------------------- ### Manual Database Setup Commands Source: https://github.com/rh-aiservices-bu/litemaas/blob/main/dev-tools/README.md Commands to manually set up the PostgreSQL database for the LiteMaaS project. The backend will create tables on startup. Use `db:setup` for development with test data. ```bash createdb litemaas cd backend && npm run dev ``` ```bash cd backend && npm run db:setup ``` -------------------------------- ### Install Charts Dependencies Source: https://github.com/rh-aiservices-bu/litemaas/blob/main/docs/development/pf6-guide/troubleshooting/common-issues.md Install the necessary PatternFly charts and Victory dependencies using npm. ```bash npm install @patternfly/react-charts victory ``` -------------------------------- ### Install Dependencies Source: https://github.com/rh-aiservices-bu/litemaas/blob/main/README.md Installs project dependencies using npm. ```bash npm install ``` -------------------------------- ### Start Backend in Development Mode Source: https://github.com/rh-aiservices-bu/litemaas/blob/main/docs/development/backend-guide.md Starts the backend server in development mode, listening on port 8080. This command is useful for local development and testing. ```bash # Start backend in development mode (port 8080) npm run dev:backend ``` -------------------------------- ### Start PostgreSQL with Docker Compose Source: https://github.com/rh-aiservices-bu/litemaas/blob/main/docs/development/setup.md Use Docker Compose to start a PostgreSQL instance for development. The database will be accessible at the default credentials. ```bash # Start PostgreSQL using the provided compose file docker compose -f dev-tools/compose.yaml up -d postgres # The database will be available at localhost:5432 # Default credentials: postgres/postgres ``` -------------------------------- ### Install LiteMaaS on Kubernetes Source: https://github.com/rh-aiservices-bu/litemaas/blob/main/deployment/helm/README.md Installs the LiteMaaS Helm chart on a Kubernetes cluster. A `my-values.yaml` file with appropriate configurations is required. ```bash helm install litemaas deployment/helm/litemaas/ \ -n litemaas --create-namespace \ -f my-values.yaml ``` -------------------------------- ### Install PatternFly Packages Source: https://github.com/rh-aiservices-bu/litemaas/blob/main/docs/development/pf6-guide/troubleshooting/common-issues.md Install necessary PatternFly React packages in your frontend project. Ensure you are in the 'frontend' directory before running the command. ```bash cd frontend npm install @patternfly/react-core @patternfly/react-table @patternfly/react-icons ``` -------------------------------- ### Install Helm Chart on Kubernetes Source: https://github.com/rh-aiservices-bu/litemaas/blob/main/docs/deployment/helm-deployment.md Install the LiteMaaS Helm chart on a Kubernetes cluster, creating the namespace if it doesn't exist, and setting the platform to Kubernetes. ```bash helm install litemaas deployment/helm/litemaas/ \ -n litemaas --create-namespace \ -f my-values.yaml \ --set global.platform=kubernetes ``` -------------------------------- ### Start Frontend Development Server Source: https://github.com/rh-aiservices-bu/litemaas/blob/main/docs/development/pf6-guide/setup/development-environment.md Use this command to start the Vite development server. It supports Hot Module Replacement (HMR) and is configured to proxy API calls. ```bash # Start frontend development server npm run dev:frontend # Or from frontend directory cd frontend && npm run dev # Stop server Ctrl+C ``` -------------------------------- ### Start Development Server for Testing Source: https://github.com/rh-aiservices-bu/litemaas/blob/main/docs/development/accessibility/testing-guide.md This command starts the development server, which automatically runs axe-core for continuous accessibility feedback. Use the browser console to view reports and utilize `window.a11yDebug` utilities for manual testing. ```bash # Start development server (axe-core runs automatically) npm run dev # Open browser console to see accessibility reports # Use window.a11yDebug utilities for manual testing ``` -------------------------------- ### Start LiteMaaS Services with Compose Source: https://github.com/rh-aiservices-bu/litemaas/blob/main/docs/deployment/containers.md Easily launch the complete LiteMaaS stack locally or for development using Podman Compose or Docker Compose. This command starts all necessary services including database, backend, frontend, and LiteLLM. ```bash # Start all services podman-compose up -d # Or with Docker Compose docker-compose up -d ``` -------------------------------- ### Install and Use Node Version with NVM Source: https://github.com/rh-aiservices-bu/litemaas/blob/main/docs/development/setup.md Commands to manage Node.js versions using the Node Version Manager (nvm). Install a specific version and then switch to use it. ```bash # Install correct Node version with nvm nvm install 18 nvm use 18 ``` -------------------------------- ### Install and Run axe-core CLI Source: https://github.com/rh-aiservices-bu/litemaas/blob/main/docs/development/accessibility/frontend-testing.md Install the axe-core command-line interface globally and use it to test a URL. You can specify tags for WCAG compliance levels or target specific rules. ```bash # Install axe-core CLI npm install -g @axe-core/cli # Test a URL axe http://localhost:3000 --tags wcag2a,wcag2aa # Test with specific rules axe http://localhost:3000 --rules color-contrast,keyboard-navigation ``` -------------------------------- ### Get Time Series Data Response Source: https://github.com/rh-aiservices-bu/litemaas/blob/main/docs/api/usage-api.md Example JSON response for the Get Time Series Data endpoint, showing usage metrics over a specified interval (e.g., day) with start and end times for each period. ```json { "interval": "day", "data": [ { "period": "2025-08-01", "startTime": "2025-08-01T00:00:00Z", "endTime": "2025-08-01T23:59:59Z", "totalRequests": 18000, "totalTokens": 1200000, "totalPromptTokens": 720000, "totalCompletionTokens": 480000, "averageLatency": 1150, "errorRate": 0.5, "successRate": 99.5 } ] } ``` -------------------------------- ### Start Frontend Development Server Source: https://github.com/rh-aiservices-bu/litemaas/blob/main/docs/development/pf6-guide/setup/quick-start.md Starts the Vite development server with hot module replacement, TypeScript support, and PatternFly 6 styles. The server typically runs at http://localhost:3000. ```bash # Start the frontend with hot module replacement npm run dev:frontend ``` -------------------------------- ### Navigate and Copy Configuration Source: https://github.com/rh-aiservices-bu/litemaas/blob/main/docs/deployment/kustomize-deployment.md Navigates to the deployment directory and copies the example environment configuration file. ```bash cd deployment/kustomize cp user-values.env.example user-values.env ``` -------------------------------- ### Get Usage Summary Response Source: https://github.com/rh-aiservices-bu/litemaas/blob/main/docs/api/usage-api.md Example JSON response for the Get Usage Summary endpoint, providing aggregated statistics for a given period, including totals and breakdown by model. ```json { "period": { "start": "2025-07-01T00:00:00Z", "end": "2025-07-31T23:59:59Z" }, "totals": { "requests": 125000, "tokens": 8500000, "cost": 127.5, "promptTokens": 5100000, "completionTokens": 3400000, "averageLatency": 1200, "errorRate": 0.8, "successRate": 99.2 }, "byModel": [ { "modelId": "gpt-4", "modelName": "GPT-4", "requests": 45000, "tokens": 3200000, "cost": 96.0 } ] } ``` -------------------------------- ### Get Usage Metrics Response Source: https://github.com/rh-aiservices-bu/litemaas/blob/main/docs/api/usage-api.md Example JSON response for the Get Usage Metrics endpoint, detailing total requests, tokens, cost, and breakdown by model, daily, hourly, and errors. ```json { "totalRequests": 125000, "totalTokens": 8500000, "totalCost": 127.5, "averageResponseTime": 1.2, "successRate": 99.2, "activeModels": 4, "topModels": [ { "name": "gpt-4", "requests": 45000, "tokens": 3200000, "cost": 96.0 } ], "dailyUsage": [ { "date": "2025-08-01", "requests": 18000, "tokens": 1200000, "cost": 18.0 } ], "hourlyUsage": [ { "hour": "14:00", "requests": 523 } ], "errorBreakdown": [ { "type": "Rate Limit", "count": 125, "percentage": 1.0 } ] } ``` -------------------------------- ### GET /api/v1/admin/audit/actions Response Example Source: https://github.com/rh-aiservices-bu/litemaas/blob/main/docs/api/rest-api.md This JSON structure lists distinct action types available in the audit logs. ```json { "actions": ["MODEL_CREATED", "MODEL_UPDATED", "USER_LOGIN", "API_KEY_CREATED"] } ``` -------------------------------- ### GET /api/v1/admin/audit/categories Response Example Source: https://github.com/rh-aiservices-bu/litemaas/blob/main/docs/api/rest-api.md This JSON structure lists distinct resource types (categories) available in the audit logs. ```json { "categories": ["API_ACCESS", "API_KEY", "MODEL", "SUBSCRIPTION", "USER"] } ``` -------------------------------- ### Get Model Sync Stats (cURL) Source: https://github.com/rh-aiservices-bu/litemaas/blob/main/docs/api/model-sync-api.md Example using cURL to fetch model synchronization statistics, requiring an Authorization header. ```bash curl -H "Authorization: Bearer YOUR_TOKEN" \ http://localhost:8081/api/v1/models/sync/stats ``` -------------------------------- ### GET /api/v1/config/api-key-defaults Response Example Source: https://github.com/rh-aiservices-bu/litemaas/blob/main/docs/api/rest-api.md This JSON structure provides default and maximum values for API key quotas, used for pre-filling forms. ```json { "defaults": { "maxBudget": 50.00, "tpmLimit": 5000, "rpmLimit": 100, "budgetDuration": "monthly", "softBudget": 40.00 }, "maximums": { "maxBudget": 500.00, "tpmLimit": 50000, "rpmLimit": 1000 } } ``` -------------------------------- ### Test Database Setup Commands Source: https://github.com/rh-aiservices-bu/litemaas/blob/main/backend/CLAUDE.md Commands to create and initialize the test database before running tests. ```bash # Create test database psql -U pgadmin -h localhost -p 5432 -d postgres -c "CREATE DATABASE litemaas_test;" ``` ```bash # Initialize schema npm run test:db:setup ``` -------------------------------- ### GET /api/v1/admin/audit Response Example Source: https://github.com/rh-aiservices-bu/litemaas/blob/main/docs/api/rest-api.md This JSON structure represents a paginated response for audit logs, including details of the action, user, resource, and metadata. ```json { "data": [ { "id": "uuid", "userId": "uuid", "username": "john.doe", "email": "john@example.com", "action": "MODEL_CREATED", "resourceType": "MODEL", "resourceId": "model-uuid", "success": true, "errorMessage": null, "metadata": { "modelName": "gpt-4" }, "ipAddress": "192.168.1.1", "createdAt": "2026-03-01T12:00:00.000Z" } ], "pagination": { "page": 1, "limit": 20, "total": 150, "totalPages": 8 } } ``` -------------------------------- ### Setting Up First Admin User with Mock OAuth Source: https://github.com/rh-aiservices-bu/litemaas/blob/main/docs/development/setup.md Instructions for enabling mock OAuth and logging in as a pre-configured admin user for development. ```bash # Set OAUTH_MOCK_ENABLED=true in backend/.env # Login as admin@example.com from the mock user selection ``` -------------------------------- ### Build and Preview Application Source: https://github.com/rh-aiservices-bu/litemaas/blob/main/frontend/CLAUDE.md Creates a production build of the application or previews the production build locally. ```bash npm run build npm run preview ``` -------------------------------- ### ModalBoxCloseButton Usage Example Source: https://github.com/rh-aiservices-bu/litemaas/blob/main/docs/development/pf6-guide/testing-patterns/context-dependent-components.md Shows the correct usage pattern for a Modal component that implicitly uses ModalBoxCloseButton in its header. Refer to the modal testing guide for detailed patterns. ```typescript // ✅ CORRECT - Documented in modal testing guide Content ``` -------------------------------- ### Environment setup for LiteMaaS scripts Source: https://github.com/rh-aiservices-bu/litemaas/blob/main/scripts/README.md Instructions for setting up the backend environment by copying and configuring the .env file. Ensures required variables are present. ```bash # Ensure backend/.env exists with required variables cp backend/.env.example backend/.env # Edit backend/.env with your configuration ``` -------------------------------- ### External API GET /models Request Example Source: https://github.com/rh-aiservices-bu/litemaas/blob/main/docs/api/rest-api.md This HTTP request demonstrates how to query external AI model providers for available models, using Bearer token authentication. ```http GET /models HTTP/1.1 Host: external-api-provider.com Authorization: Bearer {API_KEY} Content-Type: application/json ``` -------------------------------- ### Get Usage Dashboard Response Example Source: https://github.com/rh-aiservices-bu/litemaas/blob/main/docs/api/usage-api.md This JSON object represents the response structure when retrieving comprehensive dashboard data for usage analytics. It includes summary statistics, performance changes, quota utilization, and details on top-performing models and recent activity. ```json { "summary": { "currentPeriod": { "requests": 125000, "tokens": 8500000, "cost": 127.5 }, "previousPeriod": { "requests": 108000, "tokens": 7300000, "cost": 109.5 }, "percentChange": { "requests": 15.7, "tokens": 16.4, "cost": 16.4 }, "quotaUtilization": { "requests": 62.5, "tokens": 42.5, "budget": 25.5 } }, "topStats": { "topModels": [ { "modelId": "gpt-4", "modelName": "GPT-4", "totalRequests": 45000, "totalTokens": 3200000 } ], "recentActivity": [ { "timestamp": "2025-08-04T14:23:45Z", "modelId": "gpt-4", "requestTokens": 1523, "responseTokens": 892, "statusCode": 200 } ] } } ``` -------------------------------- ### Build and Preview Production Frontend Source: https://github.com/rh-aiservices-bu/litemaas/blob/main/docs/development/pf6-guide/setup/development-environment.md Commands to build the frontend application for production and preview the production build locally. ```bash # Build frontend for production npm run build:frontend # Preview production build cd frontend && npm run preview ``` -------------------------------- ### Clean Install Dependencies Source: https://github.com/rh-aiservices-bu/litemaas/blob/main/docs/development/pf6-guide/troubleshooting/common-issues.md Perform a clean installation of project dependencies by removing 'node_modules' and 'package-lock.json' before running 'npm install'. This can resolve issues caused by corrupted installations. ```bash cd frontend rm -rf node_modules package-lock.json npm install ``` -------------------------------- ### Frontend (Vite) Configuration Example Source: https://github.com/rh-aiservices-bu/litemaas/blob/main/docs/deployment/configuration.md Configures frontend build variables, prefixed with VITE_, including backend API URL, OAuth credentials, and application details. ```bash VITE_API_URL=https://api.example.com VITE_OAUTH_CLIENT_ID=litemaas-frontend VITE_OAUTH_REDIRECT_URL=https://app.example.com/auth/callback VITE_APP_NAME=My LiteMaaS Instance VITE_APP_VERSION=2.0.0 ``` -------------------------------- ### Install PatternFly Codemods Globally Source: https://github.com/rh-aiservices-bu/litemaas/blob/main/docs/development/pf6-guide/guidelines/migration-codemods.md Installs the PatternFly codemods tool globally after clearing the npm cache to ensure a clean installation. ```bash # Clear npm cache npm cache clean --force # Install globally npm install -g @patternfly/pf-codemods ``` -------------------------------- ### Server Configuration Example Source: https://github.com/rh-aiservices-bu/litemaas/blob/main/docs/deployment/configuration.md Defines essential server settings including host address, port, logging level, environment mode, and CORS origin. ```bash HOST=0.0.0.0 PORT=3000 LOG_LEVEL=debug NODE_ENV=production CORS_ORIGIN=https://app.example.com ``` -------------------------------- ### Initialize Backend Test Database Schema and Data Source: https://github.com/rh-aiservices-bu/litemaas/blob/main/README.md Sets up the schema and seeds data for the backend test database. ```bash cd backend && npm run test:db:setup ``` -------------------------------- ### Run Preparation Script Source: https://github.com/rh-aiservices-bu/litemaas/blob/main/deployment/kustomize/README.md Execute the preparation script to generate deployment files based on your customized user-values.env. ```bash ./preparation.sh ``` -------------------------------- ### Development Server with OAuth and Logging Source: https://github.com/rh-aiservices-bu/litemaas/blob/main/backend/CLAUDE.md Starts the development server with both OAuth support and logging enabled. This command also requires the .env.oauth.local file. ```bash npm run dev:oauth:logged # With logging ``` -------------------------------- ### List Deployment Guides Source: https://github.com/rh-aiservices-bu/litemaas/blob/main/docs/README.md Command to list all files in the 'docs/deployment/' directory, useful for quickly accessing deployment-related documentation. ```bash ls docs/deployment/ ``` -------------------------------- ### Install Victory and ECharts Source: https://github.com/rh-aiservices-bu/litemaas/blob/main/docs/development/pf6-guide/charts/README.md Install the necessary packages for Victory-based or ECharts-based charts. Victory is recommended. ```bash # ✅ Victory-based charts (recommended) npm install @patternfly/react-charts victory # ✅ ECharts-based charts (alternative) npm install @patternfly/react-charts echarts ``` -------------------------------- ### Local Development with Containers Source: https://github.com/rh-aiservices-bu/litemaas/blob/main/CLAUDE.md Start the local development environment using Docker Compose. ```bash docker compose up -d ``` -------------------------------- ### Create API Key with Low Budget Source: https://github.com/rh-aiservices-bu/litemaas/blob/main/docs/development/quota-limits-test-guide.md Creates an API key with a minimal budget. This is the setup for testing budget enforcement. ```bash curl -s -X POST "$BASE_URL/api/v1/api-keys" \ -H "Authorization: Bearer $USER_TOKEN" \ -H "Content-Type: application/json" \ -d "{ \"name\": \"test-key-low-budget\", \"modelIds\": [\"$MODEL_ID\"], \"maxBudget\": 0.001 }" | jq . ``` -------------------------------- ### Run Development Server with Logging Source: https://github.com/rh-aiservices-bu/litemaas/blob/main/CLAUDE.md Execute this command to start the development server with enhanced logging, useful for debugging runtime issues. ```bash npm run dev:logged ``` -------------------------------- ### Verify Node.js and npm Installation Source: https://github.com/rh-aiservices-bu/litemaas/blob/main/docs/development/pf6-guide/troubleshooting/common-issues.md Check if Node.js and npm are installed and accessible in your system's PATH. ```bash # Check if Node.js is installed node --version npm --version ``` -------------------------------- ### Start PostgreSQL with Docker Compose Source: https://github.com/rh-aiservices-bu/litemaas/blob/main/README.md Starts the PostgreSQL database service in detached mode using Docker Compose. ```bash docker compose -f dev-tools/compose.yaml up -d postgres ``` -------------------------------- ### Run Full Stack Development Server Source: https://github.com/rh-aiservices-bu/litemaas/blob/main/docs/development/setup.md Start both the backend and frontend development servers simultaneously. Access the application at the specified URLs. ```bash # Run both backend and frontend npm run dev # Backend: http://localhost:8081 # Frontend: http://localhost:3000 # API Docs: http://localhost:8081/docs ``` -------------------------------- ### Run Database Migrations for Backend Source: https://github.com/rh-aiservices-bu/litemaas/blob/main/docs/api/model-sync-api.md Execute the command to create database tables automatically on backend startup. Navigate to the backend directory before running. ```bash # Tables are created automatically on backend startup cd backend && npm run dev ``` -------------------------------- ### Conventional Commits Examples Source: https://github.com/rh-aiservices-bu/litemaas/blob/main/CONTRIBUTING.md Examples of commit messages following the conventional commits format for different types of changes. ```bash git commit -m "feat: add new subscription API endpoint" git commit -m "fix: resolve authentication timeout issue" git commit -m "docs: update API documentation" ``` -------------------------------- ### Run Frontend Container with Runtime Configuration Source: https://github.com/rh-aiservices-bu/litemaas/blob/main/docs/deployment/containers.md Deploy the frontend container using Podman, configuring the backend API URL at runtime and exposing the necessary port. ```bash # Run frontend (with runtime configuration) podman run -d --name litemaas-frontend \ -e BACKEND_URL=https://yourdomain.com \ -p 3000:8080 \ litemaas-frontend:0.2.0 ``` -------------------------------- ### Example User Values Configuration Source: https://github.com/rh-aiservices-bu/litemaas/blob/main/docs/deployment/kustomize-deployment.md Defines essential environment-specific values for LiteMaaS deployment. ```bash LITEMAAS_VERSION=0.0.18 CLUSTER_DOMAIN_NAME=apps.your-cluster.example.com NAMESPACE=litemaas PG_ADMIN_PASSWORD=your-secure-db-password JWT_SECRET=your-secure-jwt-64-chars OAUTH_CLIENT_ID=litemaas-oauth-client OAUTH_CLIENT_SECRET=your-oauth-client-secret-from-step-4 ADMIN_API_KEY=ltm_admin_your-admin-key LITELLM_API_KEY=sk-your-litellm-master-key LITELLM_MASTER_KEY= # Optional: encryption key for stored model API keys (defaults to LITELLM_API_KEY) LITELLM_UI_USERNAME=admin LITELLM_UI_PASSWORD=your-litellm-ui-password ``` -------------------------------- ### Initialize Test Database Schema Source: https://github.com/rh-aiservices-bu/litemaas/blob/main/docs/development/setup.md Run this command from the 'backend' directory to copy the schema from the development database to 'litemaas_test', seed minimal required data, and verify the setup. ```bash cd backend npm run test:db:setup ``` -------------------------------- ### List Development Guides Source: https://github.com/rh-aiservices-bu/litemaas/blob/main/docs/README.md Command to list all files in the 'docs/development/' directory, useful for quickly accessing development-related documentation. ```bash ls docs/development/ ``` -------------------------------- ### Install Dependencies with Legacy Peer Deps Source: https://github.com/rh-aiservices-bu/litemaas/blob/main/docs/development/pf6-guide/troubleshooting/common-issues.md Use the --legacy-peer-deps flag during npm install to bypass peer dependency conflicts. ```bash npm install --legacy-peer-deps ``` -------------------------------- ### Run Backend Container with Environment File Source: https://github.com/rh-aiservices-bu/litemaas/blob/main/docs/deployment/containers.md Deploy the backend container using Podman, linking it to the production environment file and exposing the necessary port. ```bash # Run backend podman run -d --name litemaas-backend \ --env-file production.env \ -p 8080:8080 \ litemaas-backend:0.2.0 ``` -------------------------------- ### Install PatternFly Chatbot Package Source: https://github.com/rh-aiservices-bu/litemaas/blob/main/docs/development/pf6-guide/chatbot/README.md Install the PatternFly Chatbot package using npm. This is a required step before using the chatbot components. ```bash # ✅ Install PatternFly Chatbot package npm install @patternfly/chatbot ``` -------------------------------- ### Verify Generated Files Source: https://github.com/rh-aiservices-bu/litemaas/blob/main/deployment/kustomize/README.md Check that the preparation script has successfully created the necessary .local configuration files and the kustomization.yaml. ```bash ls -la *.local # Should show: # - backend-deployment.yaml.local # - backend-secret.yaml.local # - frontend-deployment.yaml.local # - litellm-secret.yaml.local # - namespace.yaml.local # - postgres-secret.yaml.local # - kustomization.yaml ```