Let R = F q + uF q + vF q + uvF q , with u 2 = u, v 2 = v, uv = vu, where q = p m for a positive integer m and an odd prime p. We study the algebraic structure of F q R-cyclic codes of block length (r, s). These codes can be viewed as R[x]-submodules of F q [x]/ x r − 1 × R[x]/ x s − 1. For this family of codes we discuss the generator polynomials and minimal generating sets. We study the algebraic structure of separable codes. Further, we discuss the duality of this family of codes and determine their generator polynomials. We obtain several optimal and near-optimal codes from this study. As applications, we discuss a construction of quantum error-correcting codes (QECCs) from F q R-cyclic codes and construct some good QECCs. INDEX TERMS F q R-cyclic codes, Generator polynomials, Minimal generating sets, QECCs.