xtablo-source/README.md

157 lines
4 KiB
Markdown
Raw Normal View History

2025-10-23 09:54:45 +00:00
# Xtablo Monorepo
This is a Turborepo-based monorepo for the Xtablo project, containing multiple apps and shared packages.
## Project Structure
```
xtablo-source/
├── apps/
│ ├── main/ # Main UI application
│ └── external/ # External booking widget microfrontend
├── packages/
2025-10-23 19:05:49 +00:00
│ ├── ui/ # Shared UI components (buttons, inputs, etc.)
2025-10-23 09:54:45 +00:00
│ └── shared/ # Shared utilities, hooks, contexts, and types
├── api/ # TypeScript/Node.js API
├── backend/ # Python backend
├── go_backend/ # Go backend
└── xtablo-expo/ # React Native Expo app
```
## Getting Started
### Prerequisites
2025-10-23 19:05:49 +00:00
- Node.js 18+ and pnpm 10.19.0+
2025-10-23 09:54:45 +00:00
- For other services: Python 3.11+, Go 1.21+
2025-10-23 19:05:49 +00:00
### Quick Start
2025-10-23 09:54:45 +00:00
```bash
2025-10-23 19:05:49 +00:00
# Install dependencies
2025-10-23 09:54:45 +00:00
pnpm install
2025-10-23 19:05:49 +00:00
# Start development (packages are source-only, no build needed)
pnpm dev
2025-10-23 09:54:45 +00:00
```
2025-10-23 19:05:49 +00:00
For detailed development workflows, see [DEVELOPMENT.md](./DEVELOPMENT.md).
2025-10-23 09:54:45 +00:00
2025-10-23 19:05:49 +00:00
### Common Commands
2025-10-23 09:54:45 +00:00
```bash
2025-10-23 19:05:49 +00:00
# Development
pnpm dev # Run all apps
pnpm dev:main # Run main app only
pnpm dev:external # Run external app only
# Building
pnpm build # Build all apps
pnpm build:apps # Build apps only
2025-10-23 19:36:21 +00:00
pnpm build:staging # Build main app for staging
pnpm build:prod # Build main app for production
2025-10-23 19:05:49 +00:00
# Testing & Quality
pnpm test # Run all tests
pnpm lint # Check all packages
pnpm lint:fix # Fix linting issues
pnpm typecheck # Type check everything
# Cleaning
pnpm clean # Clean all build artifacts
2025-10-23 09:54:45 +00:00
```
## Packages
2025-10-23 19:05:49 +00:00
### @xtablo/ui
2025-10-23 09:54:45 +00:00
Shared UI components library used across the main and external apps. Contains all base UI components like buttons, inputs, dialogs, etc.
**Usage:**
```typescript
2025-10-23 19:05:49 +00:00
import { Button } from "@xtablo/ui/components/button";
import { Input } from "@xtablo/ui/components/input";
2025-10-23 09:54:45 +00:00
```
### @xtablo/shared
Shared utilities, hooks, contexts, and types used across apps.
**Usage:**
```typescript
import { useSession } from "@xtablo/shared/contexts/SessionContext";
import { api } from "@xtablo/shared/lib/api";
import { Tables } from "@xtablo/shared/types/database.types";
```
## Apps
### Main (@xtablo/main)
The main Xtablo application with full dashboard, planning, chat, and administrative features.
**Local URL:** http://localhost:5173
### External (@xtablo/external)
Embeddable booking widget that can be integrated into external websites. Supports both embedded and floating widget modes.
**Local URL:** http://localhost:5174
**Usage:**
- Embedded mode: `?mode=embed&eventTypeId=...`
- Floating widget: `?mode=widget&eventTypeId=...`
## Turborepo Features
This monorepo uses Turborepo for:
- **Fast builds**: Parallel task execution and intelligent caching
- **Dependency management**: Automatic build ordering based on package dependencies
- **Code sharing**: Easy sharing of components and utilities between apps
2025-10-23 19:05:49 +00:00
## Development Workflow
For comprehensive development documentation including:
2025-10-23 09:54:45 +00:00
2025-10-23 19:05:49 +00:00
- Package development workflow
- Testing strategies
- Troubleshooting guide
- CI/CD setup
See [DEVELOPMENT.md](./DEVELOPMENT.md)
2025-10-23 09:54:45 +00:00
## Adding a New Package
2025-10-23 19:05:49 +00:00
See the "Adding a New Package" section in [DEVELOPMENT.md](./DEVELOPMENT.md) for detailed instructions.
2025-10-23 09:54:45 +00:00
## Migration Notes
This project was migrated from a single UI app to a Turborepo monorepo with the following changes:
- **Before**: Single `ui/` directory with all code
- **After**:
- `apps/main/` - Main application
- `apps/external/` - Separate microfrontend for booking widgets
2025-10-23 19:05:49 +00:00
- `packages/ui/` - Shared UI components
2025-10-23 09:54:45 +00:00
- `packages/shared/` - Shared utilities and logic
2025-10-23 19:05:49 +00:00
All import paths have been updated to use workspace packages (`@xtablo/ui`, `@xtablo/shared`).
2025-10-23 09:54:45 +00:00
## Contributing
When adding new shared code:
2025-10-23 19:05:49 +00:00
1. Add to the appropriate package (`ui` for UI components, `shared` for logic/utils)
2. Export from the package's appropriate entry point
2025-10-23 09:54:45 +00:00
3. Use the workspace import in your apps
2025-10-23 19:05:49 +00:00
For more details, see [DEVELOPMENT.md](./DEVELOPMENT.md)
2025-10-23 09:54:45 +00:00
## License
[Your License Here]