How We’ve Built a Longevity-Focused Mobile App with OpenAI

Longist Inc.
12 min readJul 5, 2024

--

Longist®: Longevity Tracker: We are Adding Up to 13 Years to Healthy Human Lifespan

This blog post describes the architecture of Longist, a longevity-focused mobile app we’ve built. Inspired by Simon Sinek and his book Find Your Why, I want to share my “why” behind creating Longist.

If you’re not interested in the prerequisites or biographical details, you can skip ahead to the architecture and user flow section. For those as curious as I am, I highly recommend reading the next few paragraphs. My goal is to make this article inspirational, and hopefully, you’ll find yourself in these pages.

Growing up in Kyiv, Ukraine, I faced many challenges that shaped my resilience and determination. Despite the tough environment, I learned to see opportunities where others saw obstacles.

AI-generated image based on an actual photo representing the author’s childhood neighborhood, created to prevent social engineering risks.

The Beginning

On the personal front, I inherited a “handsome” appearance that caused me trouble throughout my life. People often judged me by my appearance, assuming I was “rich,” “wealthy,” “elite,” and “spoiled.” Ironically, I was born in a ghetto in Kyiv, Ukraine, where in the 1990s, many people were buried in local parks due to gang conflicts. I often saw needles and syringes on the stairways until I was 18 and moved out.

At 16, influenced by my brother and his friend, I dove into photography. This new perspective allowed me to see the world differently and recognize the importance of hard work and persistence. Photographing events for a luxury fashion company taught me about the diverse realities people live in and the value of perseverance.

At 18, I became aware of the stark contrasts in lifestyles and opportunities. This realization fueled my drive to work hard and create a better future for myself.

My second encounter with inequality was in the US, participating in the “Work and Travel” student program. I worked 60 hours a week at a gas station, realizing that what my mother earned from three jobs in a month could be made in a week in the US. This was in 2011, post-mortgage crisis but before the current inflation surge.

My goal was to buy a MacBook Pro and return as a “winner.” I learned early on that having the right tools, along with continuously upgrading knowledge, brings success.

After returning to Ukraine, my depression deepened until I decided to visit Seattle, WA. This was the third and last time I decided I was done with the “poor state of things.”

The Path to Longist

Since 2017, I’ve been absorbing information with a hunger comparable only to famine. By 2024, I lost all my friends, a sacrifice on the path to becoming someone who can share my “why” and help others like myself.

My ‘why’ began forming when I realized how a five-minute delay on a winter morning could lead to unnecessary cold feet (with the subsequent toe pain) from waiting for another bus. This experience, combined with reading about the “butterfly effect” at age 14, made me obsessed with how one event can change a life.

I’ve had 18 turning points in my life:

  1. Born in a ghetto.
  2. Parents divorced at 12.
  3. Worldview shaped through a camera lens.
  4. Degree in economics.
  5. Travel to the US.
  6. Degree in business intelligence.
  7. Immigration to the US (changing family tree).
  8. Worked in a grocery store (saving for a car).
  9. Worked as an Uber driver (saving for an MBA).
  10. Obtained an MBA (realizing the burden of classmates’ student debt).
  11. Passed financial exams (realizing broker scams).
  12. Created a crypto startup (failure due to greed and pride).
  13. Slept in a car while building a company (realizing the importance of self-reliance).
  14. Learned to code (expelled from a coding bootcamp).
  15. Met my wife during a startup presentation (burnout is real; finding the right person in the crowd is crucial).
  16. Sacrificed time spent with all friends to boost my knowledge during and after COVID.
  17. Became a millionaire at 32.
  18. Built a product focused on longevity.

The Birth of Longist

The goal was to encourage people to reconsider their food choices by highlighting their impact on lifespan.

We have a 19-year age difference, a fact that some people consider unusual. A year ago, after a long conversation about life expectancy, I presented the idea that led to Longist.

The idea was to make people think twice about what they eat by showing how it affects their lifespan. Longist aims to add years to a healthy human lifespan, backed by 20 years of scientific research. I spent a year working full-time at a bank and coding at night and on weekends, writing 1,000,000 lines of code to make this app possible.

Now that you know my “why” (to make everyone live more efficiently, prolong my wife’s life, and make American society healthier), let’s dive into how we’ve built it.

The Architecture

Building Blocks of Longist

One pivotal point was completing the AWS Solutions Architect certification. When taking the Myers-Briggs test, the results identified me as an INTJ (Architect), which gave me confidence that I could design and build a scalable architecture.

Even though you can inspect and analyze the list of services used below on the architecture diagram, I will try to describe the user flow in a more engaging manner.

Given that the notion of writing 1,000,000 lines of code seems unreal, I must mention that there are three people on the team, and we used AWS Amplify for this project.

For comparison: with an upper estimate of 16,000 lines per book, 1,000,000 lines equate to about 62.5 books. Our original team consisted of two full-stack engineers with AWS Solutions Architect certifications and a QA engineer (my wife). They say, “don’t work with family,” but I think it depends on the conditions.

