Developer Guide
Welcome to the A²D developer documentation! This guide is for developers who want to contribute, understand the codebase, or extend A²D.
Overview
This guide covers:
- Understanding the A²D architecture
- Setting up your development environment
- Contributing code and documentation
- Testing and quality assurance
- Deployment and CI/CD
Who This Guide Is For
| Name | Type | Description |
|---|---|---|
Contributors | developers | Developers who want to contribute features, fixes, or improvements to A²D |
Maintainers | developers | Team members maintaining and evolving the A²D codebase |
Integrators | developers | Developers building integrations or extensions on top of A²D |
Learners | developers | Developers wanting to understand modern Next.js and Supabase patterns |
Quick Start for Contributors
- Fork the repository on GitHub
- Clone your fork:
git clone https://github.com/your-username/mulesoft-mcp-mock-specs.git cd mulesoft-mcp-mock-specs - Install dependencies:
npm install - Set up database: Follow Database Setup
- Configure environment: Create
.env.localwith your credentials - Start development:
npm run dev - Create a branch:
git checkout -b feature/your-feature-name - Make changes and commit
- Push and create pull request
Faster workflow: If you have the parent a2d-mocks repository, use the A²D CLI Tool for unified command access: ./a2d start, ./a2d test unit, ./a2d commit, etc.
Developer Documentation Sections
Core Documentation
Detailed developer documentation is being expanded. The sections below provide an overview of what’s available.
CLI Tool → A²D CLI Tool
- Unified development interface
- Automated testing workflows
- Supabase health checks
- Git workflow automation
Architecture → Multi-Tenancy
- Serverless-first design
- Multi-tenant with RLS
- Next.js 16 App Router patterns
- Supabase integration
Database → Database Schema (coming soon)
- Complete schema documentation
- RLS policies
- Indexes and performance
- Migration patterns
API Internals (coming soon)
- MCP protocol implementation
- JSON-RPC 2.0 handling
- Serverless function patterns
- Error handling strategies
Component Architecture (coming soon)
- Server vs Client Components
- Reusable component patterns
- State management
- Form handling
Contributing
We welcome contributions! Here’s how to get started:
Types of Contributions
| Name | Type | Description |
|---|---|---|
Bug Reports | issues | Found a bug? Open an issue with reproduction steps |
Feature Requests | discussions | Have an idea? Start a discussion |
Documentation | pull-requests | Improve docs by editing MDX files and submitting PRs |
Code Contributions | pull-requests | Submit pull requests with features, fixes, or improvements |
Contribution Guidelines
Before you start:
- Check existing issues and PRs to avoid duplicates
- Discuss major changes in an issue first
- Follow the code style and conventions
- Write clear commit messages
- Add tests for new features
Pull Request Process:
- Fork and create a feature branch
- Make your changes
- Test thoroughly (run
npm run build) - Write clear PR description
- Link related issues
- Wait for review and address feedback
Code Standards
TypeScript
A²D uses TypeScript 5 in strict mode:
// ✅ Good: Explicit types
interface MCPServer {
id: string
name: string
type: 'url' | 'openapi' | 'mock'
}
// ✅ Good: Type-safe function
function createServer(data: Partial<MCPServer>): Promise<MCPServer> {
// Implementation
}
// ❌ Bad: Using any
function processData(data: any) {
// Avoid this
}React Components
Prefer Server Components by default:
// ✅ Server Component (default)
export default async function ServersPage() {
const servers = await fetchServers()
return <ServersList servers={servers} />
}
// ✅ Client Component when needed
'use client'
export function ServersList({ servers }: Props) {
const [filter, setFilter] = useState('')
// Interactive logic
}Naming Conventions
- Files:
kebab-case.tsx - Components:
PascalCase - Functions:
camelCase - Constants:
UPPER_SNAKE_CASE - Types:
PascalCase
Testing
Testing infrastructure is planned but not yet implemented. This section describes the intended testing strategy.
Planned Testing Stack
- Unit Tests: Jest + React Testing Library
- Integration Tests: API route testing
- E2E Tests: Playwright
- Coverage Target: >80%
Testing Guidelines (Future)
// Example unit test structure
describe('MCPServerService', () => {
it('should create server with valid data', async () => {
const server = await createServer({
name: 'Test Server',
type: 'mock'
})
expect(server.name).toBe('Test Server')
})
})Development Workflow
Git Workflow
Branch naming:
feature/description- New featuresfix/description- Bug fixesdocs/description- Documentation updatesrefactor/description- Code improvements
Commit messages:
# Format: type(scope): description
feat(mcp): Add resource template support
fix(auth): Resolve signup redirect issue
docs(api): Update error handling guideCode Review Process
- Automated checks run on PR
- Maintainer review (1-2 reviewers)
- Address feedback
- Approval and merge
Build and Deploy
Local Build
# Type check
npm run type-check
# Lint
npm run lint
# Build
npm run build
# Test build
npm run startCI/CD
Automatic actions:
- Lint on PR
- Type check on PR
- Build verification
- Deploy preview on PR
- Deploy production on merge to main
Project Structure
mulesoft-mcp-mock-specs/
├── app/ # Next.js App Router
│ ├── (app)/ # Protected routes
│ ├── (auth)/ # Auth pages
│ ├── api/ # API routes
│ └── globals.css
├── components/ # React components
│ ├── ui/ # Base UI components
│ └── ... # Feature components
├── lib/ # Utilities
│ ├── supabase/ # Database clients
│ ├── mcp/ # MCP utilities
│ └── design-rules/ # Validation
├── types/ # TypeScript types
├── supabase/ # Database migrations
└── public/ # Static assetsGetting Help
Community
- GitHub Issues: ma2d-ai-issues
- GitHub Discussions: ma2d-ai-issues/discussions
Documentation
- Architecture: Multi-Tenancy
- API Reference: API Reference
- Core Concepts: Core Concepts
Code of Conduct
We are committed to providing a welcoming and inclusive environment. All contributors are expected to:
- Be respectful and considerate
- Welcome newcomers and help them learn
- Focus on what is best for the community
- Show empathy towards other community members
License
A²D is open source under the Apache 2.0 License.
- ✅ Freedom to use, modify, and distribute
- ✅ Patent protection
- ✅ Commercial use allowed
- ✅ Attribution required
See LICENSE for full details.
Roadmap
See ROADMAP.md for planned features and improvements.
Ready to contribute? Check out open issues or start a discussion!