SafeWomb is a specialized mobile application built to empower expectant mothers with the tools, tracking, and information they need for a healthy pregnancy. Developed using React Native and Expo, the app provides a high-performance, cross-platform experience with a focus on security and ease of use.
- Features
- Tech Stack
- Project Structure
- Getting Started
- Available Scripts
- Environment Variables
- Contributing
- License
- Pregnancy Progress Tracker: Visual milestones and weekly updates on fetal development.
- Health Metrics Logging: Securely record weight, blood pressure, and daily symptoms.
- Appointment Reminders: Never miss a prenatal checkup with built-in scheduling.
- Resource Library: Expert-backed articles and tips for maternal wellness and nutrition.
- Native Performance: Fully optimized for both iOS and Android via Expo Prebuild.
- Framework: React Native
- Platform: Expo (Managed Workflow / Prebuild)
- Language: TypeScript
- Navigation: Expo Router
- Bundler: Metro
- Development: EAS (Expo Application Services)
βββ .expo/ # Expo configuration and cache
βββ android/ # Native Android project (generated)
βββ ios/ # Native iOS project (generated)
βββ app/ # Main application routes and screens
βββ app-example/ # Reference implementation and boilerplate
βββ assets/ # Local images, fonts, and splash screens
βββ node_modules/ # Project dependencies
βββ .gitignore # Git exclusion rules
Follow these steps to set up the project locally on your machine.
- Node.js: Download and install Node.js (LTS version recommended).
- Git: Install Git if you haven't already.
- Expo Go: Download the app on your iOS or Android device to test the app.
Copy and paste the following commands into your terminal:
# 1. Clone the repository
git clone [https://github.com/Raphael-Akinmoladun/safeWomb.git](https://github.com/Raphael-Akinmoladun/safeWomb.git)
# 2. Navigate into the project directory
cd safeWomb
# 3. Install the dependencies
npm install
# 4. Start the development server
npx expo startIn the project directory, you can run the following commands to develop, test, and build your application:
npx expo start: Starts the Metro bundler. This is your primary command to begin development.npx expo start --tunnel: Starts the dev server using a tunnel (useful if your phone and computer are on different Wi-Fi networks).
npx expo run:android: Compiles and runs your app on a connected Android device or emulator.npx expo run:ios: Compiles and runs your app on an iOS simulator (requires macOS and Xcode).
eas build --platform android: Starts a production build for Android using Expo Application Services.eas build --platform ios: Starts a production build for iOS.npx expo export: Exports the static files for your application (useful for web hosting or self-hosting updates).
npx expo install --check: Checks your project's dependencies for compatibility with your current Expo version.
##API Configuration EXPO_PUBLIC_API_URL=https://your-api-endpoint.com
EXPO_PUBLIC_STORAGE_BUCKET=your_bucket_id
EXPO_PUBLIC_ENABLE_ANALYTICS=false
##π Environment Variables Create a .env file in the root directory to store your API keys and configuration:
Code snippet EXPO_PUBLIC_API_URL=https://your-api-endpoint.com EXPO_PUBLIC_STORAGE_BUCKET=your_bucket_id
##π€ Contributing Contributions are what make the open source community such an amazing place to learn, inspire, and create.
Fork the Project.
Create your Feature Branch (git checkout -b feature/AmazingFeature).
Commit your Changes (git commit -m 'Add some AmazingFeature').
Push to the Branch (git push origin feature/AmazingFeature).
Open a Pull Request.
##π License Distributed under the MIT License. See LICENSE for more information.
π« Contact Raphael Akinmoladun GitHub: @Raphael-Akinmoladun
Project Link: https://github.com/Raphael-Akinmoladun/safeWomb
The backbone of the safeWomb platform. This server manages health data analysis via REST endpoints and provides a real-time AI Voice Assistant using WebSockets and Google Gemini.
This backend is a hybrid server that integrates traditional HTTP requests with high-speed WebSockets. It acts as the bridge between the expectant mother's mobile interface and advanced AI diagnostics.
- Gemini-Powered Voice Assistant: Real-time audio-to-audio communication using
gemini-2.5-flash. - Health Data Analysis: Dedicated routes for processing and storing pregnancy-related data.
- Dual-Protocol Server: Runs Express (REST) and WS (WebSockets) simultaneously on a single port.
- Database Persistence: Robust document storage using MongoDB and Mongoose.
- Runtime: Node.js
- Framework: Express.js
- AI Engine: Google Generative AI (Gemini)
- Real-time: ws (WebSockets)
- Database: MongoDB via Mongoose
- Security: CORS & Dotenv
βββ controllers/ # Business logic for data analysis
βββ routes/ # API endpoint definitions (REST)
βββ .env # Environment secrets (ignored by Git)
βββ server.js # Main entry point (the code you sent)
βββ package.json # Dependencies and scripts
REST APIMethodEndpointDescriptionGET/api/healthCheck if the server is live.USE/api/*Access analysis routes and controllers.WebSocket (Voice)ProtocolConnection URLModalityWSws://localhost:5000Audio stream in / Audio stream out
Bash git clone https://github.com/Raphael-Akinmoladun/safeWomb.git
Bash npm install
Create a .env file in the root directory:Code snippetPORT=5000 MONGO_URI=your_mongodb_connection_string GEMINI_API_KEY=your_google_gemini_api_key
Bash Development mode npm run dev Production mode node server.js π€ How the Voice AI Works
Gemini Processing: The server converts the buffer to Base64 and sends it to the gemini-2.5-flash model with instructions to "Reply with a spoken response."
Audio Output: The server receives the AI's spoken response and pipes it back to the frontend as a Buffer for immediate playback.
Please ensure that any new routes follow the controller-service pattern currently implemented in analysisRoutes.
This project is licensed under the MIT License.