We study a model where student eort and talent interact with parental and teachers' investments, as well as with school system resources. The model is rich, yet sufficiently stylized to provide novel implications. We can show, for example, that an improvement in parental outside options will reduce parental and school effort, which are partially compensated through school resources. In this way we provide a rationale for the ambiguous existing empirical evidence on the effect of school resources. We also provide a novel microfoundation for peer effects, with empirical implications on welfare and on preferences for sorting across schools.