Developer Documentation - Vault API Platform
Getting Started
Local Development Setup
-
Environment Setup
-
Database Configuration
-
Environment Variables
Create
.envfile in project root: -
Start Development Server
Development Workflow
Project Structure
Services Architecture
1. Core Service
Purpose: System monitoring and health checks Key Components:BaseServerStatsView- Comprehensive system metricsHealthCheckView- Simple health endpointApplicationContextMiddleware- Multi-app context injection
- Uses
psutilfor system metrics - Custom JSON encoder handles Path objects
- Auto-refresh dashboards every 30 seconds
2. Trace Service (FSM)
Purpose: Feature Specification Management via Notion Key Components:ApplicationTraceabilityService- Notion API integrationBaseService- Standardized export functionality- Multi-app filtering via registry pattern
3. Club Service
Purpose: Community analytics and data processing Key Components:ClubTraceabilityService- External API integration- Async data export with concurrent processing
- Feature-specific statistics and analytics
- External APIs (hero metrics, feature stats)
- Static JSON file processing
- Database export tracking
Multi-Application System
Registry Pattern
Request Flow
API Development
Creating New Endpoints
-
Add to views.py:
-
Add URL pattern:
-
Update registry filters (if needed):
Response Standards
Multi-App Response:Testing
Running Tests
Test Structure
Manual Testing
Data Management
Static Data Files
Location:static/data/
Trace Service Files:
features.json- Feature specificationsgateways.json- Gateway configurationstiers.json- Tier definitionstags.json- Tag metadatafsm_index.json- Service index with history
hero-metrics.json- Key community metrics{feature}-most-present.json- Feature statisticsclub_index.json- Service index with history
Data Export Services
Trace Service:Admin Dashboards
Creating Admin Views
-
View Function:
-
Template: Follow existing patterns in
templates/directories -
URL Configuration:
Dashboard Features
- Auto-refresh: Templates include JavaScript for periodic refresh
- Error handling: Graceful error display with retry options
- Responsive design: Works on desktop and mobile
- Interactive elements: Search, filtering, data manipulation
Caching Strategy
Cache Keys
club_data_{filename}- Club service data filesclub_available_features- Feature list cachetrace_matrix_data- Trace service data cache- App-specific:
club_data_{app_name}_{filename}
Cache Management
Monitoring & Debugging
Health Monitoring
-
Basic Health:
/health/- Database connectivity
- Cache functionality
- Basic service status
-
Detailed Health:
/club/admin/service-health/- File system status
- Cache performance
- Database statistics
-
System Stats:
/stats/- CPU, memory, disk usage
- Django application info
- Process information
Debugging Tools
Logging
Deployment
Production Settings
Deployment Checklist
- Environment variables configured
- Database migrations run
- Static files collected
- Cache backend configured
- Monitoring alerts set up
- Backup strategy implemented
- SSL certificates installed
- Rate limiting configured
Docker Setup
Contributing
Code Style
- Follow Django best practices
- Use type hints where helpful
- Write docstrings for complex functions
- Keep views thin, services thick
Git Workflow
- Create feature branch
- Make changes
- Write/update tests
- Update documentation
- Submit pull request
Code Review
- Ensure backward compatibility
- Verify multi-app functionality
- Check admin dashboard updates
- Test with different applications
Last Updated: January 2025
Django Version: 4.2+
Python Version: 3.9+