Context
Goal / Problem
Hellosaurus, an interactive children's mobile app, featured "do-its"—interactive gameplay elements within videos—that often resulted in child-created outputs like drawings or photos. The company recognized an opportunity to increase family engagement and retention by allowing users to permanently save, view, and favorite these personalized creations. The challenge was building a reliable, cross-platform API to handle the high volume of screen captures ("Moments") generated by the Unity-powered games and their associated large image files.
Role
Primary developer for the "Moments" API and persistence layer. My role included:
- Collaborating with mobile and game developers (Unity) to define a compatible, cross-platform data flow and API contract.
- Designing the database schema (
PostgreSQL) and implementing logic for handling both metadata and file storage references. - Developing the core RESTful API endpoints for creating, listing, and updating Moments.
- Implementing the API using Node.js and TypeScript.
Tech Stack
- Frontend: N/A (feature integrates into Unity Game Engine and Mobile App)
- Backend: Node.js, Express.js, TypeScript
- Database: PostgreSQL (
momentstable) - Infra / DevOps: AWS S3 (for image storage), AWS EC2 (backend hosting)
- Testing / Monitoring: Sentry
Architecture Overview
This feature involved close coordination between three layers: Unity Game Engine, the Mobile App Client, and the Hellosaurus Backend API.
- Creation Flow: The Unity game captures the screen ("Moment") and shares the image data with the mobile client via RPC (Remote Procedure Call).
- Submission Flow: The Mobile App calls the secure
POST /momentsendpoint on the API, sending the screenshot data. The API handles two tasks:- Image Storage: The image file is uploaded to AWS S3 for secure, scalable blob storage.
- Metadata Storage: A record containing the Moment's metadata and a reference link to the S3 object is persisted in the
momentstable in PostgreSQL.
- Retrieval Flow: The Mobile App client uses
GET /momentsto list all saved Moments (retrieving the S3 link from PostgreSQL) andPATCH /moments/:idto allow families to "favorite" their preferred creations. Sentry was used for application monitoring.
Implementation Highlights
- Developed a RESTful API using TypeScript and Node.js specifically designed for high-volume content ingestion from interactive activities.
- Designed the PostgreSQL schema and persistence flow to manage over 500K+ records, separating metadata from image data (stored in S3).
- Implemented secure, scalable integration with AWS S3 for reliable blob storage of the Moment images.
- Established a clear, documented API contract that facilitated seamless integration across three distinct development groups: Web (API), Mobile (Client), and Game (Unity Capture).
Challenges & Decisions
- Challenge: Efficiently storing and serving high volumes of image data generated as output from the game engine activities.
- Decision: Decoupled metadata from image storage. Metadata was stored in PostgreSQL for fast querying and indexing, while the large binary files were stored securely and scalably in AWS S3. This is the standard pattern for high-volume asset storage.
Outcome / Impact
- Successfully enabled the collection and surfacing of over 500,000 Moments (activity highlights) for families in the app within the first year.
- Launched a major feature that directly contributed to user engagement and retention by providing personalized family memories and children's creations.
Lessons / Next Steps
- Gained significant experience in cross-platform API development and coordination, particularly integrating web services with game engines (Unity).
- Solidified understanding of the PostgreSQL/S3 separation pattern for scalable activity output storage.
- Future steps would involve implementing image processing (e.g., resizing, optimization) upon upload to S3 to improve mobile load times.