The second engineer is her son, so we had open discussions all the time. In a corporate world where they demand you “act like a family,” you would never hear this level of agreement and/or disagreement. In most cases, it fell under the term ‘intellectual disagreement.’

Nevertheless, we agreed on this stack:

  • Programming Languages: Python, JavaScript
  • Frontend Framework: React Native
  • Backend Frameworks: AWS Lambda, Express.js
  • Database: DynamoDB
  • Cloud Services: AWS (Amplify, Cognito, S3, Rekognition, Lambda, Glue, Step Functions, DynamoDB, SSM Parameter Store, Secrets Manager, CloudWatch, AppSync, GraphQL, API Gateway, Pinpoint, Lex)
  • Machine Learning Frameworks: TensorFlow, Scikit-learn
  • API Management: GraphQL (also mentioned under Cloud Services)
  • Monitoring and Logging: CloudWatch (also mentioned under Cloud Services)
  • Version Control: Git
  • CI/CD: AWS CodePipeline
  • Other Tools: Jupyter Notebooks, ImageMagick

We chose Amplify due to the MVP nature of the product, allowing for quick deployment without overwhelming DevOps.

Longist’s simple splash screen with a color chosen based on the psychology of colors

When interacting with the app, the first screen users see is a Splash Screen with an animated gradient. We chose the color scheme based on color psychology, finding that orange and green are frequently used for emphasizing food details. Upon entering the app, users navigate to a login screen. It took three days to build it and three iterations to get it approved by Apple due to compliance issues with fonts, icons, and dimensions.

Following App Store guidance for the subsequent deployment was crucial for time savings.

When users log in, the first thing they do is take a picture of their food. We used React Native libraries along with the Scandit library for barcode scanning.

Users see the displayed minutes added or subtracted within 30 seconds.

Longist’s Home Screen before the food image is submitted
Longist’s Home Screen after the result is returned

Once a user takes a picture, the image is uploaded to an S3 bucket, triggering a Lambda function that sends a request to a recognition model to identify the type of food. The recognized dish is then matched with pre-written food categories and weights in a DynamoDB table.

Each category has a map of weights and minutes impact. The Lambda function then returns the longevity and health impact to the front end.

Users see the displayed minutes added or subtracted within 30 seconds.

When pressing on the result, they get a full impact analysis including:

  • Cognitive Function
  • Hormonal Balance
  • Skin Radiance
  • Emotional Resilience
  • Blood Sugar Stability
  • Allergy Management
  • Mood Regulation
  • Recovery
  • Inflammation Control
  • Vision Health
  • Blood Circulation
  • Hydration Levels
  • Metabolic Efficiency
  • Immune System Strength
  • Longevity
  • Cardiovascular Health
  • Gut Microbiome Diversity
  • Digestive Wellness
  • Organ Function
  • Sleep Quality
  • Muscular Strength
  • Bone Density
  • Nutrient Absorption
  • Stress Management
  • Appetite Control
  • Cellular Regeneration
  • Joint Flexibility
  • Pain Management
  • Respiratory Health
  • Energy Levels
  • Mental Clarity
  • Weight Management
  • Detoxification

Users can then save the result to their history, displayed in two tabs: weekly and meal-by-meal for months.

Longist’s Dish Impact Analysis
Longist’s History Screen by Dish

What makes this app special is that we haven’t included calorie counts. This might sound absurd, but there are already many apps focused on weight loss or muscle gain. Surprisingly, few people care about how long they will live. 1% of the world population, to be precise.

Consider these lifetime averages:

  • Sleeping: 26 years
  • Eating: 3.5 years
  • Working: 10.3 years
  • Watching TV: 9 years
  • Using Social Media: 5.3 years
  • Commuting: 4 years
  • Cleaning: 1.5 years
  • Exercising: 1.8 years
  • Shopping: 8 years
  • Schooling: 1.7 years
  • Bathing/Grooming: 1.5 years
  • Waiting in Line: 6 months
  • Health Appointments: 5 months
  • Cooking: 2.5 years
  • Reading: 2.5 years
  • Vacationing: 3 years

So why wouldn’t you care to gain 10 or more years of healthy living by knowing what you eat? I believe our obsession with calories is far from the reality that should make us happy.

To prove this point, I enrolled in a Harvard Medical School course, Health and Wellness: Designing a Sustainable Nutrition Plan, which made a cool title “Lifestyle Medicine Advocate.” Applying thorough analysis of the materials, most strategies are designed on meal planning without focusing on longevity.

If the purpose of life is to enjoy it and leave everything better than it was, then we need to be healthy, long-living humans with an efficient mindset.

Tabs and Plans

I mentioned the app’s tabs, each designed with a neumorphism paradigm to keep it clean and white, correlating with the app’s futuristic theme. If you use the app every day, redundant details can irritate, so we kept it simple.

After saving a positive result, the app navigates back to the home screen. If the result is negative, a motivational popup will appear with an option to navigate to the Longevity Recipes Marketplace.

