This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
RocketAdmin is a database administration panel that allows users to manage database connections, tables, and data. It consists of multiple components in a monorepo structure:
- backend/ - NestJS API server (TypeScript, ES modules)
- frontend/ - Angular 19 web application (standalone components)
- rocketadmin-agent/ - NestJS agent for connecting to databases behind firewalls
- autoadmin-ws-server/ - WebSocket server for agent communication
- shared-code/ - Shared data access layer and utilities used by backend and agent
cd backend
yarn start:dev # Start dev server with hot reload
yarn build # Build for production
yarn lint # ESLint with auto-fix
yarn test # Run non-saas AVA tests (serial)
yarn test-all # Run all AVA tests (5min timeout, serial)
yarn test-saas # Run SaaS-specific testscd frontend
yarn start # Start Angular dev server
yarn build # Production build
yarn test:ci # Run tests headlessly (CI mode)
yarn test --browsers=ChromeHeadlessCustom --no-watch --no-progress # Headless tests
yarn lint # TSLint (deprecated, needs ESLint migration)The project uses just for test orchestration:
just test # Run all backend tests with Docker Compose
just test "path/to/test.ts" # Run specific test fileThis spins up test databases (MySQL, PostgreSQL, MSSQL, Oracle, IBM DB2, MongoDB, DynamoDB) via docker-compose.tst.yml.
cd backend
yarn build # Must build first
yarn migration:generate src/migrations/MigrationName # Generate migration
yarn migration:run # Run pending migrations
yarn migration:revert # Revert last migration- Uses Yarn workspaces with packages:
backend,rocketadmin-agent,shared-code shared-codeis imported as@rocketadmin/shared-codeworkspace dependency- Frontend is a separate Angular project (not a workspace member)
- Entities pattern: Each entity has its own directory under
src/entities/containing:*.entity.ts- TypeORM entity*.module.ts- NestJS module*.controller.ts- REST endpoints*.service.ts- Business logic (use cases)dto/- Request/response DTOs with class-validator decorators*.controller.ee.ts- Enterprise edition controllers (SaaS features)
- Guards: Authentication and authorization in
src/guards/ - Data access: Uses
shared-codefor database operations via Knex - Testing: AVA test framework with tests in
test/ava-tests/non-saas-tests/- Core functionality testssaas-tests/- SaaS-specific feature testscomplex-table-tests/- Complex table operation tests
See frontend/CLAUDE.md for detailed frontend architecture.
Key points:
- Standalone components (no NgModules)
- BehaviorSubject-based state management (no NgRx)
- Multi-environment builds (development, production, saas, saas-production)
- Jasmine/Karma testing with ChromeHeadless
Located in shared-code/src/:
data-access-layer/- Database abstraction supporting MySQL, PostgreSQL, MSSQL, Oracle, MongoDB, DynamoDB, IBM DB2, Cassandra, Elasticsearchknex-manager/- Knex connection managementcaching/- LRU cache utilitieshelpers/- Shared utilities
The rocketadmin-agent connects to databases in private networks:
- Agent runs inside customer's network
- Connects to
autoadmin-ws-servervia WebSocket - Backend communicates with agent through WebSocket server
- Agent executes database queries and returns results
The application supports: MySQL, PostgreSQL, MongoDB, DynamoDB, Cassandra, OracleDB, MSSQL, IBM DB2, Elasticsearch, Redis
Database-specific DAOs are in shared-code/src/data-access-layer/.
Test databases are defined in docker-compose.tst.yml:
- MySQL:
testMySQL-e2e-testing:3306 - PostgreSQL:
testPg-e2e-testing:5432 - MSSQL:
mssql-e2e-testing:1433 - Oracle:
test-oracle-e2e-testing:1521 - IBM DB2:
test-ibm-db2-e2e-testing:50000 - MongoDB:
test-mongo-e2e-testing:27017 - DynamoDB:
test-dynamodb-e2e-testing:8000
- Private methods must be placed at the end of the class, after all public methods