





Emma Up is a consumer-focused application designed to improve sleep quality by analyzing and processing user-specific sleep metrics.
Back-End
The back-end is built using a REST API powered by Node.js and TypeScript. Key technologies include:
- Fastify: Used to define endpoints and middleware, all fully documented with Swagger.
- PostgreSQL: The database layer, abstracted via Prisma ORM for seamless database interaction.
The architecture follows a DTO (Data Transfer Object) pattern, which was crucial during periods of rapid growth when data models were frequently updated. This approach allowed for iterative modifications to the endpoints, while maintaining backward compatibility by mapping changes into the existing DTO structure.
Infrastructure
The entire system runs on AWS Cloud, leveraging standard components such as authentication flows, security groups, and environment management.
CI/CD was handled efficiently using GitHub Actions and Secrets for automated deployments.
AI Integration
The core functionality of Emma Up revolves around its deep integration with ChatGPT models for data processing and generating user-facing content. The effectiveness of these models is directly linked to the quality of the user data provided.
One of my most significant contributions was the development of a complex feature utilizing three different models to create personalized, actionable insights for users. This involved querying fresh user data, processing it through a specialized model, and producing standardized outputs that could be used by content generation models.
A key technical challenge was avoiding duplicate asynchronous model calls. To solve this, I implemented a Mutex lock using Redis. While a compound unique index could prevent duplicate data from being stored, the Mutex approach ensured duplicates were never created in the first place.
Testing & Monitoring
I played a lead role in implementing best practices for testing and ensuring thorough documentation. Later, we developed an automated testing pipeline for the mobile platform, where I crafted comprehensive end-to-end (E2E) tests using Postman.
Additionally, I set up Grafana alerts to monitor failure rates and performance drops, particularly on the AI side of the system.