Two things can be done after signing up (optional but recommended). When pressing on any of the plans, users are asked to complete a survey with 70 questions designed to inspect their health profile. Yes, we collect the data. Yes, we store it. No, we don’t sell it.

Longist’s Longevity Plan After Survey Completion

Users can decline the survey, but this will reduce the level of customization. Once users complete the survey, they can access the Longist Plan, Sport Plan, Workout Plan, and Mental Plan.

User Profile with an option to sell Longevity Recipes on the fly after completing in-app browser registration with Stripe

In the Longevity Recipes Marketplace, we’ve created enough recipes to follow a diet plan for six months. Users can also become sellers by creating an account via Stripe (navigating from Longist to in-app browser) and submitting unique recipes. We used the CopyLeaks API to prevent plagiarism.

Most apps and books either give away recipes or sell them for $20. With Longist, you can set any price for your recipes. There is no market for longevity recipes, so you could be the first to conquer it.

GraphQL and More

Much of our logic was accomplished with GraphQL, especially for creating a seller, recipe, published, and sold recipes. GraphQL is a saver if you want to deploy your app fast. We also utilized API built using the Express.js framework for pulling/updating metrics and history screens.

The final result assigns a Life Rate to the user, with a higher score being better. The AI model processes inputs, defines the correlation impact between each input on the user’s current age, calculates bio age, and gives a Life Rate score. It is a hard truth to see when the food we consume subtracts from our lifespan, and the same applies to bio age.

It is 42 in my case, when I’m 32. But let’s stop being soft and admit that we’ve lost track of how to be healthy physically and mentally nowadays.

Longist Survey Results Display Screen #1
Longist Survey Results Display Screen #2

Longist’s Stats

The data and profile returned include:

  • Average Life Expectancy
  • Life Expectancy Trend
  • Anticipated Life Expectancy
  • Life Rate
  • Activity
  • Bad Habits
  • Sleep
  • Wellness
  • Diet
  • Bio Age
  • Hydration
  • BMI

These are our alarm lights before it’s too late.

Smart Shopping and Future Plans

It took me 32 years to realize my cause and that my obsession with efficiency can help people.

The Nutrition Rich products search is still under development but partially completed. Users can input their dish or grocery name, and the AI model calculates the nutrient-rich density score and suggests an alternative.

We called this Smart Shopping, as these products often have a lower cost with higher quality for body impact.

Imagine how great it would be to have an additional 10 years and have no regrets at the age of 80, 90, or even 100. With my age, I am already asking myself, what’s the point of existence if we cannot be useful?

My goal with this post is to attempt to change two things in your mindset:

First, everything is possible.I know for sure that if even one out of every 100 people, we have succeeded. Change takes time and consistency.

It took me 32 years to realize my cause and that my obsession with efficiency can help people.

Especially right now.

We can blame the government for high inflation, a bad economy, war in Ukraine, Israel, climate change, and disasters, but ask yourself, can you be a change without expecting their change first?

I mentioned before that I am a self-taught engineer. I forced myself not to watch Netflix during COVID but to study how to code.

Despite ADHD, people claimed I should not pursue a career in coding. I believe grit must be developed in school, along with honor and etiquette for society to thrive.

Final Thoughts

Don’t be afraid to take risks. Absorb as much information as you can.

This application is not just an app (at least not for me); it is a small victory and a small protest to those who did not believe enough.

My goal is to inspire you and gain your support. This app is designed for healthy people now.

My request to the reader is, if you like the idea, the MVP, and think you have someone unhealthy in your family, share this article. Make it visible.

We are a small team of three, but if this app gains traction, we will develop features to help those affected by diabetes, cancer, obesity, dementia, hypertension, allergies, stroke, cardiovascular issues, substance abuse, stress, alcohol or laxative overuse, tobacco use, mental health, injuries, respiratory diseases, healthcare systems, viruses, and environmental quality.

As a side note: thank you, OpenAI, for creating such an amazing copilot. As a person who did not attend kindergarten, having a tool that understands me more than people was a life-changer.

Huge thanks to my wife, partner, and one of the best engineers I’ve met, her son. Sometimes working with family is worth it; you can discuss and implement ideas 24/7.

Don’t be afraid to take risks. Absorb as much information as you can.

In conclusion, referring to Ray Dalio’s article, building infrastructure (AI companies are already doing it with AI factories development) and education (your part) can prevent civil war in the US. I encourage you to develop critical thinking, avoid the influence of ideological subversion, and become a self-taught student in subjects that scare you.

Wishing you success on your journey!

Sincerely,
David Swarowski
longist.ai

#longist #LongevityApp #MobileAppDevelopment #PersonalJourney #Resilience #Inspiration #TechArchitecture #AWS #OpenAI #HealthTech #StartupStory #Motivation #SelfTaught #Efficiency #Wellness #LifeHacks #Innovation #CodingJourney #Entrepreneurship #OvercomingChallenges #HealthyLiving

--

--