June 18, 2021 7:02 AM EDT

On March 24, 2008, high school sweethearts Matthew and Liz Logelin became parents to their daughter Madeline. Though she arrived a few weeks early, Maddy was born a healthy baby. Her father marked the joyous occasion with a post on his blog, announcing that “Madeline is here!” But his happiness was shortlived. Twenty-seven hours after Maddy’s birth, Liz unexpectedly died after suffering a pulmonary embolism, leaving her husband to raise their daughter as a single father.

This devastating real-life tragedy is at the center of Paul Weitz’s new film Fatherhood, which releases on Netflix on June 18. The film follows Logelin (Kevin Hart) as he grapples with grief while attempting to parent his newborn daughter and honor the legacy of the woman he lost too soon. Though he’s a single parent, Logelin realizes he has a community of friends and family to help shape Maddy’s life, and he must learn how to lean on them, especially as she grows older. Fatherhood, which also stars Alfre Woodard, Lil Rel Howery and DeWanda Wise, traces Logelin’s journey as a young parent in both heartwarming and heartbreaking terms.

Logelin’s real life story was first captured on his blog, where he shared updates about navigating the loss of his wife amid the chaos of looking after a newborn. The blog eventually became a lifeline for many parents experiencing similar struggles, and Logelin was enveloped in support by an online community. He went on to write a memoir in 2011, Two Kisses for Maddy: A Memoir of Loss & Love, about his marriage, Liz’s death and raising their daughter. The Netflix film traces the first years of Maddy’s life and her childhood, and finds Logelin wrestling with what to do when he meets a new love interest (who is coincidentally also named Liz). Here, TIME takes a closer look at the true story behind the movie, the book it is based on and Kevin Hart’s involvement in adapting it for film.

Read more: The Most Anticipated Movies of Summer 2021

What happened to the Logelin family?

Matt and Liz Logelin were together for 12 years before her death. The pair met as teenagers, entering a long-distance relationship while they were in college that continued post-grad as Liz worked as a management consultant in California and Matt studied sociology at a graduate program in Chicago. After they married in 2005, the couple eventually settled down in Los Angeles, and bought a home a few months before learning Liz was pregnant.

As Logelin described in his book, Liz’s pregnancy was not easy and she was in the hospital on bedrest for several weeks before their daughter’s birth. “At night, when it got late and the visits from hospital staff became less frequent, Liz and I would fantasize about our future with our daughter,” Logelin wrote in Two Kisses for Maddy. “Liz talked of traveling the world, shopping for shoes and purses, mother-daughter spa trips for manis, pedis, and massages, and high tea at the ever-so-elegant Huntington Library.”

Lil Rel Howery and Kevin Hart in 'Fatherhood'
PHILIPPE BOSSE/NETFLIX © 2021—© 2021 Netflix, Inc.

Unfortunately, Liz would not be able to share any of these moments with her daughter. After Maddy was born, Logelin detailed what happened when Liz attempted to get out of bed the next day. She immediately became lightheaded and then fainted, and Logelin was ushered out of the hospital room. “All of a sudden it hit me,” Logelin wrote. “She was going to die, today, here in this hospital. And she was never going to hold her baby.” Liz suffered a pulmonary embolism, meaning there was a sudden blockage of an artery in her lungs. Pulmonary embolisms are one of the most severe complications associated with pregnancy and childbirth, and, according to Weill Cornell Medicine, are one of the leading causes of maternal deaths in developed countries as of 2017.

Sign up for More to the Story, TIME’s weekly entertainment newsletter, to get the context you need for the pop culture you love.

Sharing Liz’s story with the world

Logelin had started a personal blog during Liz’s pregnancy to stay connected with family and friends. When Liz died, he began using that space to share his heartbreak and open up about his struggles with parenthood. He found an outpouring of support from friends and strangers—thousands of people read his posts, and many left comments, with some offering parenting advice and others expressing sympathy over Logelin’s loss.

The popularity of Logelin’s blog catapulted both him and Maddy to Internet stardom—they made television appearances, and Logelin went on to create the Liz Logelin Foundation, which provides financial support to widows and widowers with young families. Logelin wrote that he was inspired to create a charitable foundation after receiving support from other widows in the aftermath of his wife’s death: “So strong and large was the community that spontaneously formed around us, it seemed not only natural, but necessary to harness the strength of that network and turn it into something—something that could help ease the pain and lighten the load felt by widows and widowers with children everywhere.”

Matt Logelin with his 18 month old daughter Maddy in 2009
David Brewster/Star Tribune via Getty Images

In 2011, Logelin published his memoir, which became a New York Times bestseller. In a review for the Hollywood Reporter, Andy Lewis wrote that the book was “heartbreaking, raw, moving and uplifting at the same time.” Producer David Beaubaire was moved by Logelin’s story, which he read after his daughter was born. “It was a really moving, realistic, and emotionally honest story about what it means to be a parent,” Beaubaire said, per Netflix. “An infant or a toddler does not know what you’re going through, and for their sake, life has to keep moving on.”

From memoir to film

Sony had initially announced it was developing a movie based on Logelin’s memoir in 2015 with plans for Channing Tatum to star. But the project was at a standstill for several years until Kevin Hart read the script and decided to get involved both as an actor and producer. “The author of the book is a white man, but ultimately the notion that you can build on his story and can create this experience for Black fathers that we haven’t seen in cinema in many, many years was deeply exciting,” Hart told Insider in June.

Behind the scenes on 'Fatherhood' with Matt Logelin and his daughter Maddy, and Kevin Hart
PHILIPPE BOSSE/NETFLIX © 2021—© 2021 Netflix, Inc.

Along with Sony and Hart’s production company, Barack and Michelle Obama’s production company Higher Ground also produced the film. Hart told Insider that he spoke to Obama about the story. “He really saw the opportunity in this movie for positive messaging attached to a Black man being a good father,” Hart said. Logelin met Hart on the set of Fatherhood, sharing in an interview on the Kelly Clarkson Show that he brought Maddy along with him. The author discussed how writing the book was an important part of his healing process, and how he was excited for a larger audience to see his story. “I hope they will get some inspiration from it, and they’ll just be blown away by Kevin and his ability to bring my experience and my feelings to the screen,” Logelin said. “It’s going to be a really great opportunity for people.”

More Must-Read Stories From TIME

Write to Annabel Gutterman at annabel.gutterman@time.com.

Read More From TIME
You May Also Like
EDIT POST