The present invention relates to compounds and methods for treating viral infections (e.g., Hepatitis B viral infections). The compounds of the disclosure are described by formula I:or a pharmaceutically acceptable salt, stereoisomer, a diastereomer, an enantiomer or racemate thereof.