Development¶
Guidelines and workflow for contributing code to CommonGraph.
Project Structure¶
commongraph/
├── backend/ # FastAPI backend
│ ├── api/ # API endpoints
│ ├── db/ # Database models
│ ├── models/ # Data models
│ ├── utils/ # Utilities
│ ├── main.py # Entry point
│ └── tests/ # Backend tests
├── frontend/ # Vue.js frontend
│ ├── src/
│ │ ├── components/ # Vue components
│ │ ├── views/ # Page components
│ │ ├── stores/ # State management
│ │ └── main.js # Entry point
│ └── tests/ # Frontend tests
├── docs/ # Documentation (mkdocs)
├── config/ # Platform configurations
├── docker-compose.yaml # Docker configuration
└── README.md # Project overview
Backend Development¶
Setup¶
cd backend
pip install -r requirements-dev.txt
Running¶
uvicorn main:app --reload
Visits http://localhost:8000
Code Style¶
- Follow PEP 8
- Use type hints
- Document functions with docstrings
- Keep functions focused and testable
Testing¶
pytest
Run specific test:
pytest test_models.py::TestUser
With coverage:
pytest --cov=backend
Frontend Development¶
Setup¶
cd frontend
npm install
Running¶
npm run dev
Visits http://localhost:5173
Code Style¶
- Use ES6+ syntax
- Follow Vue 3 composition API patterns
- Meaningful variable and component names
- Comments for complex logic
Testing¶
npm run test
Linting¶
npm run lint
Commit Messages¶
Write clear, descriptive commit messages:
Type: Brief summary (50 chars max)
Detailed explanation of the change (72 chars per line)
Related to: #issue_number
Types:
- feat: New feature
- fix: Bug fix
- docs: Documentation
- test: Test additions
- refactor: Code refactoring
- chore: Build, deps, etc.
Pull Request Process¶
- Create feature branch from
dev - Make focused, atomic commits
- Write clear PR description
- Reference related issues
- Ensure tests pass
- Request review
- Address feedback
- Merge when approved
Before Submitting¶
- [ ] Tests pass locally
- [ ] Code follows style guidelines
- [ ] No linting errors
- [ ] Documentation updated
- [ ] Commit messages are clear
- [ ] No unrelated changes included
Questions?¶
- Check existing issues and PRs
- Ask in GitHub discussions
- Email contact@comodelling.org
Thank You¶
We appreciate your contributions to making CommonGraph better!