MarketAlly.AIPlugin.Extensions/MarketAlly.ProjectDetector/README.md

99 lines
3.2 KiB
Markdown
Executable File

# MarketAlly.ProjectDetector
A comprehensive project type detection library for various programming languages and frameworks.
## Overview
MarketAlly.ProjectDetector provides intelligent detection of project types based on file structure, dependencies, and configuration files. It supports detection for:
- .NET projects (Web API, Blazor, MAUI, WPF, Console, etc.)
- Node.js projects (React, Vue, Angular, Next.js, Express)
- Python projects (Django, Flask, generic Python)
- Java projects (Maven, Gradle)
- Other languages (Go, Rust)
- Specialized projects (Functions, Workflows, Tools, Plugins)
- Container and Infrastructure projects
## Usage
```csharp
using MarketAlly.ProjectDetector;
using Microsoft.Extensions.Logging;
// Create detector with logger
var logger = loggerFactory.CreateLogger<ProjectTypeDetector>();
var detector = new ProjectTypeDetector(logger);
// Detect project type
var projectType = detector.DetermineProjectType("MyProject", "/path/to/project");
```
## Project Types
The library defines the following project types in the `ProjectType` enum:
### Standard Types
- `Standalone` - Single-purpose applications
- `API` - RESTful APIs and web services
- `WebApp` - Web applications with UI
- `MobileApp` - Mobile applications (MAUI, Xamarin)
- `Library` - Reusable libraries and packages
- `Service` - Background services and workers
- `Tests` - Test projects
### Specialized Types
- `Database` - Database and migration projects
- `Function` - Serverless functions (Azure Functions, AWS Lambda)
- `Tool` - Command-line tools and utilities
- `Plugin` - Plugin and extension projects
- `Infrastructure` - Infrastructure as Code projects
- `ContainerApp` - Containerized applications
- `ChatBot` - Bot framework projects
- `Workflow` - Workflow and orchestration projects
### Language-Specific Types
- Node.js: `ReactApp`, `VueApp`, `AngularApp`, `NextJsApp`, `NodeJsApi`, `NodeJsApp`
- Python: `DjangoApp`, `FlaskApp`, `PythonApp`
- Java: `JavaMavenProject`, `JavaGradleProject`
- Other: `GoApp`, `RustApp`, `SwiftApp`, `KotlinApp`
### Desktop Types
- `WpfApp` - Windows Presentation Foundation
- `WinFormsApp` - Windows Forms
- `AvaloniaApp` - Cross-platform Avalonia
- `ElectronApp` - Electron desktop apps
### Game Development
- `UnityProject`
- `UnrealProject`
- `GodotProject`
## Detection Process
1. **File Analysis**: Examines project files (.csproj, package.json, pom.xml, etc.)
2. **Dependency Analysis**: Checks installed packages and references
3. **Structure Analysis**: Looks at folder structure and file patterns
4. **Confidence Scoring**: Each detector provides a confidence score
5. **Priority Selection**: Returns the highest priority match
## Architecture
The library uses a detector pattern where each project type has its own detector implementing `IProjectTypeDetector`. Detectors are evaluated in priority order:
1. Solution files (highest priority)
2. Container projects
3. Specific frameworks (MAUI, React, Django)
4. Technology-specific (Functions, Workflows)
5. General categories (API, WebApp)
6. Fallback detectors (lowest priority)
## Integration
This library is designed to be shared between:
- MarketAlly.AIPlugin
- RefactorIQ
- Other MarketAlly ecosystem projects
## License
Copyright (c) MarketAlly. All rights reserved.