I am trying to show that $S_3$ is isomorphic to $D_3$ as groups. The definitions I'm working with are $$ S_3 = \left \langle (12), (123) \right \rangle, \; D_3 = \left \langle r, s \mid r^3 = s^2 = 1, \; sr = r^{-1} s\right \rangle. $$ My thought process is that I can map generators to generators. So I can send $(12) \to s$ and $(123) \to r$, where $s$ is some reflection and $r$ a counterclockwise rotation by $\frac{2\pi}{3}$ radians. If I define such a map $\phi: S_3 \to D_3$, I can show that $(12)$ and $(123)$ satisfy the same defining relations as $D_3$. I believe that gives the homomorphism property, but I'm not completely sure how to show that is a bijection of sets. I'd like to write an element of $S_3$ in the form $(12)^i (123)^j$ for $i \in \{0,1\}$ and $j \in \{0,1,2\}$, but this won't work for every element because I may need to swap the order; if I allow inverses, I think this may work. Then I'd apply $\phi$ and need to show that every element of $D_3$ is accounted for exactly once. In fact, since, as sets, both $S_3$ and $D_3$ have the same order, I'd only need to check one of injectivity or surjectivity.
My main questions are:
Is it enough, for a homomorphism, to check that the image of $S_3$ under $\phi$ satisfy the same defining relations?
How can I formalize the notion of $(12)$ and $(123)$ generating $S_3$ in order to show that $\phi$ is bijective? Is the idea that I have in mind on the right track, and would it work if I allow $i$ and $j$ to be negative?