WMG / Melancholia

The first half is real, the second half of the movie is a nightmare that Justine is having as she finally catches some sleep after the overnight wedding.

The wedding in the first part is shown to drag on forever, starting hours later than planned and lasting well into the next morning, and is a miserable experience for all involved. When the bride, exhausted and depressed, is finally able to get some sleep, she dreams the second half of the movie.

While Lars Von Trier freely states they made no attempt to get the astrophysics correct, they did a decent enough job to make Melancholia believable within "dream logic" (i.e. You accept it during the dream; only after waking up are you able to rationalize that the content of the dream was impossible.)

If the second half is not a dream, then civilization is collapsing off-screen

The entirety of the film takes place at a remote, wealthy estate. We never hear or see any news reports about what is almost certainly the single biggest event in recorded human history. Given what that event is, the rest of the world must be in utter chaos.

The planet is simply a metaphor for the ways in which depression destroys lives on both the individual and family level.

Justine's wedding shows a more prosaic sense of how depression can wrack an entire family, but the second half of the film is more an abstract reflection on the aftermath of how depression ravages a family. When Claire does a search for "melancholia," most of the hits are simply for depression. In a way, all of the characters are simply caricatures of different styles of melancholy: Justine is depressed, inward-turned, and lethargic, while her sister Claire is more anxious and frenetic when under crisis.

This reading of Claire also explains her husband John's behavior: he tends to be dismissive of Justine's depression, of Claire's fears. He insists that Claire not surf the internet — much like a beleaguered spouse might insist that their hypochondriac partner not surf the web — in a manner both nurturing and condescending. However, when he realizes that the crisis is inevitable, his rational framework falls apart, and he commits suicide.

Melancholia is the sequel to 2001: A Space Odyssey

As the Star-Child, Bowman returns to Earth to discover that the interference of the Monoliths has utterly ruptured his world's timeline so that by 2001 mankind has not reached the technological brilliance he was accustomed to; in fact, by 2012 they're still as superstitious and unenlightened as ever. Angry that he is the only enlightened human left, he assumes the form of an immense planet and rams the Earth, destroying what he sees as a doomed species.

The planet is Hellstar Remina.

The planet is Unicron.

The Earth we saw destroyed is not OUR Earth.
But an identical planet in the same universe.

The entire film takes place in the Warhammer40k Universe
The planet the film is depicted on is not Earth, but in fact a random Imperial Colony/hive world that is about to be attacked by a mass planetary projectile sent by one of the countless enemies of the Imperium. A distress signal is sent out for help from any one in the imperial military to either destroy or at least slow down the object enough to allow at least a small enough evacuation off colony.

But this doesnt happen, as it is clearly stated in-universe the defense forces of the Imperium have been severely depleted over the millennia (just as its said in Dredd(2015) the judges are so far and few between they can only protect as small as 10 to 15 percent of Mega City One) so either the Imperium had received the message and only didn't have the resources or troops to aid them in their plight, or just as likely the hive world probably wasn't vital to overall needs so they decided to sacrifice the planet to stretch imperial resources.

So instead of interstellar saviours such as squads of Space Marines or Exterminatus wielding Imperial Knights they get Nothing. So all that occurs is probably some of the population evacuated into underground bunkers in the false hope of safety from the initial blast and thousands (if not millions) of colonists desperately sending countless prayers to the Emperor and the Omnisiah for survival. With the remaining populace rioting in the streets.

Nothing of the outside world is really ever mentioned throughout the film and most of the story intentionally invokes Grim Dark till its coming out of the characters ears. In fact {It Was Tuesday this kind of stuff happens a lot} so this could even be seen as a simple slice of life story within the 40k universe.
http://tvtropes.org/pmwiki/pmwiki.php/WMG/Melancholia