Just before; on the verge of; on the brink of — indicates a moment immediately before something happens.
電車が出発する寸前にホームに飛び込んだ。
I jumped onto the platform just before the train departed.
発射寸前でミサイルが停止した。
The missile stopped just before launch.
合格発表の寸前は緊張する。
You feel nervous right before the exam results are announced.
Just in front of; just ahead of — indicating something located immediately before or ahead.
店の寸前で雨が降り始めた。
It started raining just before we reached the shop.
出口の寸前で立ち止まってしまった。
I stopped right before the exit.
試験の寸前まで勉強していた。
I was studying up until just before the exam.