Coding Standards & Development Guidelines Comprehensive development standards ensuring consistent code quality, maintainable architecture, and streamlined collaboration across the ReptiDex engineering team.
Quick Navigation
Jira Integration & Ticket Standards
Ticket Naming Conventions
Service-Scoped Tasks Sub-tasks must include service prefix
Format: {service}: {action description}
Examples: repti-core: set up auth, repti-animal: add pedigree tracking
Enables easy filtering and service ownership clarity
Cross-Service Tasks Multi-service coordination
Format: multi-service: {description} or integration: {description}
Examples: integration: connect animal service to marketplace
Use when changes span multiple services
Ticket Structure Standards
Epic Naming
Story Naming
Sub-task Naming
Bug & Task Naming
{Business Capability} - {Version/Phase}
Examples:
✅ Core Authentication & User Management - MVP
✅ Advanced Breeding Management - Phase 2
✅ Marketplace Integration - V1.2
❌ User authentication
❌ Add breeding features
Epic Description Template :## Business Objective
Brief description of the business value and user impact.
## Success Criteria
- [ ] Measurable outcome 1
- [ ] Measurable outcome 2
## Technical Scope
- Services involved: repti-core, repti-animal
- External integrations: Stripe, AWS KMS
## Dependencies
- Blocks/Blocked by: [Epic links]
## Acceptance Criteria
High-level acceptance criteria for the entire epic
Jira Ticket Lifecycle
Standard Ticket Workflow • Product Scoped : Product Requirements Defined • Engineering Scoped : Engineering scoped and ready for work • Ready for Work : Requirements defined, ready for development • In Progress : Active development • In Review : PR submitted and under review • QA : QA validation in progress • Done : Deployed to production • Blocked : Waiting on dependency • Cancelled : No longer needed
Git Workflow & Branch Management
Branch Naming Strategy
feature/ {JIRA-ID} - {brief-description}
Examples:
✅ feature/REPTI-123-user-authentication
✅ feature/REPTI-456-animal-registration-form
✅ feature/REPTI-789-stripe-payment-integration
# For sub-tasks, include service prefix
✅ feature/REPTI-123-repti-core-jwt-middleware
✅ feature/REPTI-456-frontend-registration-form
❌ feature/auth-stuff
❌ feature/new-feature
❌ john-working-branch
Branch Creation :# Create feature branch from main
git checkout main
git pull origin main
git checkout -b feature/REPTI-123-user-authentication
# Push and set upstream
git push -u origin feature/REPTI-123-user-authentication
Commit Message Standards
Conventional Commits Format <type> (<scope> ):
<description>
[optional body]
[optional footer(s)]
Commit Types
Commit Examples
Jira Integration
Standard Commit Types Type Description Example featNew feature feat(repti-core): add JWT authentication middlewarefixBug fix fix(repti-animal): resolve pedigree tree loading issuedocsDocumentation docs(api): update authentication endpoint documentationstyleCode style changes style(frontend): fix ESLint formatting issuesrefactorCode refactoring refactor(repti-commerce): simplify payment processing logicperfPerformance improvement perf(database): optimize animal query with indexestestTesting changes test(repti-core): add integration tests for auth servicebuildBuild system changes build(docker): update Node.js to version 18ciCI/CD changes ci(github): add automated security scanningchoreMaintenance tasks chore(deps): update dependencies to latest versions
Commit Scopes (Service Names)
repti-core, repti-animal, repti-commerce, repti-community, repti-media, repti-ops
frontend, database, infrastructure, docs, testing
Language-Specific Code Standards
Python (FastAPI Services)
TypeScript/React (Frontend)
TypeScript Standards tsconfig.json :{
"compilerOptions" : {
"target" : "ES2022" ,
"lib" : [ "dom" , "dom.iterable" , "es6" ],
"allowJs" : true ,
"skipLibCheck" : true ,
"esModuleInterop" : true ,
"allowSyntheticDefaultImports" : true ,
"strict" : true ,
"forceConsistentCasingInFileNames" : true ,
"noFallthroughCasesInSwitch" : true ,
"module" : "esnext" ,
"moduleResolution" : "node" ,
"resolveJsonModule" : true ,
"isolatedModules" : true ,
"noEmit" : true ,
"jsx" : "react-jsx" ,
"baseUrl" : "src" ,
"paths" : {
"@/*" : [ "*" ],
"@/components/*" : [ "components/*" ],
"@/services/*" : [ "services/*" ],
"@/utils/*" : [ "utils/*" ]
}
},
"include" : [ "src" , "types" ],
"exclude" : [ "node_modules" , "build" , "dist" ]
}
ESLint Configuration :{
"extends" : [
"react-app" ,
"react-app/jest" ,
"@typescript-eslint/recommended" ,
"prettier"
],
"rules" : {
"@typescript-eslint/no-unused-vars" : "error" ,
"@typescript-eslint/no-explicit-any" : "warn" ,
"react/jsx-props-no-spreading" : "off" ,
"import/order" : [
"error" ,
{
"groups" : [
"builtin" ,
"external" ,
"internal" ,
"parent" ,
"sibling" ,
"index"
],
"newlines-between" : "always"
}
]
}
}
SQL & Database Standards
Schema Design
Migration Standards
Query Standards
Database Naming Conventions Table Names :-- Use plural nouns, snake_case
✅ users
✅ animal_records
✅ breeding_events
✅ marketplace_listings
❌ User
❌ animalRecord
❌ BreedingEvent
Column Names :-- Use snake_case, descriptive names
CREATE TABLE users (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
email VARCHAR ( 255 ) UNIQUE NOT NULL ,
username VARCHAR ( 50 ) UNIQUE NOT NULL ,
password_hash VARCHAR ( 255 ) NOT NULL ,
email_verified BOOLEAN DEFAULT FALSE,
created_at TIMESTAMPTZ DEFAULT NOW (),
updated_at TIMESTAMPTZ DEFAULT NOW (),
deleted_at TIMESTAMPTZ -- Soft delete pattern
);
-- Foreign key naming: {referenced_table}_id
CREATE TABLE animal_records (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
owner_id UUID REFERENCES users(id),
species_id UUID REFERENCES species(id),
-- ...
);
Index Naming :-- Format: idx_{table}_{column(s)}
CREATE INDEX idx_users_email ON users(email);
CREATE INDEX idx_users_username ON users(username);
CREATE INDEX idx_animal_records_owner ON animal_records(owner_id);
CREATE INDEX idx_animal_records_species_created ON animal_records(species_id, created_at);
-- Unique indexes: unq_{table}_{column(s)}
CREATE UNIQUE INDEX unq_users_email ON users(email);
Pull Request & Code Review Process
Pull Request Standards
PR Title Format <type> (<service> ):
<brief description>
[REPTI-###]
Pull Request Template GitHub PR Template (.github/pull_request_template.md):## 📝 Summary
Brief description of changes made in this PR.
## 🎫 Jira Ticket
- **Ticket** : [ REPTI-XXX ]( https://reptidex.atlassian.net/browse/REPTI-XXX )
- **Type** : Feature/Bug Fix/Refactor/Documentation
## 🔧 Changes Made
- [ ] List specific changes
- [ ] Include technical details
- [ ] Mention any breaking changes
## 🧪 Testing
- [ ] Unit tests added/updated
- [ ] Integration tests added/updated
- [ ] Manual testing completed
- [ ] All existing tests pass
## 📋 Checklist
- [ ] Code follows style guidelines
- [ ] Self-review completed
- [ ] Documentation updated
- [ ] No sensitive data exposed
- [ ] Database migrations included (if applicable)
## 🎯 Review Focus Areas
Specific areas where you want reviewer attention:
- Performance considerations
- Security implications
- API design decisions
## 📸 Screenshots/Videos
Include screenshots for UI changes or videos for complex workflows.
## 🔗 Related PRs
Link any related or dependent pull requests.
Hotfix PR Template ## 🚨 HOTFIX: Critical Issue Resolution
**Urgency Level** : Critical/High/Medium
**Affected Environment** : Production/Staging
## 🐛 Issue Description
Detailed description of the critical issue being fixed.
## 🎫 Jira Ticket
- **Ticket** : [ REPTI-XXX ]( https://reptidex.atlassian.net/browse/REPTI-XXX )
- **Incident** : [Link to incident report]
## 🔧 Root Cause
Technical explanation of what caused the issue.
## ✅ Solution
Detailed explanation of the fix implemented.
## 🧪 Testing
- [ ] Fix verified in staging
- [ ] Regression tests added
- [ ] Impact on related features tested
## 📊 Deployment Plan
- [ ] Database changes: Yes/No
- [ ] Requires restart: Yes/No
- [ ] Rollback plan documented
Development Workflow Summary
Daily Development Workflow
Complete Development Cycle 1
Create properly formatted ticket with service prefix: “repti-core: implement JWT authentication”
2
Create feature branch: “feature/REPTI-123-repti-core-jwt-middleware”
3
Make commits with conventional format: “feat(repti-core): add JWT validation middleware”
4
Create PR with template: “feat(repti-core): implement JWT authentication middleware [REPTI-123]“
5
Address feedback, get approvals, merge with squash commit
6
Automatic ticket transition to Done, deployment tracking
Quick Reference Commands
# Create and switch to feature branch
git checkout -b feature/REPTI-123-repti-core-auth-middleware
# Make conventional commit
git commit -m "feat(repti-core): add JWT validation middleware
- Implement token verification for protected routes
- Add comprehensive error handling
- Include refresh token logic
Closes: REPTI-123"
# Push and create PR
git push -u origin feature/REPTI-123-repti-core-auth-middleware
gh pr create --title "feat(repti-core): implement JWT authentication middleware [REPTI-123]" --body-file .github/pull_request_template.md
These coding standards ensure consistent, high-quality code across the reptidex platform while maintaining clear traceability between Jira tickets, git branches, commits, and pull requests. Regular updates to these standards will be made as the team grows and best practices evolve.