|
| 1 | +# MeaCode Studio - Project Architecture |
| 2 | + |
| 3 | +This document describes the organization and architecture of MeaCode Studio to ensure scalability and maintainability. |
| 4 | + |
| 5 | +## Directory Structure |
| 6 | + |
| 7 | +### `/apps` (Planned) |
| 8 | +Future entry points for different platforms. |
| 9 | + |
| 10 | +### `/kernel` |
| 11 | +Core logic written in Rust. Organized as a Cargo workspace. |
| 12 | +- `kernel-core`: Core engine logic. |
| 13 | +- `kernel-lsp`: Language Server Protocol integration. |
| 14 | +- `kernel-ai`: AI and LLM integration. |
| 15 | + |
| 16 | +### `/src` (Frontend) |
| 17 | +The frontend is built with React, TypeScript, and Tailwind CSS. It follows a **Feature-Based Architecture**. |
| 18 | + |
| 19 | +- `api/`: IPC (Inter-Process Communication) wrappers for Tauri commands. |
| 20 | +- `core/`: Global state management, context providers, and core application logic. |
| 21 | +- `features/`: Isolated feature modules. Each feature contains its own components, hooks, and logic. |
| 22 | + - `editor/`: Monaco editor integration and file editing. |
| 23 | + - `explorer/`: File system navigation. |
| 24 | + - `terminal/`: Integrated terminal. |
| 25 | + - `ai/`: AI chat and assistance. |
| 26 | + - `settings/`: Application configuration. |
| 27 | +- `shared/`: Reusable resources used across multiple features. |
| 28 | + - `components/`: Generic UI components (buttons, modals, etc.). |
| 29 | + - `hooks/`: Generic React hooks. |
| 30 | + - `utils/`: Helper functions. |
| 31 | +- `layout/`: Main application shell and layout-specific components. |
| 32 | + |
| 33 | +### `/src-tauri` |
| 34 | +The Tauri backend configuration and main entry point for the desktop application. |
| 35 | + |
| 36 | +## Scaling Principles |
| 37 | +1. **Isolation**: Keep features as independent as possible. |
| 38 | +2. **Shared vs. Feature**: Only put code in `shared/` if it is truly generic. If it's specific to a feature, keep it inside `features/`. |
| 39 | +3. **Rust for Heavy Lifting**: Perform performance-critical or system-level tasks in the Rust kernel crates. |
| 40 | +4. **Small Components**: Avoid large monolithic files. Break down complex components into smaller ones. |
0 commit comments