docs.rs failed to build opencrates-3.0.1
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build:
opencrates-0.1.2
OpenCrates
An intelligent Rust crate generator and registry management system powered by AI
Key Features
- AI-Powered Code Generation: Advanced LLM integration for intelligent crate creation
- Multi-Provider Support: OpenAI, Codex, and extensible provider architecture
- Enterprise-Grade: Production-ready with comprehensive monitoring and security
- Template System: Sophisticated templating with reasoning patterns
- Real-time Analytics: Built-in metrics, health checks, and observability
- Docker Ready: Complete containerization with multi-stage builds
FastAPI Server & Endpoints
- RESTful API: Complete FastAPI-style server with automatic OpenAPI documentation
- WebSocket Support: Real-time communication for streaming operations
- Authentication: JWT-based auth with role-based access control
- Rate Limiting: Configurable rate limiting and request throttling
- CORS Support: Cross-origin resource sharing for web applications
- Health Checks: Comprehensive health monitoring endpoints
Enterprise Architecture
- Microservices Ready: Modular design for distributed deployments
- Database Integration: SQLite, PostgreSQL, and Redis support
- Caching Layer: Multi-tier caching with Redis backend
- Message Queues: Async processing with queue management
- Monitoring Stack: Prometheus metrics and structured logging
- Security: Input validation, sanitization, and security headers
Advanced Project Analysis
- Dependency Analysis: Smart dependency resolution and optimization
- Code Quality Metrics: Automated code quality assessment
- Performance Profiling: Built-in benchmarking and performance analysis
- Security Scanning: Vulnerability detection and security auditing
Development Tools
- CLI Interface: Rich command-line tools for developers
- IDE Integration: Language server protocol support
- Testing Framework: Comprehensive testing utilities
- Documentation Generation: Automated docs with examples
Quick Start
Installation
# Install from crates.io
# Or add as dependency
Docker Setup
# Pull and run
# Or build locally
Basic Usage
use ;
use Result;
async
CLI Usage
# Generate a new crate
# Analyze existing crate
# Start the server
# Health check
# Interactive mode
Configuration
OpenCrates supports comprehensive configuration through multiple sources:
Environment Variables
Configuration File (opencrates.toml)
[]
= "127.0.0.1"
= 8080
= 4
[]
= "sqlite:./opencrates.db"
= 10
[]
= "openai"
= "gpt-4"
= 0.7
= 4000
[]
= "redis"
= 3600
= 1000
[]
= true
= 30
= false
[]
= true
= true
= "your-secret-key"
[]
= true
= true
= true
Runtime Configuration
use OpenCratesConfig;
let config = OpenCratesConfig ;
let opencrates = new_with_config.await?;
Development & Testing
Prerequisites
# Install Rust (latest stable)
|
# Install required tools
# For full development
Building from Source
# Clone the repository
# Build in development mode
# Build optimized release
# Run with all features
Running Tests
# Run all tests
# Run specific test suites
# Run with coverage
# Benchmark tests
# Security audit
Development Scripts
# Comprehensive build and test
# Quick test run
# Format and lint
# Generate documentation
Architecture
Core Components
OpenCrates/
├── Core Engine # Central orchestration
│ ├── Template Manager # Code generation templates
│ ├── Provider Registry # AI provider management
│ └── Configuration # System configuration
├── Providers/ # AI service integrations
│ ├── OpenAI # GPT-4, GPT-3.5-turbo
│ ├── Codex # GitHub Copilot integration
│ └── Custom # Extensible provider system
├── Server/ # FastAPI-style HTTP server
│ ├── REST API # RESTful endpoints
│ ├── WebSocket # Real-time communication
│ └── GraphQL # Advanced querying
├── CLI/ # Command-line interface
│ ├── Interactive # REPL-style interaction
│ ├── Batch # Script automation
│ └── TUI # Terminal user interface
├── Storage/ # Data persistence
│ ├── SQLite # Embedded database
│ ├── PostgreSQL # Production database
│ └── Redis # Caching and sessions
└── Monitoring/ # Observability stack
├── Metrics # Prometheus integration
├── Logging # Structured logging
└── Tracing # Distributed tracing
Request Flow
[Client Request]
↓
[Rate Limiting & Auth]
↓
[Request Validation]
↓
[Provider Selection]
↓
[AI Processing]
↓
[Template Application]
↓
[Code Generation]
↓
[Quality Validation]
↓
[Response Formation]
↓
[Client Response]
Data Models
// Core entities
Monitoring & Observability
Metrics Collection
# Prometheus metrics endpoint
# Health check endpoint
# System status
Monitoring Stack
- Prometheus: Metrics collection and alerting
- Grafana: Dashboards and visualization
- Jaeger: Distributed tracing
- ELK Stack: Log aggregation and analysis
Key Metrics
- Request latency and throughput
- AI provider response times
- Code generation success rates
- Resource utilization
- Error rates and types
- Cache hit ratios
Logging
use ;
// Structured logging with context
info!;
Security
Authentication & Authorization
// JWT-based authentication
// Role-based access control
Security Features
- Input Validation: Comprehensive input sanitization
- Rate Limiting: Configurable request throttling
- API Key Management: Secure API key handling
- Audit Logging: Complete audit trail
- Dependency Scanning: Automated vulnerability detection
- Secure Defaults: Security-first configuration
Best Practices
- Environment Variables: Store secrets in environment variables
- HTTPS Only: Force HTTPS in production
- Regular Updates: Keep dependencies updated
- Monitoring: Monitor for suspicious activity
- Backup: Regular database backups
- Access Control: Principle of least privilege
API Reference
Core Endpoints
# Crate generation
POST /api/v1/generate
Content-Type: application/json
{
"name": "my-crate",
"description": "Description here",
"features": ["async", "serde"],
"template": "library"
}
# Project analysis
POST /api/v1/analyze
Content-Type: multipart/form-data
# Health check
GET /health
# Metrics
GET /metrics
# OpenAPI specification
GET /docs
WebSocket Endpoints
// Real-time generation updates
const ws = ;
ws ;
Contributing
We welcome contributions! Please see our Contributing Guide for details.
Development Setup
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Ensure all tests pass
- Submit a pull request
Code Style
- Follow Rust standard formatting (
cargo fmt) - Pass all lints (
cargo clippy) - Add documentation for public APIs
- Include tests for new functionality
License
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE)
- MIT License (LICENSE-MIT)
at your option.
Changelog
Version 3.0.0 (Released!)
Major Release - Complete Rewrite
- New Architecture: Completely redesigned modular architecture
- AI Integration: Advanced LLM provider system with OpenAI and Codex
- FastAPI Server: Production-ready HTTP server with OpenAPI docs
- Enterprise Features: Monitoring, security, and scalability improvements
- Docker Support: Complete containerization with multi-stage builds
- Database Integration: SQLite, PostgreSQL, and Redis support
- Comprehensive Testing: 67+ tests covering all functionality
- Documentation: Complete API documentation and examples
Version 2.0.0
- Template system improvements
- Basic AI integration
- CLI enhancements
Version 1.0.0
- Initial release
- Basic crate generation
- Simple template system
OpenCrates - Intelligent Rust Development, Powered by AI