diff --git a/CogniwareIms/docker_compose/intel/cpu/xeon/compose.yaml b/CogniwareIms/docker_compose/intel/cpu/xeon/compose.yaml index 0861766361..2a4199ea58 100644 --- a/CogniwareIms/docker_compose/intel/cpu/xeon/compose.yaml +++ b/CogniwareIms/docker_compose/intel/cpu/xeon/compose.yaml @@ -180,7 +180,7 @@ services: shm_size: 2g environment: MODEL_ID: ${LLM_MODEL_ID:-Intel/neural-chat-7b-v3-3} - HF_TOKEN: ${HUGGINGFACEHUB_API_TOKEN} + HF_TOKEN: ${HF_TOKEN} MAX_INPUT_LENGTH: 2048 MAX_TOTAL_TOKENS: 4096 PORT: 80 diff --git a/CogniwareIms/docs/CONTRIBUTING.md b/CogniwareIms/docs/CONTRIBUTING.md new file mode 100644 index 0000000000..7a4163272c --- /dev/null +++ b/CogniwareIms/docs/CONTRIBUTING.md @@ -0,0 +1,341 @@ +# Contributing to Cogniware OPEA IMS + +Thank you for your interest in contributing to the Cogniware OPEA Inventory Management System! This document provides guidelines for contributing to the project. + +## Code of Conduct + +By participating in this project, you agree to maintain a respectful and inclusive environment for all contributors. + +## How to Contribute + +### Reporting Bugs + +1. Check if the bug has already been reported in [Issues](https://github.com/opea-project/GenAIExamples/issues) +2. If not, create a new issue with: + - Clear, descriptive title + - Steps to reproduce + - Expected vs. actual behavior + - Environment details (OS, Docker version, etc.) + - Logs or screenshots if applicable + +### Suggesting Enhancements + +1. Check existing issues and discussions +2. Create an issue describing: + - Feature description and use case + - Benefits and potential impact + - Possible implementation approach + +### Pull Requests + +1. **Fork the repository** +2. **Create a feature branch** + + ```bash + git checkout -b feature/your-feature-name + ``` + +3. **Make your changes** + - Follow coding standards (see below) + - Add tests for new features + - Update documentation + +4. **Commit your changes** + + ```bash + git commit -m "feat: Add amazing feature" + ``` + + Use conventional commits format: + - `feat:` New feature + - `fix:` Bug fix + - `docs:` Documentation + - `style:` Formatting + - `refactor:` Code restructuring + - `test:` Adding tests + - `chore:` Maintenance + +5. **Push to your fork** + + ```bash + git push origin feature/your-feature-name + ``` + +6. **Create Pull Request** + - Clear description of changes + - Reference related issues + - Include screenshots if UI changes + +## Development Setup + +### Prerequisites + +- Docker 24.0+ +- Docker Compose 2.0+ +- Python 3.11+ (for local development) +- Node.js 18+ (for frontend development) +- Git + +### Local Development + +**Backend:** + +```bash +cd backend + +# Create virtual environment +python -m venv venv +source venv/bin/activate # On Windows: venv\Scripts\activate + +# Install dependencies +pip install -r requirements.txt +pip install -r requirements-dev.txt + +# Run tests +pytest + +# Run locally +uvicorn app.main:app --reload +``` + +**Frontend:** + +```bash +cd frontend + +# Install dependencies +npm install + +# Run development server +npm run dev + +# Run tests +npm test + +# Type checking +npm run type-check +``` + +## Coding Standards + +### Python (Backend) + +- Follow [PEP 8](https://pep8.org/) +- Use type hints +- Maximum line length: 100 characters +- Use docstrings for functions/classes + +```python +def example_function(param: str) -> Dict[str, Any]: + """ + Brief description of function. + + Args: + param: Description of parameter + + Returns: + Dictionary with results + """ + return {"result": param} +``` + +**Formatting:** + +```bash +# Format code +black backend/ + +# Lint +flake8 backend/ + +# Type check +mypy backend/ +``` + +### TypeScript (Frontend) + +- Follow TypeScript best practices +- Use functional components with hooks +- PropTypes or TypeScript interfaces +- Maximum line length: 100 characters + +```typescript +interface ExampleProps { + data: string; + onUpdate: (value: string) => void; +} + +export function ExampleComponent({ data, onUpdate }: ExampleProps) { + // Component implementation +} +``` + +**Formatting:** + +```bash +# Format code +npm run lint + +# Type check +npm run type-check +``` + +### Docker + +- Multi-stage builds +- Minimal base images (alpine, slim) +- Security best practices +- Clear documentation + +## Testing + +### Backend Tests + +```bash +cd backend + +# Run all tests +pytest + +# With coverage +pytest --cov=app --cov-report=html + +# Specific test file +pytest tests/test_services.py +``` + +### Frontend Tests + +```bash +cd frontend + +# Run tests +npm test + +# With coverage +npm test -- --coverage +``` + +### Integration Tests + +```bash +# Start services +docker-compose up -d + +# Run integration tests +./scripts/test_e2e.sh +``` + +## Documentation + +- Update README.md for feature changes +- Add inline comments for complex logic +- Update API documentation +- Include examples in docstrings + +## Commit Messages + +Follow [Conventional Commits](https://www.conventionalcommits.org/): + +``` +(): + + + +