# MetaBuilder Documentation Complete documentation for the MetaBuilder data-driven application platform. ## Start Here - **New?** โ†’ [Getting Started](./getting-started/) - **Want quick navigation?** โ†’ [Documentation Index](./INDEX.md) - **Looking for something specific?** โ†’ Use the quick links below ## Core Documentation | | | | |------|---|---| | ๐Ÿš€ **Getting Started** | [Setup & quickstart](./getting-started/) | First time? Start here | | ๐Ÿ—๏ธ **Architecture** | [Design & concepts](./architecture/) | How MetaBuilder works | | ๐Ÿงช **Testing** | [Quality & best practices](./testing/) | Testing strategies | | ๐Ÿ”ง **Development** | [Tools & workflows](./development/) | Dev environment | | ๐Ÿ“ฆ **Packages** | [Building packages](./packages/) | Package system | | ๐Ÿ›ข๏ธ **Database** | [Schema & design](./database/) | Data layer | | ๐Ÿ”„ **DBAL** | [Abstraction layer](./dbal/) | TypeScript & C++ | | ๐Ÿ” **Security** | [Auth & permissions](./security/) | Security practices | | ๐Ÿšข **Deployments** | [CI/CD & Docker](./deployments/) | Production | | ๐Ÿ“š **Reference** | [Guides & materials](./reference/) | Resources | ## What is MetaBuilder? MetaBuilder is a **data-driven, multi-tenant platform** where: - **95% functionality** in JSON/Lua, not TypeScript - **Configuration-driven** from database, not hardcoded - **Modular packages** for features and components - **Multi-tenancy** is built in by default - **Customization** happens without code changes ### Key Features โœ… **5-Level Architecture** - Sophisticated hierarchy for global, tenant, module, entity, and record levels โœ… **Data-Driven Design** - Define functionality declaratively in JSON and Lua โœ… **Multi-Tenant Ready** - Built-in tenant isolation and configuration โœ… **Package System** - Self-contained, importable/exportable packages โœ… **Generic Components** - Render complex UIs from configuration โœ… **Lua Scripting** - Business logic without redeploying โœ… **Secure Database Layer** - Type-safe ORM with built-in security โœ… **Comprehensive Testing** - Unit, integration, and E2E test suites ## Documentation Structure ``` docs/ โ”œโ”€โ”€ README.md (this file) # Overview โ”œโ”€โ”€ INDEX.md # Complete documentation index โ”‚ โ”œโ”€โ”€ getting-started/ # For new developers โ”‚ โ”œโ”€โ”€ README.md โ”‚ โ”œโ”€โ”€ PRD.md # Product requirements โ”‚ โ””โ”€โ”€ QUICK_START.md # Setup guide โ”‚ โ”œโ”€โ”€ architecture/ # System design โ”‚ โ”œโ”€โ”€ 5-level-system.md โ”‚ โ”œโ”€โ”€ data-driven-architecture.md โ”‚ โ”œโ”€โ”€ packages.md โ”‚ โ””โ”€โ”€ ... โ”‚ โ”œโ”€โ”€ testing/ # Testing docs โ”‚ โ”œโ”€โ”€ TESTING_GUIDELINES.md โ”‚ โ”œโ”€โ”€ UNIT_TESTS_IMPLEMENTATION.md โ”‚ โ””โ”€โ”€ ... โ”‚ โ”œโ”€โ”€ security/ # Security docs โ”‚ โ”œโ”€โ”€ SECURITY.md โ”‚ โ””โ”€โ”€ SECURE_DATABASE_LAYER.md โ”‚ โ”œโ”€โ”€ api/ # API documentation โ”‚ โ”œโ”€โ”€ platform-guide.md โ”‚ โ”œโ”€โ”€ DBAL_INTEGRATION.md โ”‚ โ””โ”€โ”€ ... โ”‚ โ”œโ”€โ”€ implementation/ # Detailed guides โ”‚ โ”œโ”€โ”€ COMPONENT_MAP.md โ”‚ โ”œโ”€โ”€ MULTI_TENANT_SYSTEM.md โ”‚ โ””โ”€โ”€ ... โ”‚ โ”œโ”€โ”€ refactoring/ # Refactoring guides โ”‚ โ”œโ”€โ”€ REFACTORING_STRATEGY.md โ”‚ โ””โ”€โ”€ ... โ”‚ โ””โ”€โ”€ ...other directories ``` ## Common Tasks ### I'm new to MetaBuilder โ†’ Go to [Getting Started](./getting-started/) ### I need to understand the architecture โ†’ Read [5-Level System](./architecture/5-level-system.md) ### I need to write tests โ†’ Check [Testing Guidelines](./testing/TESTING_GUIDELINES.md) ### I need to implement a feature โ†’ See [Implementation Guides](./implementation/) ### I need to set up security โ†’ Read [Security Guide](./security/SECURITY.md) ### I need to refactor code โ†’ Check [Refactoring Strategy](./refactoring/REFACTORING_STRATEGY.md) ## Key Concepts ### Five-Level Architecture MetaBuilder organizes configuration and functionality across five levels: 1. **Level 0 (Global)** - Platform-wide settings 2. **Level 1 (Tenant)** - Tenant-specific customization 3. **Level 2 (Modules)** - Package definitions 4. **Level 3 (Entities)** - Schemas and forms 5. **Level 4 (Records)** - Individual data records [Learn more](./architecture/5-level-system.md) ### Data-Driven Design Instead of coding everything, MetaBuilder uses: - **JSON** for configuration - **Lua** for business logic - **Database** as source of truth Benefits: Multi-tenancy, flexibility, no redeployment needed. [Learn more](./architecture/data-driven-architecture.md) ### Package System Features are self-contained packages with: - Configuration (seeds) - Components - Scripts - Assets [Learn more](./architecture/packages.md) ## Development Workflow ### 1. Plan - Review the PRD and architecture docs - Design your solution - Create a feature branch ### 2. Implement - Start with database schema (Prisma) - Add seed data and configuration - Create generic components - Add Lua scripts for logic ### 3. Test - Write unit tests - Run `npm run test:coverage` - Test with different permission levels - Run E2E tests ### 4. Document - Update relevant doc files - Add code comments - Update this README if needed ### 5. Deploy - Run linting: `npm run lint:fix` - Test in staging - Deploy to production ## Useful Commands ```bash # Development npm run dev # Start dev server npm run build # Production build # Database npm run db:generate # Generate Prisma client npm run db:push # Sync schema npm run db:studio # Prisma Studio # Testing npm test # Watch mode npm test -- --run # Run once npm run test:coverage # With coverage npm run test:e2e # E2E tests # Code Quality npm run lint # Check npm run lint:fix # Auto-fix ``` ## System Requirements - Node.js 18+ - npm 9+ - PostgreSQL 14+ ## Getting Help 1. **Read the docs** - Start with the [Documentation Index](./INDEX.md) 2. **Search the docs** - Use Ctrl+F to search 3. **Check examples** - Look at existing code 4. **Ask the team** - Connect with other developers ## Contributing When contributing to MetaBuilder: 1. Follow the [Refactoring Guide](./refactoring/) 2. Write tests for your code 3. Follow security best practices 4. Update documentation 5. Get code review before merging ## Key Resources - ๐Ÿ“– [Documentation Index](./INDEX.md) - Complete navigation - ๐Ÿ—๏ธ [Architecture Overview](./architecture/5-level-system.md) - ๐Ÿงช [Testing Guide](./testing/TESTING_GUIDELINES.md) - ๐Ÿ”’ [Security Guide](./security/SECURITY.md) - ๐Ÿ”„ [Refactoring Guide](./refactoring/REFACTORING_STRATEGY.md) ## Status โœ… **Architecture** - Complete and documented โœ… **Core Features** - Fully implemented โœ… **Testing** - Comprehensive test suite โœ… **Security** - Production-ready โœ… **Documentation** - Well-organized and detailed ## License See [LICENSE](../LICENSE) file for details. --- **Last Updated**: December 2025 **Questions?** Check [INDEX.md](./INDEX.md) for detailed navigation