The self-consistent field theory (SCFT) is a powerful framework for the study of the phase behavior and structural properties of many-body systems. In particular, polymeric SCFT has been successfully applied to inhomogeneous polymeric systems such as polymer blends and block copolymer melts. The polymeric SCFT is commonly derived using field-theoretical techniques. Here we provide an alternative derivation of the SCFT equations and SCFT free energy functional using a variational principle. Numerical methods of solving the SCFT equations and applications of the SCFT are also briefly introduced.