Changes: - Add wellnuoSheme/ folder with project documentation - Rename patients -> beneficiaries (proper WellNuo terminology) - Add BeneficiaryContext for state management - Update API service with WellNuo endpoints - Add dashboard screen for beneficiary overview - Update navigation and layout Scheme files include: - API documentation with credentials - Project description - System analysis - UX flow - Legal documents (privacy, terms, support) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
370 lines
12 KiB
JSON
370 lines
12 KiB
JSON
{
|
||
"_meta": {
|
||
"name": "WellNuo - System Analysis",
|
||
"updatedAt": "2025-12-12T20:47:36.951Z"
|
||
},
|
||
"elements": [
|
||
{
|
||
"id": "header",
|
||
"type": "card",
|
||
"name": "System Analysis",
|
||
"description": "WellNuo Voice Assistant\n\nТип: Distributed Mobile Application\nПарадигма: Client-Server with AI Integration\n\nКомпоненты:\n- Mobile Client\n- Backend Server\n- AI Processing\n- Data Layer\n- External Integrations",
|
||
"tags": [
|
||
"overview"
|
||
],
|
||
"x": 500,
|
||
"y": 50
|
||
},
|
||
{
|
||
"id": "mobile_client",
|
||
"type": "card",
|
||
"name": "Mobile Client",
|
||
"description": "Type: Frontend\nStack: React Native, Expo, TypeScript\n\nResponsibilities:\n- Voice input capture\n- Audio processing\n- UI rendering\n- Local caching\n- Offline functionality\n\nModules:\n- Voice Recognition\n- Audio Processing Engine\n- Conversation Manager\n- UI Components\n- Storage Manager",
|
||
"tags": [
|
||
"frontend"
|
||
],
|
||
"x": 100,
|
||
"y": 200
|
||
},
|
||
{
|
||
"id": "backend_server",
|
||
"type": "card",
|
||
"name": "Backend Server",
|
||
"description": "Type: API Gateway\nStack: Node.js, Express.js, TypeScript\n\nResponsibilities:\n- Request routing\n- Authentication\n- Business logic\n- Data persistence\n- API management\n\nModules:\n- Auth Service\n- User Management\n- Conversation API\n- Integration Layer\n- Monitoring",
|
||
"tags": [
|
||
"backend"
|
||
],
|
||
"x": 400,
|
||
"y": 200
|
||
},
|
||
{
|
||
"id": "ai_processing",
|
||
"type": "card",
|
||
"name": "AI Processing Layer",
|
||
"description": "Type: External Service Integration\nStack: OpenAI API, OpenRouter, Custom Models\n\nResponsibilities:\n- Natural Language Processing\n- Intent Recognition\n- Context Management\n- Response Generation\n- Voice Synthesis\n\nModules:\n- NLP Engine\n- Context Manager\n- Response Generator\n- Model Manager",
|
||
"tags": [
|
||
"external"
|
||
],
|
||
"x": 700,
|
||
"y": 200
|
||
},
|
||
{
|
||
"id": "data_layer",
|
||
"type": "card",
|
||
"name": "Data Layer",
|
||
"description": "Type: Persistence\nStack: PostgreSQL, Redis, MongoDB\n\nResponsibilities:\n- User data storage\n- Conversation history\n- Preferences\n- Session caching\n- Analytics data\n\nModules:\n- User Database\n- Conversation Store\n- Cache Layer\n- Analytics Store",
|
||
"tags": [
|
||
"backend"
|
||
],
|
||
"x": 100,
|
||
"y": 400
|
||
},
|
||
{
|
||
"id": "external_integrations",
|
||
"type": "card",
|
||
"name": "External Integrations",
|
||
"description": "Type: Third-party Services\nStack: REST APIs, Webhooks, OAuth\n\nServices:\n- Calendar integration\n- Reminder management\n- Payment processing\n- Push notifications\n- Analytics tracking",
|
||
"tags": [
|
||
"external"
|
||
],
|
||
"x": 400,
|
||
"y": 400
|
||
},
|
||
{
|
||
"id": "data_flow_header",
|
||
"type": "card",
|
||
"name": "Voice Command Flow",
|
||
"description": "10-шаговый процесс обработки голосовой команды:\n\n1. Voice Input → Mobile\n2. Audio Processing → Mobile\n3. Speech-to-Text → AI\n4. Intent Analysis → AI\n5. Business Logic → Backend\n6. Data Operations → DB\n7. External API Calls → Ext\n8. Response Generation → AI\n9. Text-to-Speech → AI\n10. Audio Output → Mobile",
|
||
"tags": [
|
||
"flow"
|
||
],
|
||
"x": 700,
|
||
"y": 400
|
||
},
|
||
{
|
||
"id": "tech_mobile",
|
||
"type": "card",
|
||
"name": "Mobile Tech Spec",
|
||
"description": "Framework: React Native + Expo\nLanguage: TypeScript\nState: Redux Toolkit + RTK Query\nUI: Expo Components\nNavigation: React Navigation 6\nAudio: Expo Audio + Web Audio API\nStorage: SecureStore + AsyncStorage\nOffline: Local SQLite\n\nDevice Requirements:\n- Microphone: Required\n- Speakers: Required\n- Internet: For AI\n- Storage: 100MB min",
|
||
"tags": [
|
||
"frontend",
|
||
"tech"
|
||
],
|
||
"x": 100,
|
||
"y": 600
|
||
},
|
||
{
|
||
"id": "tech_backend",
|
||
"type": "card",
|
||
"name": "Backend Tech Spec",
|
||
"description": "Runtime: Node.js 18+\nFramework: Express.js + TypeScript\nAuth: JWT + OAuth 2.0\nAPI: RESTful + WebSocket\nRate Limiting: Express Rate Limit\nDocs: Swagger/OpenAPI 3.0\nLogging: Winston + ELK Stack\nMonitoring: Prometheus + Grafana\nTesting: Jest + Supertest",
|
||
"tags": [
|
||
"backend",
|
||
"tech"
|
||
],
|
||
"x": 400,
|
||
"y": 600,
|
||
"title": "Untitled"
|
||
},
|
||
{
|
||
"id": "tech_database",
|
||
"type": "card",
|
||
"name": "Database Tech Spec",
|
||
"description": "Primary: PostgreSQL 14+\nCache: Redis 7+\nSearch: Elasticsearch (optional)\nORM: Prisma\nMigrations: Prisma Migrate\nBackups: Daily + PITR\nScaling: Read replicas + connection pooling",
|
||
"tags": [
|
||
"backend",
|
||
"tech"
|
||
],
|
||
"x": 700,
|
||
"y": 600
|
||
},
|
||
{
|
||
"id": "tech_ai",
|
||
"type": "card",
|
||
"name": "AI Services Spec",
|
||
"description": "Primary: OpenAI API\nBackup: OpenRouter\nSTT: Google Speech-to-Text\nTTS: ElevenLabs API\n\nModel Management: Dynamic selection\nContext Window: 4096 tokens min\nResponse Time: < 2s complex queries",
|
||
"tags": [
|
||
"external",
|
||
"tech"
|
||
],
|
||
"x": 100,
|
||
"y": 800
|
||
},
|
||
{
|
||
"id": "tech_infra",
|
||
"type": "card",
|
||
"name": "Infrastructure",
|
||
"description": "Hosting: AWS/GCP\nContainers: Docker + Kubernetes\nCI/CD: GitHub Actions\nLoad Balancer: ALB\nCDN: CloudFront/Cloudflare\nMonitoring: DataDog/New Relic\nSecurity: WAF + DDoS Protection\nCompliance: GDPR + SOC 2 Type II",
|
||
"tags": [
|
||
"backend",
|
||
"tech"
|
||
],
|
||
"x": 400,
|
||
"y": 800
|
||
},
|
||
{
|
||
"id": "performance",
|
||
"type": "card",
|
||
"name": "Performance Requirements",
|
||
"description": "Response Times:\n- Voice recognition: < 500ms\n- Simple commands: < 800ms\n- Complex queries: < 2000ms\n- UI interactions: < 100ms\n- App startup: < 3s\n\nAvailability:\n- Uptime: 99.9%\n- Monthly downtime: < 43.2 min\n- RTO: < 1 hour\n- RPO: < 15 min",
|
||
"tags": [
|
||
"requirements"
|
||
],
|
||
"x": 700,
|
||
"y": 800
|
||
},
|
||
{
|
||
"id": "scalability",
|
||
"type": "card",
|
||
"name": "Scalability",
|
||
"description": "Concurrent Users: 10,000+\nRequests/Second: 1000+\nDB Connections: 100+\nAuto-scaling: Enabled\n\nMobile Performance:\n- App Size: < 100MB\n- Memory: < 200MB\n- Battery: Minimal usage\n- Offline: Basic commands",
|
||
"tags": [
|
||
"requirements"
|
||
],
|
||
"x": 100,
|
||
"y": 970
|
||
},
|
||
{
|
||
"id": "security",
|
||
"type": "card",
|
||
"name": "Security Architecture",
|
||
"description": "Data Protection:\n- Encryption: AES-256 (rest+transit)\n- Key Management: AWS KMS\n- Data Masking: PII in logs\n\nAuthentication:\n- JWT + refresh rotation\n- MFA: TOTP + biometric\n- Sessions: httpOnly cookies\n- Password: 12+ chars complex\n\nAPI Security:\n- Rate limiting\n- Input validation\n- SQL injection prevention\n- XSS protection + CSP",
|
||
"tags": [
|
||
"security"
|
||
],
|
||
"x": 400,
|
||
"y": 970
|
||
},
|
||
{
|
||
"id": "privacy",
|
||
"type": "card",
|
||
"name": "Privacy Requirements",
|
||
"description": "Data Minimization:\n- Collect only necessary data\n\nUser Consent:\n- Explicit consent required\n\nRight to Deletion:\n- Complete data removal\n\nData Portability:\n- Export in standard formats",
|
||
"tags": [
|
||
"security"
|
||
],
|
||
"x": 700,
|
||
"y": 970
|
||
},
|
||
{
|
||
"id": "dev_workflow",
|
||
"type": "card",
|
||
"name": "Development Workflow",
|
||
"description": "Version Control:\n- Git + GitFlow\n- Feature branches + PRs\n- Code review required\n\nQA:\n- Unit tests: 80%+ coverage\n- E2E: Critical paths\n- Performance: Load tests\n- Security: Static + pen tests\n\nDeployment:\n- Environments: Dev/Stage/Prod\n- Blue-green deployment\n- Instant rollback\n- Health monitoring",
|
||
"tags": [
|
||
"backend"
|
||
],
|
||
"x": 100,
|
||
"y": 1140
|
||
},
|
||
{
|
||
"id": "monitoring",
|
||
"type": "card",
|
||
"name": "Monitoring & Observability",
|
||
"description": "Metrics:\n- APM (performance)\n- Business (engagement)\n- Infrastructure (CPU/mem)\n- Custom (voice success rate)\n\nLogging:\n- Structured JSON\n- Levels: ERROR/WARN/INFO/DEBUG\n- Retention: 30-90 days\n- Full-text search\n\nAlerting:\n- Channels: Email/Slack/PagerDuty\n- Escalation policy\n- Response: < 15 min critical",
|
||
"tags": [
|
||
"backend"
|
||
],
|
||
"x": 400,
|
||
"y": 1140
|
||
},
|
||
{
|
||
"id": "risks",
|
||
"type": "card",
|
||
"name": "Risk Assessment",
|
||
"description": "Tech Risks:\n1. AI API latency (Med/High)\n → Multiple providers + caching\n2. Voice accuracy (Med/Med)\n → Multiple STT + feedback\n3. Offline limits (High/Med)\n → Progressive sync\n\nBusiness Risks:\n1. AI costs (High/Med)\n → Cost monitoring + quotas\n2. Privacy regulations (Med/High)\n → Privacy by design",
|
||
"tags": [
|
||
"overview"
|
||
],
|
||
"x": 700,
|
||
"y": 1140
|
||
},
|
||
{
|
||
"id": "future",
|
||
"type": "card",
|
||
"name": "Future Considerations",
|
||
"description": "Scalability:\n- Microservices migration\n- GraphQL API\n- Edge computing\n\nFeature Roadmap:\n- Multi-language expansion\n- Custom AI training\n- Advanced offline\n- Smart home devices\n- Enterprise + SSO\n\nTechnology:\n- 5G optimization\n- AR integration\n- Quantum-resistant crypto",
|
||
"tags": [
|
||
"overview"
|
||
],
|
||
"x": 400,
|
||
"y": 1310
|
||
}
|
||
],
|
||
"connections": [
|
||
{
|
||
"from": "header",
|
||
"to": "mobile_client",
|
||
"label": "frontend"
|
||
},
|
||
{
|
||
"from": "header",
|
||
"to": "backend_server",
|
||
"label": "backend"
|
||
},
|
||
{
|
||
"from": "header",
|
||
"to": "ai_processing",
|
||
"label": "AI"
|
||
},
|
||
{
|
||
"from": "mobile_client",
|
||
"to": "backend_server",
|
||
"label": "API calls"
|
||
},
|
||
{
|
||
"from": "backend_server",
|
||
"to": "ai_processing",
|
||
"label": "AI requests"
|
||
},
|
||
{
|
||
"from": "backend_server",
|
||
"to": "data_layer",
|
||
"label": "persistence"
|
||
},
|
||
{
|
||
"from": "backend_server",
|
||
"to": "external_integrations",
|
||
"label": "integrations"
|
||
},
|
||
{
|
||
"from": "ai_processing",
|
||
"to": "data_flow_header",
|
||
"label": "flow"
|
||
},
|
||
{
|
||
"from": "data_layer",
|
||
"to": "tech_mobile"
|
||
},
|
||
{
|
||
"from": "external_integrations",
|
||
"to": "tech_backend"
|
||
},
|
||
{
|
||
"from": "data_flow_header",
|
||
"to": "tech_database"
|
||
},
|
||
{
|
||
"from": "tech_mobile",
|
||
"to": "tech_backend"
|
||
},
|
||
{
|
||
"from": "tech_backend",
|
||
"to": "tech_database"
|
||
},
|
||
{
|
||
"from": "tech_database",
|
||
"to": "tech_ai"
|
||
},
|
||
{
|
||
"from": "tech_ai",
|
||
"to": "tech_infra"
|
||
},
|
||
{
|
||
"from": "tech_infra",
|
||
"to": "performance"
|
||
},
|
||
{
|
||
"from": "performance",
|
||
"to": "scalability"
|
||
},
|
||
{
|
||
"from": "scalability",
|
||
"to": "security"
|
||
},
|
||
{
|
||
"from": "security",
|
||
"to": "privacy"
|
||
},
|
||
{
|
||
"from": "privacy",
|
||
"to": "dev_workflow"
|
||
},
|
||
{
|
||
"from": "dev_workflow",
|
||
"to": "monitoring"
|
||
},
|
||
{
|
||
"from": "monitoring",
|
||
"to": "risks"
|
||
},
|
||
{
|
||
"from": "risks",
|
||
"to": "future"
|
||
}
|
||
],
|
||
"tagsDictionary": [
|
||
{
|
||
"tag": "overview",
|
||
"color": "#607D8B"
|
||
},
|
||
{
|
||
"tag": "frontend",
|
||
"color": "#4CAF50"
|
||
},
|
||
{
|
||
"tag": "backend",
|
||
"color": "#2196F3"
|
||
},
|
||
{
|
||
"tag": "external",
|
||
"color": "#FF9800"
|
||
},
|
||
{
|
||
"tag": "flow",
|
||
"color": "#9C27B0"
|
||
},
|
||
{
|
||
"tag": "tech",
|
||
"color": "#00BCD4"
|
||
},
|
||
{
|
||
"tag": "requirements",
|
||
"color": "#795548"
|
||
},
|
||
{
|
||
"tag": "security",
|
||
"color": "#F44336"
|
||
}
|
||
]
|
||
} |