Fetching details from the dictionary...

just before; just prior to
right in front of; just in front of
試験直前になって慌てて勉強を始めても遅いよ。
It's too late to start studying in a panic right before the exam.
出発直前にパスポートを忘れたことに気づいた。
I realized just before departure that I had forgotten my passport.
締め切り直前に原稿を提出することになった。
I ended up submitting the manuscript just before the deadline.