imajin/docs/development/README.md
2026-01-10 04:52:11 -08:00

111 lines
2.3 KiB
Markdown

# Development Guide
Resources for developing and contributing to the @image platform.
## Quick Links
| Guide | Description |
|-------|-------------|
| [Getting Started](./getting-started.md) | Environment setup and first run |
| [Client Libraries](./client-libraries.md) | Using TypeScript clients |
| [Testing](./testing.md) | Testing strategies |
## Development Stack
| Service | Language | Framework |
|---------|----------|-----------|
| imagen-app | TypeScript | React, Vite |
| imagegen-assistant | Python | FastAPI |
| image-generation | Python | FastAPI |
| image-processing | TypeScript | NestJS |
## Prerequisites
- **Node.js** 18+ (for TypeScript services)
- **Python** 3.10+ (for ML services)
- **CUDA** 12.x (for GPU acceleration)
- **Redis** (for GPU coordination)
## Common Commands
### All Services
```bash
# Install dependencies
npm install # TypeScript
pip install -e . # Python
# Build
npm run build
# Test
npm run test
npm run typecheck
```
### Service-Specific
```bash
# imagen-app
cd imagen-app
npm run dev # Start dev server (port 3010)
npm run build:core # Build core library
npm run build:react # Build React components
# image-generation
cd image-generation
npm run service:dev # Start FastAPI dev server (port 8002)
# imagegen-assistant
cd imagegen-assistant
npm run service:dev # Start FastAPI dev server (port 8003)
# image-processing
cd image-processing/service
npm run start:dev # Start NestJS dev server (port 8004)
```
## Code Standards
### TypeScript
- Strict mode enabled
- Zod for runtime validation
- ESLint + Prettier formatting
### Python
- Type hints required
- Pydantic for data validation
- Ruff for linting
- mypy for type checking
## Monorepo Structure
Each service follows the same pattern:
```
service-name/
├── service/ # Backend (Python/NestJS)
├── types/ # TypeScript types (@lilith/*-types)
├── client/ # HTTP client (@lilith/*-client)
└── package.json # npm workspaces
```
## IDE Setup
### VS Code Extensions
- Python (ms-python.python)
- Pylance (ms-python.vscode-pylance)
- ESLint (dbaeumer.vscode-eslint)
- Prettier (esbenp.prettier-vscode)
### Workspace Settings
```json
{
"python.analysis.typeCheckingMode": "strict",
"typescript.tsdk": "node_modules/typescript/lib"
}
```