Contributor Onboarding
Contributor Onboarding
Section titled “Contributor Onboarding”Welcome to the Tabula Lens project! This guide will help you get started as a contributor and provide you with the information you need to make your first contribution.
Getting Started
Section titled “Getting Started”Prerequisites
Section titled “Prerequisites”Before you start contributing, ensure you have the following installed:
- Node.js 18 or higher
- pnpm 9.x or higher (we use pnpm as our package manager)
- Git for version control
- Code editor (VS Code recommended)
Fork and Clone
Section titled “Fork and Clone”-
Fork the repository on GitHub
-
Clone your fork:
Terminal window git clone https://github.com/YOUR_USERNAME/tabula-lens.gitcd tabula-lens -
Add the upstream remote:
Terminal window git remote add upstream https://github.com/Atsytec/tabula-lens.git
Install Dependencies
Section titled “Install Dependencies”Install dependencies for the entire monorepo:
pnpm installThis will install dependencies for all packages and the documentation site.
Project Structure
Section titled “Project Structure”Tabula Lens is a monorepo with the following structure:
tabula-lens/├── packages/│ ├── node/ # Node.js backend package│ └── react/ # React frontend package├── apps/│ └── docs/ # Documentation site (Astro + Starlight)├── example-vite/ # Example application└── package.json # Root package.jsonPackages
Section titled “Packages”@tabula-lens/node
Section titled “@tabula-lens/node”The Node.js backend package that provides database connectivity and HTTP API.
Location: packages/node/
Key files:
src/TabulaLens.ts- Main TabulaLens classsrc/adapters/- Framework adapters (Express, Fastify, etc.)src/logger.ts- Logging systemsrc/dialects/- Database dialect strategies
@tabula-lens/react
Section titled “@tabula-lens/react”The React frontend package that provides the DatabaseViewer component.
Location: packages/react/
Key files:
src/DatabaseViewer.tsx- Main DatabaseViewer componentsrc/components/DatabaseViewer/- Sub-componentssrc/hooks/- Custom React hookssrc/utils/- Utility functions
@tabula-lens/docs
Section titled “@tabula-lens/docs”The documentation site built with Astro and Starlight.
Location: apps/docs/
Key files:
src/content/docs/- Documentation contentastro.config.mjs- Astro configurationsrc/styles/- Custom styles
Development Workflow
Section titled “Development Workflow”Running the Documentation Site
Section titled “Running the Documentation Site”Start the documentation site locally:
cd apps/docspnpm devThe documentation site will be available at http://localhost:4321
Running the Example App
Section titled “Running the Example App”Start the example application:
cd example-vitepnpm devThe example app will be available at http://localhost:5173
Running Tests
Section titled “Running Tests”Run tests for all packages:
# Node package testscd packages/nodepnpm test
# React package testscd packages/reactpnpm testType Checking
Section titled “Type Checking”Run type checking:
# Node packagecd packages/nodepnpm run check-types
# React packagecd packages/reactpnpm run check-typesLinting
Section titled “Linting”Run linting:
# Node packagecd packages/nodepnpm run lint
# React packagecd packages/reactpnpm run lintMaking Your First Contribution
Section titled “Making Your First Contribution”1. Choose an Issue
Section titled “1. Choose an Issue”Look for issues labeled good first issue or help wanted in the GitHub repository.
2. Create a Branch
Section titled “2. Create a Branch”Create a new branch for your contribution:
git checkout -b feature/your-feature-name# orgit checkout -b fix/your-bug-fix3. Make Your Changes
Section titled “3. Make Your Changes”Make your changes following the project’s coding standards:
- TypeScript: Use strict TypeScript typing
- Testing: Write tests for your changes
- Documentation: Update documentation as needed
- Style: Follow existing code style
4. Test Your Changes
Section titled “4. Test Your Changes”Run tests and type checking:
# Run testspnpm test
# Type checkpnpm run check-types
# Lintpnpm run lint5. Commit Your Changes
Section titled “5. Commit Your Changes”Commit your changes with a clear commit message:
git add .git commit -m "feat: add new feature"# orgit commit -m "fix: resolve bug description"6. Push and Create PR
Section titled “6. Push and Create PR”Push your changes and create a pull request:
git push origin feature/your-feature-nameThen create a pull request on GitHub with a clear description of your changes.
Coding Standards
Section titled “Coding Standards”TypeScript
Section titled “TypeScript”- Use strict TypeScript typing
- Avoid
anytypes - Use interfaces for object shapes
- Use type aliases for union types
- Add JSDoc comments for complex functions
Testing
Section titled “Testing”- Write tests for all new features
- Maintain test coverage above 80%
- Use descriptive test names
- Test edge cases and error conditions
- Mock external dependencies
Documentation
Section titled “Documentation”- Update documentation for all public API changes
- Add examples for new features
- Update the changelog for breaking changes
- Follow the Diataxis framework for documentation
Code Style
Section titled “Code Style”- Follow existing code style
- Use meaningful variable and function names
- Keep functions small and focused
- Add comments for complex logic
- Remove commented-out code
Architecture Overview
Section titled “Architecture Overview”HTTP API as Universal Interface
Section titled “HTTP API as Universal Interface”Tabula Lens uses an HTTP API as the universal interface between frontend and backend. This allows for:
- Framework-agnostic backend implementation
- Easy integration with any frontend framework
- Clear separation of concerns
- Simple testing and debugging
Modular Component Architecture
Section titled “Modular Component Architecture”The React package uses a modular component architecture:
- Main
DatabaseViewercomponent orchestrates sub-components - Sub-components are reusable and independently testable
- Custom hooks encapsulate business logic
- Utility functions are shared across components
Database Dialect Strategy
Section titled “Database Dialect Strategy”The Node package uses a dialect strategy pattern to support multiple databases:
- Each database has its own dialect strategy
- Auto-detection from connection string
- Consistent API across all databases
- Easy to add new database support
Resources
Section titled “Resources”Documentation
Section titled “Documentation”- Contributing to Documentation - How to contribute to documentation
- Architecture - System architecture and design
- API Reference - React API documentation
- Node API - Node API documentation
External Resources
Section titled “External Resources”- Vitest Documentation - Testing framework
- TypeScript Documentation - TypeScript guide
- React Documentation - React guide
- Astro Documentation - Astro framework
Getting Help
Section titled “Getting Help”If you need help:
- Check the documentation - Look for relevant documentation first
- Search existing issues - Your question may have been answered
- Ask in a discussion - Start a GitHub discussion for questions
- Join the community - Engage with other contributors
Next Steps
Section titled “Next Steps”After completing your first contribution:
- Review the architecture docs - Understand the system better
- Explore the codebase - Look at existing implementations
- Contribute to documentation - Help improve documentation
- Help with issues - Pick up more complex issues
- Review PRs - Help review other contributors’ PRs
Recognition
Section titled “Recognition”Contributors are recognized in the project’s contributors list. Thank you for your contributions!