I read this young-adult science-fiction book about 10 years ago, I believe I may have picked it up through an advance reader copy program. If it was an ARC, details may have been changed before publishing. That, combined with my fairly poor memory, mean the following details are probably inexact to some extent.
This is what I remember, and it's all subject to the stipulation of "if I recall correctly."
The story starts on a small inhabited island somewhere off the East coast of the United States, and centers around an adolescent boy and two of his friends. Strange soldiers suddenly appear and the three have to flee their island town on bikes, making it to a wooded area on the island. From there they are able to escape the island and make it to the East coast of the mainland U.S.
They find all the towns they come across have been completely abandoned. Some time later, when they reach a large city, they see a black angular ship in the sky shooting beams of light at the ground in the distance and hide from it. I believe they meet up with some survivors who are able to share information about the invasion.
I forget what plot points lead them there, but eventually they discover a labor camp where survivors are being forced to build structures for an unknown purpose. The main character is captured and forced to work in the camp. He discovers that the invaders are coming through a portal in or near the camp and manages to sneak in and cross through the portal. On the other side he finds a future Earth.
He finds out that future Earth has discovered how to travel through time to parallel universes, and that they are invading these parallel Earths for resources to sustain their civilization's demands. The method of generating a portal to a parallel past Earth was constructing a reinforced dome and detonating a nuclear bomb at the epicenter, using the energy to tear open the dimensional portal (I believe I remember that portals could only be linked to the epicenter of another nuclear explosion, meaning future Earth could only travel back to the atomic age or later).
The main character and his friends are found out by authorities in future Earth and have to escape. I forget exactly how, but they end up opening their own dimensional portal to an Earth in the more distant past to escape; emerging at a nuclear test site some time during the Cold War. They are found and examined by military personnel in this distant-past Earth, and are eventually released to live their lives.
They use knowledge of the future to make investments that make them wealthy while being cautious to avoid an outsize impact on the future, and they intend to use their influence and knowledge to prevent an invasion from future Earth to the Earth they ended up at. At the very end, the main character is much older and locates his younger self from this parallel Earth. He approaches his younger self and offers him a job.
That's all I remember about the story, and I may have confused some details with details from other books or misremembered them entirely. I thought I remembered the book having a short, one-world title, stylized in all-caps, starting with the letter S. Something like SILO, SAIL, SIREN, etc, but I searched the possible titles I could think of and didn't turn up anything. The one specific detail I'm almost certain of is the idea of using nukes detonated inside of reinforced domes to create the interdimensional portals.