The COronal Diagnostic EXperiment (CODEX) is a Heliophysics mission to measure the density, temperature, and velocity of the electrons in the solar corona with the primary goal of improving our understanding of the physical conditions of the solar wind in the acceleration region. The temperature and velocity measurement requires much higher signal-to-noise ratio than the density measurements. In solar coronagraphs, the diffraction of the solar disk light due to the occulting element is the dominant source of noise. Therefore, to further suppress the diffracted sun light with respect to the existing coronagraphs is a critical element of the CODEX design. To minimize the stray light due to diffraction, the selected optical design is a two-stage standard coronagraph with an external occulter, an internal occulter, and a Lyot stop. What is unique for this design is that a focal mask was inserted at the telescope focal plane. It works together with the field lens suppressing the stray light down by ~ another order of magnitude as compared to a traditional three-stage approach. During the optical design, a Fourier Transform based beam propagation software, i.e., GLAD, was used to model the beam path through the full coronagraph, from the external occulter to the detector array. All diffraction sensitive elements: external occulter, internal occulter, focal mask, and Lyot stop were carefully modeled and optimized. As a result, the requirement of achieving a stray light level which is one order of magnitude lower than F-corona was satisfied. On the other hand, to achieve the final suppression, a precision optical alignment is another must. This paper also presents our creative alignment procedure: using the combination of metrology, precision alignment equipment, and real time diffraction ring monitoring to minimize the diffraction. The final test results show that the suppression ratio (B/B0) reaches 10 -11 level, which is equivalent to one order of magnitude lower than F-corona.