There is a well-worn transfer pathway from California community colleges to CSUs or UCs.
Students starting at California community colleges need to fulfill basic requirements and major preparation requirements. Completing general education course work or the IGETC pattern is optional but helpful. https://www.assist.org can help you with major preparation and other course work. The general CSU and UC web sites should be checked for basic requirements.
The time line you list is unrealistic. Typically, you would expect to spend two years at a community college and then two years at a CSU or UC to complete a bachelor’s degree. A PhD program if you intend a research career in the subject would take several more years. Law school is generally a three year (expensive) program. Most people do not intend to do both a PhD and JD.