Auspicious14 commited on
Commit
d91d152
ยท
1 Parent(s): d171100

update Space readme

Browse files
Files changed (1) hide show
  1. README.md +18 -166
README.md CHANGED
@@ -1,169 +1,21 @@
1
- # Maternal Health Support Backend
2
-
3
- โš ๏ธ **CLINICAL SAFETY NOTICE**
4
-
5
- This application is a **CARE-SUPPORT and ESCALATION TOOL**.
6
-
7
- - โŒ This is **NOT** a diagnostic system
8
- - โŒ This is **NOT** a medical device
9
- - โœ… This **IS** a care-support and escalation tool for early warning awareness
10
-
11
- ## Purpose
12
-
13
- This backend supports a maternal health application focused on:
14
- - Early warning awareness for high blood pressure disorders in pregnancy
15
- - Care escalation based on objective measurements
16
- - Educational content delivery
17
- - Connection to healthcare providers
18
-
19
- ## Non-Diagnostic Design Principles
20
-
21
- This system is built with strict clinical safety constraints:
22
-
23
- 1. **No Diagnosis**: The system never diagnoses conditions
24
- 2. **No Medical Advice**: No treatment recommendations or medical guidance
25
- 3. **No Risk Scoring**: No probability calculations or risk percentages
26
- 4. **Data Minimization**: Only essential data is collected
27
- 5. **Escalation Bias**: When uncertain, always escalate to higher priority
28
- 6. **Template-Only Messaging**: No dynamic medical text generation
29
-
30
- ## Architecture
31
-
32
- ### Modular Domain-Driven Design
33
-
34
- ```
35
- src/
36
- โ”œโ”€โ”€ auth/ # Authentication (minimal PII)
37
- โ”œโ”€โ”€ user-profile/ # User profile (data minimization)
38
- โ”œโ”€โ”€ blood-pressure/ # BP readings (neutral storage)
39
- โ”œโ”€โ”€ symptoms/ # Symptom tracking (atomic, non-scored)
40
- โ”œโ”€โ”€ care-priority/ # Care priority engine (rule-based)
41
- โ”œโ”€โ”€ notifications/ # Alerts (template-only)
42
- โ””โ”€โ”€ education/ # Educational content
43
- ```
44
-
45
- ### Technology Stack
46
-
47
- - **Framework**: NestJS with TypeScript (strict mode)
48
- - **Database**: PostgreSQL (to be configured in STEP 2)
49
- - **Authentication**: JWT-based
50
- - **Validation**: class-validator with strict settings
51
-
52
- ## Getting Started
53
-
54
- ### Prerequisites
55
-
56
- - Node.js 18+
57
- - PostgreSQL 14+
58
- - npm or yarn
59
-
60
- ### Installation
61
-
62
- ```bash
63
- # Install dependencies
64
- npm install
65
-
66
- # Copy environment template
67
- cp .env.example .env
68
-
69
- # Edit .env with your configuration
70
- # (Database credentials, JWT secrets, etc.)
71
- ```
72
-
73
- ### Development
74
-
75
- ```bash
76
- # Start in development mode with hot reload
77
- npm run start:dev
78
-
79
- # Build for production
80
- npm run build
81
-
82
- # Start production server
83
- npm run start:prod
84
- ```
85
-
86
- ### Testing
87
-
88
- ```bash
89
- # Run unit tests
90
- npm test
91
-
92
- # Run tests in watch mode
93
- npm test:watch
94
-
95
- # Generate coverage report
96
- npm test:cov
97
- ```
98
-
99
- ## Deployment
100
-
101
- For persistent background tasks and cron jobs, the backend is optimized for deployment on **Hugging Face Spaces** using Docker.
102
-
103
- - [Deployment Guide](./DEPLOYMENT.md)
104
- - [Health Check API](http://localhost:3000/api/v1/health) (when running locally)
105
-
106
- ## Implementation Status
107
-
108
- This project follows a 12-step implementation process:
109
-
110
- ### Phase 1: Foundation
111
- - [x] **STEP 1**: Project Bootstrap & Architecture โœ…
112
- - [ ] **STEP 2**: Database & ORM Setup
113
- - [ ] **STEP 3**: Authentication Module
114
-
115
- ### Phase 2: Core Data Modules
116
- - [ ] **STEP 4**: User Profile Module (Data Minimization)
117
- - [ ] **STEP 5**: Blood Pressure Module (Neutral Handling)
118
- - [ ] **STEP 6**: Symptom Module (Atomic, Non-Scored)
119
-
120
- ### Phase 3: Care Logic & Safety
121
- - [ ] **STEP 7**: Care Priority Engine (Most Critical)
122
- - [ ] **STEP 8**: Care Priority API Endpoint
123
- - [ ] **STEP 9**: Notifications & Alerts
124
-
125
- ### Phase 4: Support & Security
126
- - [ ] **STEP 10**: Education Content Module
127
- - [ ] **STEP 11**: Security, Logging & Rate Limiting
128
- - [ ] **STEP 12**: Final Safety Audit
129
-
130
- ## API Documentation
131
-
132
- Once running, API documentation will be available at:
133
- - Development: `http://localhost:3000/api/v1`
134
- - Swagger docs: (to be added in later steps)
135
-
136
- ## Clinical Safety Commitments
137
-
138
- Every module in this system adheres to:
139
-
140
- 1. **Deterministic Logic**: No AI/ML for medical decisions
141
- 2. **Transparent Rules**: All escalation rules are documented
142
- 3. **Conservative Defaults**: Favor care-seeking when uncertain
143
- 4. **Audit Trail**: All decisions are logged (without PII)
144
- 5. **No Diagnostic Language**: Careful wording throughout
145
-
146
- ## Regulatory Considerations
147
-
148
- This system is designed for:
149
- - NGO deployments
150
- - Public health pilots
151
- - Clinical partnerships
152
- - Research studies
153
-
154
- **Not intended for**:
155
- - Direct-to-consumer medical diagnosis
156
- - Replacement of clinical judgment
157
- - Unsupervised medical decision-making
158
-
159
- ## License
160
-
161
- ISC
162
-
163
- ## Support
164
 
165
- For questions about clinical safety design or implementation, please review the inline documentation in each module.
166
 
167
- ---
 
 
 
 
168
 
169
- **Remember**: This is a care-support tool. Always encourage users to seek professional medical advice.
 
 
 
1
+ ---
2
+ title: MaternAlert Backend
3
+ emoji: ๐Ÿฅ
4
+ colorFrom: green
5
+ colorTo: blue
6
+ sdk: docker
7
+ app_port: 7860
8
+ pinned: false
9
+ ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
 
11
+ # MaternAlert Backend
12
 
13
+ This is the persistent backend for the MaternAlert clinical support tool.
14
+ It handles:
15
+ - ๐Ÿ•’ **Scheduled Tasks**: Daily BP reminders and 5-day inactivity checks.
16
+ - ๐Ÿ“ˆ **Trend Analysis**: 7-day clinical pattern detection.
17
+ - ๐Ÿ”” **Notifications**: Push alerts via Expo and high-trust HTML emails.
18
 
19
+ ## Monitoring
20
+ - **Health Check**: `https://huggingface.co/spaces/Auspicious14/MaternAlert/api/v1/health`
21
+ - **Logs**: View the "Logs" tab in this Space to see cron job execution.