Contributing to Depict AI¶
Thank you for your interest in contributing to Depict AI! This guide will help you get started.
Code of Conduct¶
Please read and follow our Code of Conduct.
Development Setup¶
Prerequisites¶
- Python 3.12+
- Poetry
- Node.js 18+
- Git
Setup Steps¶
-
Fork the repository
-
Clone your fork:
- Install dependencies:
- Create a branch:
Development Workflow¶
Backend Development¶
Frontend Development¶
Documentation¶
# Start documentation server
poetry run mkdocs serve
# Build static documentation
poetry run mkdocs build
Code Style¶
Python (Backend)¶
- Follow PEP 8
- Use type hints
- Maximum line length: 120 characters
- Use descriptive variable names
Run linting before opening a PR:
JavaScript/Vue (Frontend)¶
- Use ES6+ features
- Use Composition API for Vue components
- Use
<script setup>syntax - Keep components under 300 lines
Format with Prettier (if configured):
Testing¶
Backend Tests¶
# Run all tests
poetry run pytest
# Run with coverage
poetry run pytest --cov=src/backend
# Run specific test file
poetry run pytest tests/test_specific.py
Frontend Tests¶
Commit Guidelines¶
Commit Message Format¶
Types:
- feat: New feature
- fix: Bug fix
- docs: Documentation changes
- style: Code style changes (formatting, etc.)
- refactor: Code refactoring
- test: Adding or updating tests
- chore: Maintenance tasks
Examples:
feat(auth): add GitHub OAuth2 support
fix(projects): resolve duplicate project creation bug
docs(api): update endpoint documentation
Pull Request Process¶
- Update documentation if needed
- Add tests for new features
- Ensure all tests pass:
poetry run pytest - Update CHANGELOG.md (if applicable)
- Create pull request with clear description
PR Checklist¶
- [ ] Tests pass locally
- [ ] Code follows style guidelines
- [ ] Documentation updated
- [ ] Commit messages are clear
- [ ] No merge conflicts
- [ ] PR description explains changes
Project Structure¶
Backend Structure¶
src/backend/
├── api/ # API endpoints
│ ├── auth.py # Authentication
│ ├── projects.py # Projects
│ └── ...
├── db/ # Database
│ ├── database.py # Connection
│ └── tables.py # Models
└── endpoints.py # Main app
Frontend Structure¶
src/frontend/
├── app.vue # Root app component
├── components/ # Reusable Vue components
├── composables/ # Shared composables
├── pages/ # Route pages
├── plugins/ # Nuxt plugins
└── nuxt.config.ts # Nuxt configuration
Common Tasks¶
Adding a New API Endpoint¶
- Create/update endpoint in
src/backend/api/ - Add tests in
tests/ - Update API documentation
- Verify endpoint in interactive docs:
http://localhost:8000/docs
Adding a New Vue Component¶
- Create component in
src/frontend/components/ - Use
<script setup>syntax - Add scoped styles
- Document props and emits
- Update component docs
Adding Database Model¶
- Add model to
src/backend/db/tables.py - Update database initialization
- Run migrations (if using Alembic)
- Update model documentation
Environment Variables¶
Create .env file (never commit this!):
Database Changes¶
When modifying database schema:
- Update models in
tables.py - Test with fresh database
- Document schema changes
- Consider migration strategy
Need Help?¶
- Check existing documentation
- Open an issue
- Ask in GitHub Discussions
License¶
By contributing, you agree that your contributions will be licensed under the project's AGPL-3.0 license.